Commit 3a31155cfff0935e4b178f3dca733d2d60d2eb8d

Authored by Alan Stern
Committed by Greg Kroah-Hartman
1 parent a8e5177583

USB: EHCI: suppress unwanted error messages

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>

Showing 11 changed files with 25 additions and 1 deletions Side-by-side Diff

drivers/usb/core/hcd.h
... ... @@ -213,6 +213,8 @@
213 213  
214 214 /* force handover of high-speed port to full-speed companion */
215 215 void (*relinquish_port)(struct usb_hcd *, int);
  216 + /* has a port been handed over to a companion? */
  217 + int (*port_handed_over)(struct usb_hcd *, int);
216 218 };
217 219  
218 220 extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);
drivers/usb/core/hub.c
... ... @@ -2753,7 +2753,11 @@
2753 2753 if ((status == -ENOTCONN) || (status == -ENOTSUPP))
2754 2754 break;
2755 2755 }
2756   - dev_err(hub_dev, "unable to enumerate USB device on port %d\n", port1);
  2756 + if (hub->hdev->parent ||
  2757 + !hcd->driver->port_handed_over ||
  2758 + !(hcd->driver->port_handed_over)(hcd, port1))
  2759 + dev_err(hub_dev, "unable to enumerate USB device on port %d\n",
  2760 + port1);
2757 2761  
2758 2762 done:
2759 2763 hub_port_disable(hub, port1, 1);
drivers/usb/host/ehci-au1xxx.c
... ... @@ -223,6 +223,7 @@
223 223 .bus_suspend = ehci_bus_suspend,
224 224 .bus_resume = ehci_bus_resume,
225 225 .relinquish_port = ehci_relinquish_port,
  226 + .port_handed_over = ehci_port_handed_over,
226 227 };
227 228  
228 229 /*-------------------------------------------------------------------------*/
drivers/usb/host/ehci-fsl.c
... ... @@ -318,6 +318,7 @@
318 318 .bus_suspend = ehci_bus_suspend,
319 319 .bus_resume = ehci_bus_resume,
320 320 .relinquish_port = ehci_relinquish_port,
  321 + .port_handed_over = ehci_port_handed_over,
321 322 };
322 323  
323 324 static int ehci_fsl_drv_probe(struct platform_device *pdev)
drivers/usb/host/ehci-hub.c
... ... @@ -874,4 +874,15 @@
874 874 return;
875 875 set_owner(ehci, --portnum, PORT_OWNER);
876 876 }
  877 +
  878 +static int ehci_port_handed_over(struct usb_hcd *hcd, int portnum)
  879 +{
  880 + struct ehci_hcd *ehci = hcd_to_ehci(hcd);
  881 + u32 __iomem *reg;
  882 +
  883 + if (ehci_is_TDI(ehci))
  884 + return 0;
  885 + reg = &ehci->regs->port_status[portnum - 1];
  886 + return ehci_readl(ehci, reg) & PORT_OWNER;
  887 +}
drivers/usb/host/ehci-ixp4xx.c
... ... @@ -59,6 +59,7 @@
59 59 .bus_resume = ehci_bus_resume,
60 60 #endif
61 61 .relinquish_port = ehci_relinquish_port,
  62 + .port_handed_over = ehci_port_handed_over,
62 63 };
63 64  
64 65 static int ixp4xx_ehci_probe(struct platform_device *pdev)
drivers/usb/host/ehci-orion.c
... ... @@ -162,6 +162,7 @@
162 162 .bus_suspend = ehci_bus_suspend,
163 163 .bus_resume = ehci_bus_resume,
164 164 .relinquish_port = ehci_relinquish_port,
  165 + .port_handed_over = ehci_port_handed_over,
165 166 };
166 167  
167 168 static void __init
drivers/usb/host/ehci-pci.c
... ... @@ -379,6 +379,7 @@
379 379 .bus_suspend = ehci_bus_suspend,
380 380 .bus_resume = ehci_bus_resume,
381 381 .relinquish_port = ehci_relinquish_port,
  382 + .port_handed_over = ehci_port_handed_over,
382 383 };
383 384  
384 385 /*-------------------------------------------------------------------------*/
drivers/usb/host/ehci-ppc-of.c
... ... @@ -77,6 +77,7 @@
77 77 .bus_resume = ehci_bus_resume,
78 78 #endif
79 79 .relinquish_port = ehci_relinquish_port,
  80 + .port_handed_over = ehci_port_handed_over,
80 81 };
81 82  
82 83  
drivers/usb/host/ehci-ppc-soc.c
... ... @@ -163,6 +163,7 @@
163 163 .bus_suspend = ehci_bus_suspend,
164 164 .bus_resume = ehci_bus_resume,
165 165 .relinquish_port = ehci_relinquish_port,
  166 + .port_handed_over = ehci_port_handed_over,
166 167 };
167 168  
168 169 static int ehci_hcd_ppc_soc_drv_probe(struct platform_device *pdev)
drivers/usb/host/ehci-ps3.c
... ... @@ -73,6 +73,7 @@
73 73 .bus_resume = ehci_bus_resume,
74 74 #endif
75 75 .relinquish_port = ehci_relinquish_port,
  76 + .port_handed_over = ehci_port_handed_over,
76 77 };
77 78  
78 79 static int ps3_ehci_probe(struct ps3_system_bus_device *dev)