]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
USB: EHCI: remove PCI assumption
authorAlan Stern <stern@rowland.harvard.edu>
Wed, 14 Jul 2010 15:03:23 +0000 (11:03 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 13 Aug 2010 20:27:25 +0000 (13:27 -0700)
commit ae68a83bdc1971cb02fefc7a686ba6d077065e71 upstream.

This patch (as1405) fixes a small bug in ehci-hcd's isochronous
scheduler.  Not all EHCI controllers are PCI, and the code shouldn't
assume that they are.  Instead, introduce a special flag for
controllers which need to delay iso scheduling for full-speed devices
beyond the scheduling threshold.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
CC: David Brownell <david-b@pacbell.net>
Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/ehci-pci.c
drivers/usb/host/ehci-sched.c
drivers/usb/host/ehci.h

index c5f662dc4516f5c8e7695d4111326177d3daa65d..e4ad27575cb4c10a6a6b8a301e5793bbcf3a6f56 100644 (file)
@@ -111,6 +111,7 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
        switch (pdev->vendor) {
        case PCI_VENDOR_ID_INTEL:
                ehci->need_io_watchdog = 0;
+               ehci->fs_i_thresh = 1;
                if (pdev->device == 0x27cc) {
                        ehci->broken_periodic = 1;
                        ehci_info(ehci, "using broken periodic workaround\n");
index 805ec633a652643c6952cd4e7b2595f2c9b10815..93f58e52503bb8e69f0d3167a91c02c81c2b5857 100644 (file)
@@ -1400,7 +1400,6 @@ iso_stream_schedule (
        int                     status;
        unsigned                mod = ehci->periodic_size << 3;
        struct ehci_iso_sched   *sched = urb->hcpriv;
-       struct pci_dev          *pdev;
 
        if (sched->span > (mod - SCHEDULE_SLOP)) {
                ehci_dbg (ehci, "iso request %p too long\n", urb);
@@ -1427,15 +1426,14 @@ iso_stream_schedule (
         * slot in the schedule, implicitly assuming URB_ISO_ASAP.
         */
        if (likely (!list_empty (&stream->td_list))) {
-               pdev = to_pci_dev(ehci_to_hcd(ehci)->self.controller);
                start = stream->next_uframe;
 
                /* For high speed devices, allow scheduling within the
-                * isochronous scheduling threshold.  For full speed devices,
-                * don't. (Work around for Intel ICH9 bug.)
+                * isochronous scheduling threshold.  For full speed devices
+                * and Intel PCI-based controllers, don't (work around for
+                * Intel ICH9 bug).
                 */
-               if (!stream->highspeed &&
-                               pdev->vendor == PCI_VENDOR_ID_INTEL)
+               if (!stream->highspeed && ehci->fs_i_thresh)
                        next = now + ehci->i_thresh;
                else
                        next = now;
index ddf61c3feccf7ccde439655630fc6d4a5a22c68a..3c7cf8729835c66f31eb694805ff9a4b47f54ec6 100644 (file)
@@ -130,6 +130,7 @@ struct ehci_hcd {                   /* one per controller */
        unsigned                has_amcc_usb23:1;
        unsigned                need_io_watchdog:1;
        unsigned                broken_periodic:1;
+       unsigned                fs_i_thresh:1;  /* Intel iso scheduling */
 
        /* required for usb32 quirk */
        #define OHCI_CTRL_HCFS          (3 << 6)