]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
USB: EHCI: suppress unwanted error messages
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 20 May 2008 20:58:29 +0000 (16:58 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 29 May 2008 20:59:03 +0000 (13:59 -0700)
This patch (as1096) fixes an annoying problem: When a full-speed or
low-speed device is plugged into an EHCI controller, it fails to
enumerate at high speed and then is handed over to the companion
controller.  But usbcore logs a misleading and unwanted error message
when the high-speed enumeration fails.

The patch adds a new HCD method, port_handed_over, which asks whether
a port has been handed over to a companion controller.  If it has, the
error message is suppressed.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/hcd.h
drivers/usb/core/hub.c
drivers/usb/host/ehci-au1xxx.c
drivers/usb/host/ehci-fsl.c
drivers/usb/host/ehci-hub.c
drivers/usb/host/ehci-ixp4xx.c
drivers/usb/host/ehci-orion.c
drivers/usb/host/ehci-pci.c
drivers/usb/host/ehci-ppc-of.c
drivers/usb/host/ehci-ppc-soc.c
drivers/usb/host/ehci-ps3.c

index 1e4b81e9eb5034a06c1b85406f0dbaf3da7f77a9..a0bf5df6cb6fa3eb77636bd32f49c702822794ab 100644 (file)
@@ -213,6 +213,8 @@ struct hc_driver {
 
                /* force handover of high-speed port to full-speed companion */
        void    (*relinquish_port)(struct usb_hcd *, int);
+               /* has a port been handed over to a companion? */
+       int     (*port_handed_over)(struct usb_hcd *, int);
 };
 
 extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);
index 1a3d2879bc1d4ee0e1856c2862a37a6f58148341..8eb4da332f564c6c6daaa100a05bb27b30009d46 100644 (file)
@@ -2753,7 +2753,11 @@ loop:
                if ((status == -ENOTCONN) || (status == -ENOTSUPP))
                        break;
        }
-       dev_err(hub_dev, "unable to enumerate USB device on port %d\n", port1);
+       if (hub->hdev->parent ||
+                       !hcd->driver->port_handed_over ||
+                       !(hcd->driver->port_handed_over)(hcd, port1))
+               dev_err(hub_dev, "unable to enumerate USB device on port %d\n",
+                               port1);
  
 done:
        hub_port_disable(hub, port1, 1);
index 8b5f991e949c09371c541f18f445eb2024355b0d..08a4335401a9cf815f229b5a07bc3d4fd0a1ad76 100644 (file)
@@ -223,6 +223,7 @@ static const struct hc_driver ehci_au1xxx_hc_driver = {
        .bus_suspend = ehci_bus_suspend,
        .bus_resume = ehci_bus_resume,
        .relinquish_port = ehci_relinquish_port,
+       .port_handed_over = ehci_port_handed_over,
 };
 
 /*-------------------------------------------------------------------------*/
index 4843062e6e213380c7968b729f7fdeb6fe3e871e..7370d6187c64620260850fefc18e2054838108c3 100644 (file)
@@ -318,6 +318,7 @@ static const struct hc_driver ehci_fsl_hc_driver = {
        .bus_suspend = ehci_bus_suspend,
        .bus_resume = ehci_bus_resume,
        .relinquish_port = ehci_relinquish_port,
+       .port_handed_over = ehci_port_handed_over,
 };
 
 static int ehci_fsl_drv_probe(struct platform_device *pdev)
index 382587c4457ccae83396be87280da2bf0da190ad..d613dc9e9c055b44c2f929e62ca7aee6acfa2df6 100644 (file)
@@ -875,3 +875,13 @@ static void ehci_relinquish_port(struct usb_hcd *hcd, int portnum)
        set_owner(ehci, --portnum, PORT_OWNER);
 }
 
+static int ehci_port_handed_over(struct usb_hcd *hcd, int portnum)
+{
+       struct ehci_hcd         *ehci = hcd_to_ehci(hcd);
+       u32 __iomem             *reg;
+
+       if (ehci_is_TDI(ehci))
+               return 0;
+       reg = &ehci->regs->port_status[portnum - 1];
+       return ehci_readl(ehci, reg) & PORT_OWNER;
+}
index 539257f1592486e8e8a345b7ea9b460d6c146411..9d042f220097c874286e5e2322fc7367418a3361 100644 (file)
@@ -59,6 +59,7 @@ static const struct hc_driver ixp4xx_ehci_hc_driver = {
        .bus_resume             = ehci_bus_resume,
 #endif
        .relinquish_port        = ehci_relinquish_port,
+       .port_handed_over       = ehci_port_handed_over,
 };
 
 static int ixp4xx_ehci_probe(struct platform_device *pdev)
index 9c5266d02d6c05fdf12fd65a3119a7026229fe3d..ab625f0ba1d92da4fa26d4dcb4516ce2a4403ef7 100644 (file)
@@ -162,6 +162,7 @@ static const struct hc_driver ehci_orion_hc_driver = {
        .bus_suspend = ehci_bus_suspend,
        .bus_resume = ehci_bus_resume,
        .relinquish_port = ehci_relinquish_port,
+       .port_handed_over = ehci_port_handed_over,
 };
 
 static void __init
index 6ff453f935e7b2d628b19bef6e0846076dea121b..c46a58f9181ded00f97627f076277fd32db9ff79 100644 (file)
@@ -379,6 +379,7 @@ static const struct hc_driver ehci_pci_hc_driver = {
        .bus_suspend =          ehci_bus_suspend,
        .bus_resume =           ehci_bus_resume,
        .relinquish_port =      ehci_relinquish_port,
+       .port_handed_over =     ehci_port_handed_over,
 };
 
 /*-------------------------------------------------------------------------*/
index d94a2ef4944ca014cf48d0bda7f9c23d4b9621f6..b018deed2e8f14e278f999488a4e7bda73a81197 100644 (file)
@@ -77,6 +77,7 @@ static const struct hc_driver ehci_ppc_of_hc_driver = {
        .bus_resume             = ehci_bus_resume,
 #endif
        .relinquish_port        = ehci_relinquish_port,
+       .port_handed_over       = ehci_port_handed_over,
 };
 
 
index 6c76036783a175804673728aef8054d189ea8236..529590eb40374c4dc024088a2e13a2ced6a38cea 100644 (file)
@@ -163,6 +163,7 @@ static const struct hc_driver ehci_ppc_soc_hc_driver = {
        .bus_suspend = ehci_bus_suspend,
        .bus_resume = ehci_bus_resume,
        .relinquish_port = ehci_relinquish_port,
+       .port_handed_over = ehci_port_handed_over,
 };
 
 static int ehci_hcd_ppc_soc_drv_probe(struct platform_device *pdev)
index 69782221bcf358edd99607dbcbf843cb5c371ea6..37e6abeb794c62026af0e23d6a5b914c9c250450 100644 (file)
@@ -73,6 +73,7 @@ static const struct hc_driver ps3_ehci_hc_driver = {
        .bus_resume             = ehci_bus_resume,
 #endif
        .relinquish_port        = ehci_relinquish_port,
+       .port_handed_over       = ehci_port_handed_over,
 };
 
 static int ps3_ehci_probe(struct ps3_system_bus_device *dev)