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>
This commit is contained in:
parent
a8e5177583
commit
3a31155cff
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue