]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/host/ehci-pci.c
USB: fix SB600 USB subsystem hang bug
[linux-2.6-omap-h63xx.git] / drivers / usb / host / ehci-pci.c
index 5bb7f6bb13f340a80f5fbd746e515f792fabe370..36864f9584445a41cf8bea70155c50b76f888cc2 100644 (file)
@@ -66,6 +66,8 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
 {
        struct ehci_hcd         *ehci = hcd_to_ehci(hcd);
        struct pci_dev          *pdev = to_pci_dev(hcd->self.controller);
+       struct pci_dev          *p_smbus;
+       u8                      rev;
        u32                     temp;
        int                     retval;
 
@@ -129,7 +131,6 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
        switch (pdev->vendor) {
        case PCI_VENDOR_ID_TDI:
                if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
-                       ehci->is_tdi_rh_tt = 1;
                        hcd->has_tt = 1;
                        tdi_reset(ehci);
                }
@@ -167,6 +168,28 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
                        pci_write_config_byte(pdev, 0x4b, tmp | 0x20);
                }
                break;
+       case PCI_VENDOR_ID_ATI:
+               /* SB600 and old version of SB700 have a bug in EHCI controller,
+                * which causes usb devices lose response in some cases.
+                */
+               if ((pdev->device == 0x4386) || (pdev->device == 0x4396)) {
+                       p_smbus = pci_get_device(PCI_VENDOR_ID_ATI,
+                                                PCI_DEVICE_ID_ATI_SBX00_SMBUS,
+                                                NULL);
+                       if (!p_smbus)
+                               break;
+                       rev = p_smbus->revision;
+                       if ((pdev->device == 0x4386) || (rev == 0x3a)
+                           || (rev == 0x3b)) {
+                               u8 tmp;
+                               ehci_info(ehci, "applying AMD SB600/SB700 USB "
+                                       "freeze workaround\n");
+                               pci_read_config_byte(pdev, 0x53, &tmp);
+                               pci_write_config_byte(pdev, 0x53, tmp | (1<<3));
+                       }
+                       pci_dev_put(p_smbus);
+               }
+               break;
        }
 
        ehci_reset(ehci);
@@ -379,7 +402,8 @@ static const struct hc_driver ehci_pci_hc_driver = {
        .hub_control =          ehci_hub_control,
        .bus_suspend =          ehci_bus_suspend,
        .bus_resume =           ehci_bus_resume,
-       .relinquish_port =      ehci_relinquish_port,
+       .relinquish_port =      ehci_relinquish_port,
+       .port_handed_over =     ehci_port_handed_over,
 };
 
 /*-------------------------------------------------------------------------*/