aboutsummaryrefslogtreecommitdiffstats
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2007-10-03 14:39:15 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-03 14:39:15 -0700
commit449f5d31314da678c7595b495397cf97001b13d7 (patch)
tree31617d29ec5065154abb174ca33ce01ac4fce9da
parentbae7b97b9d4c87415a97d40ccec141fe239b57e7 (diff)
downloadpatches-449f5d31314da678c7595b495397cf97001b13d7.tar.gz
pci and usb patches added
-rw-r--r--pci/msi-use-correct-data-offset-for-32-bit-msi-in-read_msi_msg.patch35
-rw-r--r--pci/pci-fix-ide-legacy-mode-resources.patch113
-rw-r--r--pci/pci_bridge-device.patch2
-rw-r--r--series9
-rw-r--r--usb/usb-drivers-usb-misc-sisusbvga-sisusb.c-kill-two-unused-variables.patch32
-rw-r--r--usb/usb-fix-gregkh-usb-usb-sisusb2vga-convert-printk-to-dev_-macros.patch46
-rw-r--r--usb/usb-gadget-ether-prevent-oops-caused-by-error-interrupt-race.patch57
-rw-r--r--usb/usb-r8a66597-hcd-fix-class-or-vendor-request.patch45
-rw-r--r--usb/usb-r8a66597-hcd-fix-endian-problem.patch47
-rw-r--r--usb/usb-serial-gadget-disable-endpoints-on-unload.patch36
-rw-r--r--version2
11 files changed, 422 insertions, 2 deletions
diff --git a/pci/msi-use-correct-data-offset-for-32-bit-msi-in-read_msi_msg.patch b/pci/msi-use-correct-data-offset-for-32-bit-msi-in-read_msi_msg.patch
new file mode 100644
index 00000000000000..df7758dcc98509
--- /dev/null
+++ b/pci/msi-use-correct-data-offset-for-32-bit-msi-in-read_msi_msg.patch
@@ -0,0 +1,35 @@
+From owner-linux-pci@atrey.karlin.mff.cuni.cz Wed Oct 3 11:14:41 2007
+From: Roland Dreier <roland@digitalvampire.org>
+Date: Wed, 03 Oct 2007 11:15:11 -0700
+Subject: MSI: Use correct data offset for 32-bit MSI in read_msi_msg()
+To: Greg KH <greg@kroah.com>
+Cc: Eric W. Biederman <ebiederm@xmission.com>
+Message-ID: <87abr0oyj4.fsf@shaolin.home.digitalvampire.org>
+
+
+While reading the MSI code trying to find a reason why MSI wouldn't
+work for devices that have a 32-bit MSI address capability, I noticed
+that read_msi_msg() seems to read the message data from the wrong
+offset in this case.
+
+Signed-off-by: Roland Dreier <roland@digitalvampire.org>
+Acked-by: Eric W. Biederman <ebiederm@xmission.com>
+Cc: stable <stable@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+
+---
+ drivers/pci/msi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/pci/msi.c
++++ b/drivers/pci/msi.c
+@@ -132,7 +132,7 @@ void read_msi_msg(unsigned int irq, stru
+ pci_read_config_word(dev, msi_data_reg(pos, 1), &data);
+ } else {
+ msg->address_hi = 0;
+- pci_read_config_word(dev, msi_data_reg(pos, 1), &data);
++ pci_read_config_word(dev, msi_data_reg(pos, 0), &data);
+ }
+ msg->data = data;
+ break;
diff --git a/pci/pci-fix-ide-legacy-mode-resources.patch b/pci/pci-fix-ide-legacy-mode-resources.patch
new file mode 100644
index 00000000000000..321678d1a0a377
--- /dev/null
+++ b/pci/pci-fix-ide-legacy-mode-resources.patch
@@ -0,0 +1,113 @@
+From akpm@linux-foundation.org Tue Oct 2 14:19:32 2007
+From: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+Date: Tue, 02 Oct 2007 14:19:23 -0700
+Subject: PCI: fix IDE legacy mode resources
+To: greg@kroah.com
+Cc: akpm@linux-foundation.org, yoichi_yuasa@tripeaks.co.jp, alan@lxorguk.ukuu.org.uk, bzolnier@gmail.com, ralf@linux-mips.org
+Message-ID: <200710022119.l92LJNwh022851@imap1.linux-foundation.org>
+
+
+From: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+
+I got the following error on MIPS Cobalt.
+
+PCI: Unable to reserve I/O region #1:8@f00001f0 for device 0000:00:09.1
+pata_via 0000:00:09.1: failed to request/iomap BARs for port 0 (errno=-16)
+PCI: Unable to reserve I/O region #3:8@f0000170 for device 0000:00:09.1
+pata_via 0000:00:09.1: failed to request/iomap BARs for port 1 (errno=-16)
+pata_via 0000:00:09.1: no available native port
+
+The legacy mode IDE resources set the following order.
+
+pci_setup_device()
+ Legacy mode ATA controllers have fixed addresses.
+ IDE resources: 0x1F0-0x1F7, 0x3F6, 0x170-0x177, 0x376
+ |
+ V
+pcibios_fixup_bus()
+ MIPS Cobalt PCI bus regions have the -0x10000000 offset from PCI resources.
+ pcibios_fixup_bus() fix PCI bus regions.
+ 0x1F0 - 0x10000000 = 0xF00001F0
+ |
+ V
+ata_pci_init_one()
+ PCI: Unable to reserve I/O region #1:8@f00001f0 for device 0000:00:09.1
+
+In some architectures, PCI bus regions have the offset from PCI resources.
+For this reason, pci_setup_device() should set PCI bus regions to
+dev->resource[].
+
+[akpm@linux-foundation.org: use struct initialiser]
+Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
+Cc: Greg KH <greg@kroah.com>
+Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
+Cc: Ralf Baechle <ralf@linux-mips.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/pci/probe.c | 48 ++++++++++++++++++++++++++++++++++++------------
+ 1 file changed, 36 insertions(+), 12 deletions(-)
+
+--- a/drivers/pci/probe.c
++++ b/drivers/pci/probe.c
+@@ -744,22 +744,46 @@ static int pci_setup_device(struct pci_d
+ */
+ if (class == PCI_CLASS_STORAGE_IDE) {
+ u8 progif;
++ struct pci_bus_region region;
++
+ pci_read_config_byte(dev, PCI_CLASS_PROG, &progif);
+ if ((progif & 1) == 0) {
+- dev->resource[0].start = 0x1F0;
+- dev->resource[0].end = 0x1F7;
+- dev->resource[0].flags = LEGACY_IO_RESOURCE;
+- dev->resource[1].start = 0x3F6;
+- dev->resource[1].end = 0x3F6;
+- dev->resource[1].flags = LEGACY_IO_RESOURCE;
++ struct resource resource = {
++ .start = 0x1F0,
++ .end = 0x1F7,
++ .flags = LEGACY_IO_RESOURCE,
++ };
++
++ pcibios_resource_to_bus(dev, &region, &resource);
++ dev->resource[0].start = region.start;
++ dev->resource[0].end = region.end;
++ dev->resource[0].flags = resource.flags;
++ resource.start = 0x3F6;
++ resource.end = 0x3F6;
++ resource.flags = LEGACY_IO_RESOURCE;
++ pcibios_resource_to_bus(dev, &region, &resource);
++ dev->resource[1].start = region.start;
++ dev->resource[1].end = region.end;
++ dev->resource[1].flags = resource.flags;
+ }
+ if ((progif & 4) == 0) {
+- dev->resource[2].start = 0x170;
+- dev->resource[2].end = 0x177;
+- dev->resource[2].flags = LEGACY_IO_RESOURCE;
+- dev->resource[3].start = 0x376;
+- dev->resource[3].end = 0x376;
+- dev->resource[3].flags = LEGACY_IO_RESOURCE;
++ struct resource resource = {
++ .start = 0x170,
++ .end = 0x177,
++ .flags = LEGACY_IO_RESOURCE,
++ };
++
++ pcibios_resource_to_bus(dev, &region, &resource);
++ dev->resource[2].start = region.start;
++ dev->resource[2].end = region.end;
++ dev->resource[2].flags = resource.flags;
++ resource.start = 0x376;
++ resource.end = 0x376;
++ resource.flags = LEGACY_IO_RESOURCE;
++ pcibios_resource_to_bus(dev, &region, &resource);
++ dev->resource[3].start = region.start;
++ dev->resource[3].end = region.end;
++ dev->resource[3].flags = resource.flags;
+ }
+ }
+ break;
diff --git a/pci/pci_bridge-device.patch b/pci/pci_bridge-device.patch
index 9ec224987a59c9..cffed313d23130 100644
--- a/pci/pci_bridge-device.patch
+++ b/pci/pci_bridge-device.patch
@@ -183,7 +183,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
}
struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr)
-@@ -1107,32 +1098,27 @@ struct pci_bus * pci_create_bus(struct d
+@@ -1131,32 +1122,27 @@ struct pci_bus * pci_create_bus(struct d
goto dev_reg_err;
b->bridge = get_device(dev);
diff --git a/series b/series
index bca71242a03346..0dcd2609796979 100644
--- a/series
+++ b/series
@@ -126,6 +126,8 @@ pci/pci-re-enable-onboard-sound-on-msi-k8t-neo2-fir.patch
pci/pci-remove-no-longer-correct-documentation-regarding-msi-vector-assignment.patch
pci/pci-i386-compaq-evo-n800c-needs-pci-bus-renumbering.patch
pci/pci-fix-incorrect-argument-order-to-list_add_tail-in-pci-dynamic-id-code.patch
+pci/msi-use-correct-data-offset-for-32-bit-msi-in-read_msi_msg.patch
+pci/pci-fix-ide-legacy-mode-resources.patch
# akpm reports that this breaks his x86 box, wait until that is sorted out before sending to Linus
pci/pci_bridge-device.patch
@@ -256,6 +258,13 @@ usb/usb-cxacru-use-appropriate-logging-for-errors.patch
usb/usb-driver-for-ch341-usb-serial-adaptor.patch
usb/usb-usb-serial-ch341.c-make-4-functions-static.patch
+usb/usb-r8a66597-hcd-fix-class-or-vendor-request.patch
+usb/usb-r8a66597-hcd-fix-endian-problem.patch
+usb/usb-fix-gregkh-usb-usb-sisusb2vga-convert-printk-to-dev_-macros.patch
+usb/usb-gadget-ether-prevent-oops-caused-by-error-interrupt-race.patch
+usb/usb-drivers-usb-misc-sisusbvga-sisusb.c-kill-two-unused-variables.patch
+usb/usb-serial-gadget-disable-endpoints-on-unload.patch
+
# my ols tutorial driver, never in mainline
diff --git a/usb/usb-drivers-usb-misc-sisusbvga-sisusb.c-kill-two-unused-variables.patch b/usb/usb-drivers-usb-misc-sisusbvga-sisusb.c-kill-two-unused-variables.patch
new file mode 100644
index 00000000000000..82df485a469c73
--- /dev/null
+++ b/usb/usb-drivers-usb-misc-sisusbvga-sisusb.c-kill-two-unused-variables.patch
@@ -0,0 +1,32 @@
+From akpm@linux-foundation.org Tue Oct 2 14:40:55 2007
+From: WANG Cong <xiyou.wangcong@gmail.com>
+Date: Tue, 02 Oct 2007 14:40:49 -0700
+Subject: USB: drivers/usb/misc/sisusbvga/sisusb.c: kill two unused variables
+To: greg@kroah.com
+Cc: linux-usb-devel@lists.sourceforge.net, akpm@linux-foundation.org, xiyou.wangcong@gmail.com
+Message-ID: <200710022140.l92Lenxa023770@imap1.linux-foundation.org>
+
+
+From: WANG Cong <xiyou.wangcong@gmail.com>
+
+Kill two unused variables in drivers/usb/misc/sisusbvga/sisusb.c.
+
+Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/misc/sisusbvga/sisusb.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/drivers/usb/misc/sisusbvga/sisusb.c
++++ b/drivers/usb/misc/sisusbvga/sisusb.c
+@@ -3316,8 +3316,6 @@ static struct usb_driver sisusb_driver =
+
+ static int __init usb_sisusb_init(void)
+ {
+- int retval;
+- struct sisusb_usb_data *sisusb;
+
+ #ifdef INCL_SISUSB_CON
+ sisusb_init_concode();
diff --git a/usb/usb-fix-gregkh-usb-usb-sisusb2vga-convert-printk-to-dev_-macros.patch b/usb/usb-fix-gregkh-usb-usb-sisusb2vga-convert-printk-to-dev_-macros.patch
new file mode 100644
index 00000000000000..94ce98d840a20c
--- /dev/null
+++ b/usb/usb-fix-gregkh-usb-usb-sisusb2vga-convert-printk-to-dev_-macros.patch
@@ -0,0 +1,46 @@
+From akpm@linux-foundation.org Tue Oct 2 14:41:03 2007
+From: Andrew Morton <akpm@linux-foundation.org>
+Date: Tue, 02 Oct 2007 14:40:46 -0700
+Subject: USB: fix gregkh-usb-usb-sisusb2vga-convert-printk-to-dev_-macros
+To: greg@kroah.com
+Cc: linux-usb-devel@lists.sourceforge.net, akpm@linux-foundation.org, felipe.lima@indt.org.br, thomas@winischhofer.net
+Message-ID: <200710022140.l92LekM7023764@imap1.linux-foundation.org>
+
+
+From: Andrew Morton <akpm@linux-foundation.org>
+
+drivers/usb/misc/sisusbvga/sisusb.c: In function 'sisusb_open':
+drivers/usb/misc/sisusbvga/sisusb.c:2444: warning: 'sisusb' is used uninitialized in this function
+
+I can tell that'll oops just by looking at it.
+
+How come this code assume a 7,000 column xterm? :(
+
+Cc: Felipe Balbi <felipe.lima@indt.org.br>
+Cc: Thomas <thomas@winischhofer.net>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/misc/sisusbvga/sisusb.c | 10 +---------
+ 1 file changed, 1 insertion(+), 9 deletions(-)
+
+--- a/drivers/usb/misc/sisusbvga/sisusb.c
++++ b/drivers/usb/misc/sisusbvga/sisusb.c
+@@ -3323,15 +3323,7 @@ static int __init usb_sisusb_init(void)
+ sisusb_init_concode();
+ #endif
+
+- if (!(retval = usb_register(&sisusb_driver))) {
+-
+- dev_info(&sisusb->sisusb_dev->dev, "Driver version %d.%d.%d\n", SISUSB_VERSION,
+- SISUSB_REVISION, SISUSB_PATCHLEVEL);
+- dev_info(&sisusb->sisusb_dev->dev, "sisusb: Copyright (C) 2005 Thomas Winischhofer\n");
+-
+- }
+-
+- return retval;
++ return usb_register(&sisusb_driver);
+ }
+
+ static void __exit usb_sisusb_exit(void)
diff --git a/usb/usb-gadget-ether-prevent-oops-caused-by-error-interrupt-race.patch b/usb/usb-gadget-ether-prevent-oops-caused-by-error-interrupt-race.patch
new file mode 100644
index 00000000000000..5b845e2fb79cf8
--- /dev/null
+++ b/usb/usb-gadget-ether-prevent-oops-caused-by-error-interrupt-race.patch
@@ -0,0 +1,57 @@
+From akpm@linux-foundation.org Tue Oct 2 14:40:55 2007
+From: Benedikt Spranger <bene@linutronix.de>
+Date: Tue, 02 Oct 2007 14:40:48 -0700
+Subject: usb-gadget-ether: prevent oops caused by error interrupt race
+To: greg@kroah.com
+Cc: linux-usb-devel@lists.sourceforge.net, akpm@linux-foundation.org, bene@linutronix.de, dbrownell@users.sourceforge.net, tglx@linutronix.de
+Message-ID: <200710022140.l92LemTT023767@imap1.linux-foundation.org>
+
+
+From: Benedikt Spranger <bene@linutronix.de>
+
+Fix a longstanding race in the Ethernet gadget driver, which can cause an
+oops on device disconnect. The fix is just to make the TX path check
+whether its freelist is empty. That check is otherwise not necessary,
+since the queue is always stopped when that list empties (and restarted
+when request completion puts an entry back on that freelist).
+
+The race window starts when the network code decides to transmit a packet,
+and ends when hard_start_xmit() grabs the freelist lock. When disconnect()
+is called inside that window, it shuts down the TX queue and breaks the
+otherwise-solid assumption that packets are never sent through a TX queue
+that's stopped.
+
+Signed-off-by: Benedikt Spranger <bene@linutronix.de>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Cc: stable <stable@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/gadget/ether.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+--- a/drivers/usb/gadget/ether.c
++++ b/drivers/usb/gadget/ether.c
+@@ -1957,8 +1957,20 @@ static int eth_start_xmit (struct sk_buf
+ }
+
+ spin_lock_irqsave(&dev->req_lock, flags);
++ /*
++ * this freelist can be empty if an interrupt triggered disconnect()
++ * and reconfigured the gadget (shutting down this queue) after the
++ * network stack decided to xmit but before we got the spinlock.
++ */
++ if (list_empty(&dev->tx_reqs)) {
++ spin_unlock_irqrestore(&dev->req_lock, flags);
++ return 1;
++ }
++
+ req = container_of (dev->tx_reqs.next, struct usb_request, list);
+ list_del (&req->list);
++
++ /* temporarily stop TX queue when the freelist empties */
+ if (list_empty (&dev->tx_reqs))
+ netif_stop_queue (net);
+ spin_unlock_irqrestore(&dev->req_lock, flags);
diff --git a/usb/usb-r8a66597-hcd-fix-class-or-vendor-request.patch b/usb/usb-r8a66597-hcd-fix-class-or-vendor-request.patch
new file mode 100644
index 00000000000000..488583de0c19b3
--- /dev/null
+++ b/usb/usb-r8a66597-hcd-fix-class-or-vendor-request.patch
@@ -0,0 +1,45 @@
+From shimoda.yoshihiro@renesas.com Wed Oct 3 02:51:30 2007
+From: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
+Date: Wed, 03 Oct 2007 18:53:13 +0900
+Subject: USB: r8a66597-hcd: fix Class or Vendor Request
+To: greg@kroah.com
+Message-ID: <47036689.50402@renesas.com>
+
+
+Fixed the problem that does not work in the case of bRequest = 0x05 in
+Class or Vendor Request.
+
+Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/host/r8a66597-hcd.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+--- a/drivers/usb/host/r8a66597-hcd.c
++++ b/drivers/usb/host/r8a66597-hcd.c
+@@ -1034,6 +1034,15 @@ static void prepare_status_packet(struct
+ pipe_start(r8a66597, td->pipe);
+ }
+
++static int is_set_address(unsigned char *setup_packet)
++{
++ if (((setup_packet[0] & USB_TYPE_MASK) == USB_TYPE_STANDARD) &&
++ setup_packet[1] == USB_REQ_SET_ADDRESS)
++ return 1;
++ else
++ return 0;
++}
++
+ /* this function must be called with interrupt disabled */
+ static int start_transfer(struct r8a66597 *r8a66597, struct r8a66597_td *td)
+ {
+@@ -1041,7 +1050,7 @@ static int start_transfer(struct r8a6659
+
+ switch (td->type) {
+ case USB_PID_SETUP:
+- if (td->urb->setup_packet[1] == USB_REQ_SET_ADDRESS) {
++ if (is_set_address(td->urb->setup_packet)) {
+ td->set_address = 1;
+ td->urb->setup_packet[2] = alloc_usb_address(r8a66597,
+ td->urb);
diff --git a/usb/usb-r8a66597-hcd-fix-endian-problem.patch b/usb/usb-r8a66597-hcd-fix-endian-problem.patch
new file mode 100644
index 00000000000000..9064a5f44df1bc
--- /dev/null
+++ b/usb/usb-r8a66597-hcd-fix-endian-problem.patch
@@ -0,0 +1,47 @@
+From shimoda.yoshihiro@renesas.com Wed Oct 3 02:51:45 2007
+From: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
+Date: Wed, 03 Oct 2007 18:53:28 +0900
+Subject: USB: r8a66597-hcd: fix endian problem
+To: greg@kroah.com
+Cc: linux-usb-devel@lists.sourceforge.net
+Message-ID: <47036698.2000802@renesas.com>
+
+
+Fixed the problem that does not work in the big endian machine.
+
+Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/host/r8a66597-hcd.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/host/r8a66597-hcd.c
++++ b/drivers/usb/host/r8a66597-hcd.c
+@@ -834,7 +834,7 @@ static void init_pipe_info(struct r8a665
+ info.pipenum = get_empty_pipenum(r8a66597, ep);
+ info.address = get_urb_to_r8a66597_addr(r8a66597, urb);
+ info.epnum = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
+- info.maxpacket = ep->wMaxPacketSize;
++ info.maxpacket = le16_to_cpu(ep->wMaxPacketSize);
+ info.type = get_r8a66597_type(ep->bmAttributes
+ & USB_ENDPOINT_XFERTYPE_MASK);
+ info.bufnum = get_bufnum(info.pipenum);
+@@ -925,7 +925,7 @@ static void prepare_setup_packet(struct
+ r8a66597_write(r8a66597, ~(SIGN | SACK), INTSTS1);
+
+ for (i = 0; i < 4; i++) {
+- r8a66597_write(r8a66597, p[i], setup_addr);
++ r8a66597_write(r8a66597, cpu_to_le16(p[i]), setup_addr);
+ setup_addr += 2;
+ }
+ r8a66597_write(r8a66597, SUREQ, DCPCTR);
+@@ -2027,7 +2027,7 @@ static int r8a66597_hub_control(struct u
+ case GetPortStatus:
+ if (wIndex > R8A66597_MAX_ROOT_HUB)
+ goto error;
+- *(u32 *)buf = rh->port;
++ *(u32 *)buf = cpu_to_le32(rh->port);
+ break;
+ case SetPortFeature:
+ if (wIndex > R8A66597_MAX_ROOT_HUB)
diff --git a/usb/usb-serial-gadget-disable-endpoints-on-unload.patch b/usb/usb-serial-gadget-disable-endpoints-on-unload.patch
new file mode 100644
index 00000000000000..ed77997b918f9c
--- /dev/null
+++ b/usb/usb-serial-gadget-disable-endpoints-on-unload.patch
@@ -0,0 +1,36 @@
+From vitb@kernel.crashing.org Wed Sep 26 13:36:38 2007
+From: Vitaly Bordug <vitb@kernel.crashing.org>
+Date: Thu, 27 Sep 2007 00:36:22 +0400
+Subject: USB: serial gadget: Disable endpoints on unload
+To: Greg KH <greg@kroah.com>
+Cc: linuxppc-dev@ozlabs.org
+Cc: linuxppc-dev@ozlabs.org
+Message-ID: <20070926203622.24118.36016.stgit@localhost.localdomain>
+
+
+
+After Serial gadget is being unloaded, neither serial itself, nor other
+gadget stuff can be loaded subsequently.
+
+Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/gadget/serial.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/usb/gadget/serial.c
++++ b/drivers/usb/gadget/serial.c
+@@ -1470,6 +1470,12 @@ static void /* __init_or_exit */ gs_unbi
+ dev->dev_ctrl_req = NULL;
+ }
+ gs_free_ports(dev);
++ if (dev->dev_notify_ep)
++ usb_ep_disable(dev->dev_notify_ep);
++ if (dev->dev_in_ep)
++ usb_ep_disable(dev->dev_in_ep);
++ if (dev->dev_out_ep)
++ usb_ep_disable(dev->dev_out_ep);
+ kfree(dev);
+ set_gadget_data(gadget, NULL);
+ }
diff --git a/version b/version
index d87486ed9aebe7..c085a4211902b2 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-2.6.23-rc8-git2
+2.6.23-rc9