aboutsummaryrefslogtreecommitdiffstats
path: root/usb
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2008-10-01 14:14:50 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-10-01 14:14:50 -0700
commit05462038ab2190953277f04cd2e0edf9eff445ff (patch)
tree402cb915671aaf1b369ed427a3aecb7b7e2f2f15 /usb
parent7323dc4ff747322161a2992f676a945506726c49 (diff)
downloadpatches-05462038ab2190953277f04cd2e0edf9eff445ff.tar.gz
lots of usb and other patches
Diffstat (limited to 'usb')
-rw-r--r--usb/usb-fsl_qe_udc-clear-data-toggle-on-clear-halt-request.patch31
-rw-r--r--usb/usb-fsl_qe_udc-fix-response-to-get-status-request.patch278
-rw-r--r--usb/usb-ftdi-elan-always-pass-usb_bulk_msg-a-timeout-in-milliseconds.patch71
-rw-r--r--usb/usb-gadget-cdc-ethernet-notification-bugfix.patch1
-rw-r--r--usb/usb-improve-ehci_watchdog-s-side-effect-in-cpu-power-management.patch64
-rw-r--r--usb/usb-isp1760-use-an-is_err-test-rather-than-a-null-test.patch59
-rw-r--r--usb/usb-remove-info-macro-from-usb.h.patch4
-rw-r--r--usb/usb-ti_usb_3410_5052-removed-duplicated-include.patch28
-rw-r--r--usb/usb-uhci-improve-scheduling-of-interrupt-urbs.patch53
9 files changed, 587 insertions, 2 deletions
diff --git a/usb/usb-fsl_qe_udc-clear-data-toggle-on-clear-halt-request.patch b/usb/usb-fsl_qe_udc-clear-data-toggle-on-clear-halt-request.patch
new file mode 100644
index 00000000000000..b7742438e7d5b2
--- /dev/null
+++ b/usb/usb-fsl_qe_udc-clear-data-toggle-on-clear-halt-request.patch
@@ -0,0 +1,31 @@
+From leoli@freescale.com Wed Oct 1 14:00:33 2008
+From: Li Yang <leoli@freescale.com>
+Date: Wed, 24 Sep 2008 15:50:27 +0800
+Subject: usb/fsl_qe_udc: clear data toggle on clear halt request
+To: gregkh@suse.de
+Cc: david-b@pacbell.net, linux-usb@vger.kernel.org, Li Yang <leoli@freescale.com>
+Message-ID: <1222242627-24730-2-git-send-email-leoli@freescale.com>
+
+
+Fix to comply with USB spec.
+
+Signed-off-by: Li Yang <leoli@freescale.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/gadget/fsl_qe_udc.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/usb/gadget/fsl_qe_udc.c
++++ b/drivers/usb/gadget/fsl_qe_udc.c
+@@ -1815,6 +1815,10 @@ static int qe_ep_set_halt(struct usb_ep
+ udc->ep0_state = WAIT_FOR_SETUP;
+ udc->ep0_dir = 0;
+ }
++
++ /* set data toggle to DATA0 on clear halt */
++ if (value == 0)
++ ep->data01 = 0;
+ out:
+ dev_vdbg(udc->dev, "%s %s halt stat %d\n", ep->ep.name,
+ value ? "set" : "clear", status);
diff --git a/usb/usb-fsl_qe_udc-fix-response-to-get-status-request.patch b/usb/usb-fsl_qe_udc-fix-response-to-get-status-request.patch
new file mode 100644
index 00000000000000..8909f0fb578d64
--- /dev/null
+++ b/usb/usb-fsl_qe_udc-fix-response-to-get-status-request.patch
@@ -0,0 +1,278 @@
+From leoli@freescale.com Wed Oct 1 14:00:20 2008
+From: Li Yang <leoli@freescale.com>
+Date: Wed, 24 Sep 2008 15:50:26 +0800
+Subject: usb/fsl_qe_udc: fix response to get status request
+To: gregkh@suse.de
+Cc: david-b@pacbell.net, linux-usb@vger.kernel.org, Li Yang <leoli@freescale.com>
+Message-ID: <1222242627-24730-1-git-send-email-leoli@freescale.com>
+
+
+The original code didn't respond correctly to get status request on
+device and endpoint. Although normal operations can work without the
+fix. It is not compliant with USB spec chapter9 and fails USBCV ch9
+tests. The patch fix this and a few style/typo problems.
+
+Signed-off-by: Li Yang <leoli@freescale.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/gadget/fsl_qe_udc.c | 101 ++++++++++++++++++++++++++--------------
+ drivers/usb/gadget/fsl_qe_udc.h | 1
+ 2 files changed, 68 insertions(+), 34 deletions(-)
+
+--- a/drivers/usb/gadget/fsl_qe_udc.c
++++ b/drivers/usb/gadget/fsl_qe_udc.c
+@@ -1138,7 +1138,7 @@ static int qe_ep_tx(struct qe_ep *ep, st
+ }
+ }
+
+-/* when an bd was transmitted, the function can *
++/* when a bd was transmitted, the function can
+ * handle the tx_req, not include ep0 */
+ static int txcomplete(struct qe_ep *ep, unsigned char restart)
+ {
+@@ -1174,7 +1174,7 @@ static int txcomplete(struct qe_ep *ep,
+ return 0;
+ }
+
+-/* give a frame and a tx_req,send some data */
++/* give a frame and a tx_req, send some data */
+ static int qe_usb_senddata(struct qe_ep *ep, struct qe_frame *frame)
+ {
+ unsigned int size;
+@@ -1797,11 +1797,6 @@ static int qe_ep_set_halt(struct usb_ep
+ goto out;
+ }
+
+- if (ep->epnum != 0) {
+- status = 0;
+- goto out;
+- }
+-
+ udc = ep->udc;
+ /* Attempt to halt IN ep will fail if any transfer requests
+ * are still queue */
+@@ -1821,7 +1816,7 @@ static int qe_ep_set_halt(struct usb_ep
+ udc->ep0_dir = 0;
+ }
+ out:
+- dev_vdbg(udc->dev, " %s %s halt stat %d\n", ep->ep.name,
++ dev_vdbg(udc->dev, "%s %s halt stat %d\n", ep->ep.name,
+ value ? "set" : "clear", status);
+
+ return status;
+@@ -1953,22 +1948,51 @@ static void ownercomplete(struct usb_ep
+ kfree(req);
+ }
+
+-static void ch9getstatus(struct qe_udc *udc, u16 value, u16 index,
+- u16 length)
++static void ch9getstatus(struct qe_udc *udc, u8 request_type, u16 value,
++ u16 index, u16 length)
+ {
+- u16 usb_status = 0; /* fix me to give correct status */
+-
++ u16 usb_status = 0;
+ struct qe_req *req;
+ struct qe_ep *ep;
+ int status = 0;
+
+ ep = &udc->eps[0];
++ if ((request_type & USB_RECIP_MASK) == USB_RECIP_DEVICE) {
++ /* Get device status */
++ usb_status = 1 << USB_DEVICE_SELF_POWERED;
++ } else if ((request_type & USB_RECIP_MASK) == USB_RECIP_INTERFACE) {
++ /* Get interface status */
++ /* We don't have interface information in udc driver */
++ usb_status = 0;
++ } else if ((request_type & USB_RECIP_MASK) == USB_RECIP_ENDPOINT) {
++ /* Get endpoint status */
++ int pipe = index & USB_ENDPOINT_NUMBER_MASK;
++ struct qe_ep *target_ep = &udc->eps[pipe];
++ u16 usep;
++
++ /* stall if endpoint doesn't exist */
++ if (!target_ep->desc)
++ goto stall;
++
++ usep = in_be16(&udc->usb_regs->usb_usep[pipe]);
++ if (index & USB_DIR_IN) {
++ if (target_ep->dir != USB_DIR_IN)
++ goto stall;
++ if ((usep & USB_THS_MASK) == USB_THS_STALL)
++ usb_status = 1 << USB_ENDPOINT_HALT;
++ } else {
++ if (target_ep->dir != USB_DIR_OUT)
++ goto stall;
++ if ((usep & USB_RHS_MASK) == USB_RHS_STALL)
++ usb_status = 1 << USB_ENDPOINT_HALT;
++ }
++ }
+
+ req = container_of(qe_alloc_request(&ep->ep, GFP_KERNEL),
+ struct qe_req, req);
+ req->req.length = 2;
+- req->req.buf = udc->nullbuf;
+- memcpy(req->req.buf, (u8 *)&usb_status, 2);
++ req->req.buf = udc->statusbuf;
++ *(u16 *)req->req.buf = cpu_to_le16(usb_status);
+ req->req.status = -EINPROGRESS;
+ req->req.actual = 0;
+ req->req.complete = ownercomplete;
+@@ -1978,10 +2002,11 @@ static void ch9getstatus(struct qe_udc *
+ /* data phase */
+ status = qe_ep_queue(&ep->ep, &req->req, GFP_ATOMIC);
+
+- if (status) {
+- dev_err(udc->dev, "Can't respond to getstatus request \n");
+- qe_ep0_stall(udc);
+- }
++ if (status == 0)
++ return;
++stall:
++ dev_err(udc->dev, "Can't respond to getstatus request \n");
++ qe_ep0_stall(udc);
+ }
+
+ /* only handle the setup request, suppose the device in normal status */
+@@ -2007,7 +2032,8 @@ static void setup_received_handle(struct
+ if ((setup->bRequestType & (USB_DIR_IN | USB_TYPE_MASK))
+ != (USB_DIR_IN | USB_TYPE_STANDARD))
+ break;
+- ch9getstatus(udc, wValue, wIndex, wLength);
++ ch9getstatus(udc, setup->bRequestType, wValue, wIndex,
++ wLength);
+ return;
+
+ case USB_REQ_SET_ADDRESS:
+@@ -2021,7 +2047,7 @@ static void setup_received_handle(struct
+ case USB_REQ_CLEAR_FEATURE:
+ case USB_REQ_SET_FEATURE:
+ /* Requests with no data phase, status phase from udc */
+- if ((setup->bRequestType & USB_TYPE_MASK)
++ if ((setup->bRequestType & USB_TYPE_MASK)
+ != USB_TYPE_STANDARD)
+ break;
+
+@@ -2055,7 +2081,7 @@ static void setup_received_handle(struct
+ if (setup->bRequestType & USB_DIR_IN) {
+ udc->ep0_state = DATA_STATE_XMIT;
+ udc->ep0_dir = USB_DIR_IN;
+- } else{
++ } else {
+ udc->ep0_state = DATA_STATE_RECV;
+ udc->ep0_dir = USB_DIR_OUT;
+ }
+@@ -2160,13 +2186,11 @@ static int tx_irq(struct qe_udc *udc)
+ bd = ep->c_txbd;
+ if (!(in_be32((u32 __iomem *)bd) & T_R)
+ && (in_be32(&bd->buf))) {
+- /* Disable the TX Interrupt */
+- /*confirm the transmitted bd*/
++ /* confirm the transmitted bd */
+ if (ep->epnum == 0)
+ res = qe_ep0_txconf(ep);
+ else
+ res = qe_ep_txconf(ep);
+- /* Enable the TX Interrupt */
+ }
+ }
+ }
+@@ -2205,7 +2229,6 @@ static irqreturn_t qe_udc_irq(int irq, v
+ irqreturn_t status = IRQ_NONE;
+ unsigned long flags;
+
+-
+ spin_lock_irqsave(&udc->lock, flags);
+
+ irq_src = in_be16(&udc->usb_regs->usb_usber) &
+@@ -2520,10 +2543,9 @@ static int __devinit qe_udc_probe(struct
+ udc_controller->gadget.dev.release = qe_udc_release;
+ udc_controller->gadget.dev.parent = &ofdev->dev;
+
+-
+- /* EP:intialization qe_ep struct */
++ /* initialize qe_ep struct */
+ for (i = 0; i < USB_MAX_ENDPOINTS ; i++) {
+- /*because the ep type isn't decide here so
++ /* because the ep type isn't decide here so
+ * qe_ep_init() should be called in ep_enable() */
+
+ /* setup the qe_ep struct and link ep.ep.list
+@@ -2536,7 +2558,7 @@ static int __devinit qe_udc_probe(struct
+ if (ret)
+ goto err2;
+
+- /* create a buf for ZLP send */
++ /* create a buf for ZLP send, need to remain zeroed */
+ udc_controller->nullbuf = kzalloc(256, GFP_KERNEL);
+ if (udc_controller->nullbuf == NULL) {
+ dev_dbg(udc_controller->dev, "cannot alloc nullbuf\n");
+@@ -2544,6 +2566,13 @@ static int __devinit qe_udc_probe(struct
+ goto err3;
+ }
+
++ /* buffer for data of get_status request */
++ udc_controller->statusbuf = kzalloc(2, GFP_KERNEL);
++ if (udc_controller->statusbuf == NULL) {
++ ret = -ENOMEM;
++ goto err4;
++ }
++
+ udc_controller->nullp = virt_to_phys((void *)udc_controller->nullbuf);
+ if (udc_controller->nullp == DMA_ADDR_INVALID) {
+ udc_controller->nullp = dma_map_single(
+@@ -2568,20 +2597,21 @@ static int __devinit qe_udc_probe(struct
+ if (ret) {
+ dev_err(udc_controller->dev, "cannot request irq %d err %d \n",
+ udc_controller->usb_irq, ret);
+- goto err4;
++ goto err5;
+ }
+
+ ret = device_add(&udc_controller->gadget.dev);
+ if (ret)
+- goto err5;
++ goto err6;
+
+ dev_info(udc_controller->dev,
+- "QE/CPM USB controller initialized as device\n");
++ "%s USB controller initialized as device\n",
++ (udc_controller->soc_type == PORT_QE) ? "QE" : "CPM");
+ return 0;
+
+-err5:
++err6:
+ free_irq(udc_controller->usb_irq, udc_controller);
+-err4:
++err5:
+ if (udc_controller->nullmap) {
+ dma_unmap_single(udc_controller->gadget.dev.parent,
+ udc_controller->nullp, 256,
+@@ -2592,6 +2622,8 @@ err4:
+ udc_controller->nullp, 256,
+ DMA_TO_DEVICE);
+ }
++ kfree(udc_controller->statusbuf);
++err4:
+ kfree(udc_controller->nullbuf);
+ err3:
+ ep = &udc_controller->eps[0];
+@@ -2642,6 +2674,7 @@ static int __devexit qe_udc_remove(struc
+ udc_controller->nullp, 256,
+ DMA_TO_DEVICE);
+ }
++ kfree(udc_controller->statusbuf);
+ kfree(udc_controller->nullbuf);
+
+ ep = &udc_controller->eps[0];
+--- a/drivers/usb/gadget/fsl_qe_udc.h
++++ b/drivers/usb/gadget/fsl_qe_udc.h
+@@ -349,6 +349,7 @@ struct qe_udc {
+ u32 c_end;
+
+ u8 *nullbuf;
++ u8 *statusbuf;
+ dma_addr_t nullp;
+ u8 nullmap;
+ u8 device_address; /* Device USB address */
diff --git a/usb/usb-ftdi-elan-always-pass-usb_bulk_msg-a-timeout-in-milliseconds.patch b/usb/usb-ftdi-elan-always-pass-usb_bulk_msg-a-timeout-in-milliseconds.patch
new file mode 100644
index 00000000000000..0ff7551b20b76a
--- /dev/null
+++ b/usb/usb-ftdi-elan-always-pass-usb_bulk_msg-a-timeout-in-milliseconds.patch
@@ -0,0 +1,71 @@
+From sarah.a.sharp@linux.intel.com Wed Oct 1 14:09:26 2008
+From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
+Date: Mon, 29 Sep 2008 10:58:35 -0700
+Subject: USB: ftdi-elan: Always pass usb_bulk_msg() a timeout in milliseconds.
+To: Tony Olech <tony.olech@elandigitalsystems.com>
+Cc: linux-usb@vger.kernel.org
+Message-ID: <20080929175835.GA17202@localdomain>
+Content-Disposition: inline
+
+
+The kernel doc for usb_bulk_msg() says the timeout for a bulk message should be
+specified in milliseconds. The ftdi-elan driver converts milliseconds to
+jiffies before passing the timeout to usb_bulk_msg(). This is mostly harmless,
+since it will just lead to very long timeouts, but was obviously not the intent
+of the original author.
+
+Signed-off-by: Sarah Sharp <sarah.a.sharp@intel.com>
+Acked-by: Tony Olech <tony.olech@elandigitalsystems.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/misc/ftdi-elan.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/drivers/usb/misc/ftdi-elan.c
++++ b/drivers/usb/misc/ftdi-elan.c
+@@ -698,7 +698,7 @@ static ssize_t ftdi_elan_read(struct fil
+ int retval = usb_bulk_msg(ftdi->udev,
+ usb_rcvbulkpipe(ftdi->udev, ftdi->bulk_in_endpointAddr),
+ ftdi->bulk_in_buffer, ftdi->bulk_in_size,
+- &packet_bytes, msecs_to_jiffies(50));
++ &packet_bytes, 50);
+ if (packet_bytes > 2) {
+ ftdi->bulk_in_left = packet_bytes - 2;
+ ftdi->bulk_in_last = 1;
+@@ -960,7 +960,7 @@ static int ftdi_elan_respond_engine(stru
+ int retval = usb_bulk_msg(ftdi->udev,
+ usb_rcvbulkpipe(ftdi->udev, ftdi->bulk_in_endpointAddr),
+ ftdi->bulk_in_buffer, ftdi->bulk_in_size,
+- &packet_bytes, msecs_to_jiffies(500));
++ &packet_bytes, 500);
+ char diag[30 *3 + 4];
+ char *d = diag;
+ int m = packet_bytes;
+@@ -1880,7 +1880,7 @@ static int ftdi_elan_flush_input_fifo(st
+ int retval = usb_bulk_msg(ftdi->udev,
+ usb_rcvbulkpipe(ftdi->udev, ftdi->bulk_in_endpointAddr),
+ ftdi->bulk_in_buffer, ftdi->bulk_in_size,
+- &packet_bytes, msecs_to_jiffies(100));
++ &packet_bytes, 100);
+ if (packet_bytes > 2) {
+ char diag[30 *3 + 4];
+ char *d = diag;
+@@ -2067,7 +2067,7 @@ static int ftdi_elan_synchronize(struct
+ usb_rcvbulkpipe(ftdi->udev,
+ ftdi->bulk_in_endpointAddr),
+ ftdi->bulk_in_buffer, ftdi->bulk_in_size,
+- &packet_bytes, msecs_to_jiffies(500));
++ &packet_bytes, 500);
+ if (packet_bytes > 2) {
+ char diag[30 *3 + 4];
+ char *d = diag;
+@@ -2176,7 +2176,7 @@ static int ftdi_elan_stuck_waiting(struc
+ int retval = usb_bulk_msg(ftdi->udev,
+ usb_rcvbulkpipe(ftdi->udev, ftdi->bulk_in_endpointAddr),
+ ftdi->bulk_in_buffer, ftdi->bulk_in_size,
+- &packet_bytes, msecs_to_jiffies(1000));
++ &packet_bytes, 1000);
+ if (packet_bytes > 2) {
+ char diag[30 *3 + 4];
+ char *d = diag;
diff --git a/usb/usb-gadget-cdc-ethernet-notification-bugfix.patch b/usb/usb-gadget-cdc-ethernet-notification-bugfix.patch
index 60b98ec3a2b27d..11d902a3279bea 100644
--- a/usb/usb-gadget-cdc-ethernet-notification-bugfix.patch
+++ b/usb/usb-gadget-cdc-ethernet-notification-bugfix.patch
@@ -20,6 +20,7 @@ sends will have the wrong link state (down, not up). Makes it
hard to bridge these links (on the host side), among other things.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
+Cc: stable <stable@kernel.org> [2.6.27]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
diff --git a/usb/usb-improve-ehci_watchdog-s-side-effect-in-cpu-power-management.patch b/usb/usb-improve-ehci_watchdog-s-side-effect-in-cpu-power-management.patch
new file mode 100644
index 00000000000000..b51a31c50753b1
--- /dev/null
+++ b/usb/usb-improve-ehci_watchdog-s-side-effect-in-cpu-power-management.patch
@@ -0,0 +1,64 @@
+From yi.y.yang@intel.com Wed Oct 1 14:06:31 2008
+From: Yi Yang <yi.y.yang@intel.com>
+Date: Thu, 25 Sep 2008 17:25:44 +0800
+Subject: USB: improve ehci_watchdog's side effect in CPU power management
+To: linux-kernel@vger.kernel.org
+Cc: dbrownell@users.sourceforge.net, gregkh@suse.de, akpm@linux-foundation.org
+Message-ID: <1222334744.9267.41.camel@yangyi-dev>
+
+
+ehci_watchdog will wake up CPU very frequently so that CPU
+stays at C3 very short, average residence time is about 50
+ms on Aspire One, but we expect it should be about 1 second
+or more, so this kind of periodic timer is very bad for power
+saving.
+
+We can't remove this timer because of some bad USB controller
+chipset, but at least we should reduce its side effect to as
+possible as low.
+
+This patch can make CPU stay at C3 longer, average residence time
+is about twice as long as original.
+
+Please consider to apply it, thanks
+
+Signed-off-by: Yi Yang <yi.y.yang@intel.com>
+Cc: David Brownell <dbrownell@users.sourceforge.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/host/ehci.h | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+--- a/drivers/usb/host/ehci.h
++++ b/drivers/usb/host/ehci.h
+@@ -181,14 +181,16 @@ timer_action (struct ehci_hcd *ehci, enu
+ * the async ring; just the I/O watchdog. Note that if a
+ * SHRINK were pending, OFF would never be requested.
+ */
+- if (timer_pending(&ehci->watchdog)
+- && ((BIT(TIMER_ASYNC_SHRINK) | BIT(TIMER_ASYNC_OFF))
+- & ehci->actions))
+- return;
++ enum ehci_timer_action oldactions = ehci->actions;
+
+ if (!test_and_set_bit (action, &ehci->actions)) {
+ unsigned long t;
+
++ if (timer_pending(&ehci->watchdog)
++ && ((BIT(TIMER_ASYNC_SHRINK) | BIT(TIMER_ASYNC_OFF))
++ & oldactions))
++ return;
++
+ switch (action) {
+ case TIMER_IO_WATCHDOG:
+ t = EHCI_IO_JIFFIES;
+@@ -204,7 +206,7 @@ timer_action (struct ehci_hcd *ehci, enu
+ t = DIV_ROUND_UP(EHCI_SHRINK_FRAMES * HZ, 1000) + 1;
+ break;
+ }
+- mod_timer(&ehci->watchdog, t + jiffies);
++ mod_timer(&ehci->watchdog, round_jiffies(t + jiffies));
+ }
+ }
+
diff --git a/usb/usb-isp1760-use-an-is_err-test-rather-than-a-null-test.patch b/usb/usb-isp1760-use-an-is_err-test-rather-than-a-null-test.patch
new file mode 100644
index 00000000000000..ed781fe7ffec92
--- /dev/null
+++ b/usb/usb-isp1760-use-an-is_err-test-rather-than-a-null-test.patch
@@ -0,0 +1,59 @@
+From brunel@diku.dk Wed Oct 1 14:07:03 2008
+From: Julien Brunel <brunel@diku.dk>
+Date: Wed, 24 Sep 2008 18:00:36 +0200
+Subject: USB: isp1760: Use an IS_ERR test rather than a NULL test
+To: gregkh@suse.de, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
+Message-ID: <200809241800.36320.brunel@diku.dk>
+Content-Disposition: inline
+
+
+In case of error, the function isp1760_register returns an ERR
+pointer, but never returns a NULL pointer. So after a call to this
+function, a NULL test should be replaced by an IS_ERR test. Moreover,
+we have noticed that:
+(1) the result of isp1760_register is assigned through the function
+pci_set_drvdata without an error test,
+(2) if the call to isp1760_register fails, the current function
+(isp1761_pci_probe) returns 0, and if it succeeds, it returns -ENOMEM,
+which seems odd.
+
+Thus, we suggest to move the test before the call to pci_set_drvdata
+to correct (1), and to turn it into a non IS_ERR test to correct (2).
+
+The semantic match that finds this problem is as follows:
+(http://www.emn.fr/x-info/coccinelle/)
+
+// <smpl>
+@bad_null_test@
+expression x,E;
+statement S1, S2;
+@@
+x = isp1760_register(...)
+... when != x = E
+* if (x == NULL)
+S1 else S2
+// </smpl>
+
+Signed-off-by: Julien Brunel <brunel@diku.dk>
+Signed-off-by: Julia Lawall <julia@diku.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/host/isp1760-if.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/drivers/usb/host/isp1760-if.c
++++ b/drivers/usb/host/isp1760-if.c
+@@ -232,9 +232,10 @@ static int __devinit isp1761_pci_probe(s
+ hcd = isp1760_register(pci_mem_phy0, length, dev->irq,
+ IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev_name(&dev->dev),
+ devflags);
+- pci_set_drvdata(dev, hcd);
+- if (!hcd)
++ if (!IS_ERR(hcd)) {
++ pci_set_drvdata(dev, hcd);
+ return 0;
++ }
+ clean:
+ status = -ENODEV;
+ iounmap(iobase);
diff --git a/usb/usb-remove-info-macro-from-usb.h.patch b/usb/usb-remove-info-macro-from-usb.h.patch
index 46067e9c77c27b..cf9ad6524ac4ae 100644
--- a/usb/usb-remove-info-macro-from-usb.h.patch
+++ b/usb/usb-remove-info-macro-from-usb.h.patch
@@ -2711,7 +2711,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
usb_serial_deregister(&zyxel_omninet_device);
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
-@@ -427,7 +427,8 @@ static int __init option_init(void)
+@@ -433,7 +433,8 @@ static int __init option_init(void)
if (retval)
goto failed_driver_register;
@@ -2790,7 +2790,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
usb_serial_deregister(&spcp8x5_device);
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
-@@ -383,7 +383,8 @@ static int __init ti_init(void)
+@@ -382,7 +382,8 @@ static int __init ti_init(void)
if (ret)
goto failed_usb;
diff --git a/usb/usb-ti_usb_3410_5052-removed-duplicated-include.patch b/usb/usb-ti_usb_3410_5052-removed-duplicated-include.patch
new file mode 100644
index 00000000000000..b1a0ffa38e7a91
--- /dev/null
+++ b/usb/usb-ti_usb_3410_5052-removed-duplicated-include.patch
@@ -0,0 +1,28 @@
+From hwy@cn.fujitsu.com Wed Oct 1 13:58:58 2008
+From: "Huang Weiyi" <hwy@cn.fujitsu.com>
+Date: Thu, 25 Sep 2008 13:11:28 +0800
+Subject: USB: ti_usb_3410_5052: removed duplicated include
+To: <gregkh@suse.de>
+Message-ID: <000701c91ecd$2a8184f0$248da70a@hwysdesktop>
+
+
+Removed duplicated #include <linux/firmware.h> in
+drivers/usb/serial/ti_usb_3410_5052.c.
+
+Signed-off-by: Huang Weiyi <hwy@cn.fujitsu.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/ti_usb_3410_5052.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/drivers/usb/serial/ti_usb_3410_5052.c
++++ b/drivers/usb/serial/ti_usb_3410_5052.c
+@@ -85,7 +85,6 @@
+ #include <linux/uaccess.h>
+ #include <linux/usb.h>
+ #include <linux/usb/serial.h>
+-#include <linux/firmware.h>
+
+ #include "ti_usb_3410_5052.h"
+
diff --git a/usb/usb-uhci-improve-scheduling-of-interrupt-urbs.patch b/usb/usb-uhci-improve-scheduling-of-interrupt-urbs.patch
new file mode 100644
index 00000000000000..5a11d7d474f55a
--- /dev/null
+++ b/usb/usb-uhci-improve-scheduling-of-interrupt-urbs.patch
@@ -0,0 +1,53 @@
+From stern@rowland.harvard.edu Wed Oct 1 14:06:03 2008
+From: Alan Stern <stern@rowland.harvard.edu>
+Date: Thu, 25 Sep 2008 16:59:57 -0400 (EDT)
+Subject: USB: UHCI: improve scheduling of interrupt URBs
+To: Greg KH <greg@kroah.com>
+Message-ID: <Pine.LNX.4.44L0.0809251658540.2181-100000@iolanthe.rowland.org>
+
+
+This patch (as1140) adds a little intelligence to the interrupt-URB
+scheduler in uhci-hcd. Right now the scheduler is stupid; every URB
+having the same period is assigned to the same slot. Thus a large
+group of period-N URBs can fill their slot and cause -ENOSPC errors
+even when all the lower-period slots are empty.
+
+With the patch, if an URB doesn't fit in its assigned slot then the
+scheduler will try using lower-period slots. This will provide
+greater flexibility. As an example, the driver will be able to handle
+more than just three or four mice, which the current driver cannot.
+
+Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/host/uhci-q.c | 17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
+
+--- a/drivers/usb/host/uhci-q.c
++++ b/drivers/usb/host/uhci-q.c
+@@ -1065,13 +1065,18 @@ static int uhci_submit_interrupt(struct
+ }
+ if (exponent < 0)
+ return -EINVAL;
+- qh->period = 1 << exponent;
+- qh->skel = SKEL_INDEX(exponent);
+
+- /* For now, interrupt phase is fixed by the layout
+- * of the QH lists. */
+- qh->phase = (qh->period / 2) & (MAX_PHASE - 1);
+- ret = uhci_check_bandwidth(uhci, qh);
++ /* If the slot is full, try a lower period */
++ do {
++ qh->period = 1 << exponent;
++ qh->skel = SKEL_INDEX(exponent);
++
++ /* For now, interrupt phase is fixed by the layout
++ * of the QH lists.
++ */
++ qh->phase = (qh->period / 2) & (MAX_PHASE - 1);
++ ret = uhci_check_bandwidth(uhci, qh);
++ } while (ret != 0 && --exponent >= 0);
+ if (ret)
+ return ret;
+ } else if (qh->period > urb->interval)