]> Pileus Git - ~andy/linux/commitdiff
usb: Remove ehci_reset call from ehci_run
authorGeoff Levand <geoff@infradead.org>
Wed, 23 Nov 2011 02:04:45 +0000 (18:04 -0800)
committerGeoff Levand <geoff@infradead.org>
Thu, 8 Dec 2011 17:38:53 +0000 (09:38 -0800)
Remove the ehci_reset() call done in the ehci_run() routine of the
USB EHCI host controller driver and add an ehci_reset() call to the
probe processing of all EHCI platform drivers that do not already call
ehci_reset().

The call to ehci_reset() from ehci_run() was problematic for several
platform drivers, and unnecessary for others.  This change moves the
decision to call ehci_reset() at driver startup to the platform
driver code.

Signed-off-by: Geoff Levand <geoff@infradead.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
drivers/usb/host/ehci-au1xxx.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ehci-octeon.c
drivers/usb/host/ehci-omap.c
drivers/usb/host/ehci-s5p.c
drivers/usb/host/ehci-vt8500.c
drivers/usb/host/ehci-w90x900.c

index 18bafa99fe57e1fa156a7cf326e589f1938b096b..bf7441afed16e15155e35a1b24a59de77853e3be 100644 (file)
@@ -23,6 +23,7 @@ static int au1xxx_ehci_setup(struct usb_hcd *hcd)
        int ret = ehci_init(hcd);
 
        ehci->need_io_watchdog = 0;
+       ehci_reset(ehci);
        return ret;
 }
 
index 3ff9f82f7263fe8a95b7cef78d39d7f5f15782d1..46dccbf85c1a4716c60468aad0857cf2dd61b49f 100644 (file)
@@ -677,22 +677,13 @@ static int ehci_init(struct usb_hcd *hcd)
 static int ehci_run (struct usb_hcd *hcd)
 {
        struct ehci_hcd         *ehci = hcd_to_ehci (hcd);
-       int                     retval;
        u32                     temp;
        u32                     hcc_params;
 
        hcd->uses_new_polling = 1;
 
        /* EHCI spec section 4.1 */
-       /*
-        * TDI driver does the ehci_reset in their reset callback.
-        * Don't reset here, because configuration settings will
-        * vanish.
-        */
-       if (!ehci_is_TDI(ehci) && (retval = ehci_reset(ehci)) != 0) {
-               ehci_mem_cleanup(ehci);
-               return retval;
-       }
+
        ehci_writel(ehci, ehci->periodic_dma, &ehci->regs->frame_list);
        ehci_writel(ehci, (u32)ehci->async->qh_dma, &ehci->regs->async_next);
 
index ba1f5136113476c0ad05761818278c2d17a07ec7..c0104882c72d9d63c1cb525e01d72ec3578c5bd9 100644 (file)
@@ -155,6 +155,8 @@ static int ehci_octeon_drv_probe(struct platform_device *pdev)
        /* cache this readonly data; minimize chip reads */
        ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
 
+       ehci_reset(ehci);
+
        ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
        if (ret) {
                dev_dbg(&pdev->dev, "failed to add hcd with err %d\n", ret);
index e39b0297bad1806a2e2cb49e2a5047e026847dc6..e33baf9052cbda86a8563ecec14885ee5928adcc 100644 (file)
@@ -228,6 +228,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
        /* cache this readonly data; minimize chip reads */
        omap_ehci->hcs_params = readl(&omap_ehci->caps->hcs_params);
 
+       ehci_reset(omap_ehci);
+
        ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
        if (ret) {
                dev_err(dev, "failed to add hcd with err %d\n", ret);
index 024b65c4990dc117417b594387da3ac14f73d730..397f827387b70c2dac9debaa3666007200d22ebb 100644 (file)
@@ -136,6 +136,8 @@ static int __devinit s5p_ehci_probe(struct platform_device *pdev)
        /* cache this readonly data; minimize chip reads */
        ehci->hcs_params = readl(&ehci->caps->hcs_params);
 
+       ehci_reset(ehci);
+
        err = usb_add_hcd(hcd, irq, IRQF_SHARED);
        if (err) {
                dev_err(&pdev->dev, "Failed to add USB HCD\n");
index 54d1ab8aec495d1067ac3578ebc94b2b91f0da0e..c1eda73916cdd7e189ffd380882317631d5b1367 100644 (file)
@@ -132,6 +132,8 @@ static int vt8500_ehci_drv_probe(struct platform_device *pdev)
 
        ehci_port_power(ehci, 1);
 
+       ehci_reset(ehci);
+
        ret = usb_add_hcd(hcd, pdev->resource[1].start,
                          IRQF_SHARED);
        if (ret == 0) {
index d661cf7de140731d17cd46acf38ba689863656c8..3d2e26cbb34cd564ace646f55f8f8e1fccee7cb5 100644 (file)
@@ -78,6 +78,8 @@ static int __devinit usb_w90x900_probe(const struct hc_driver *driver,
        if (irq < 0)
                goto err4;
 
+       ehci_reset(ehci);
+
        retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
        if (retval != 0)
                goto err4;