提交 1208d8a8 编写于 作者: M Mathias Nyman 提交者: Greg Kroah-Hartman

xhci: Don't print a warning when setting link state for disabled ports

When disabling a USB3 port the hub driver will set the port link state to
U3 to prevent "ejected" or "safely removed" devices that are still
physically connected from immediately re-enumerating.

If the device was really unplugged, then error messages were printed
as the hub tries to set the U3 link state for a port that is no longer
enabled.

xhci-hcd ee000000.usb: Cannot set link state.
usb usb8-port1: cannot disable (err = -32)

Don't print error message in xhci-hub if hub tries to set port link state
for a disabled port. Return -ENODEV instead which also silences hub driver.
Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
Tested-by: NYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 bde0716d
...@@ -1224,17 +1224,17 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -1224,17 +1224,17 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
temp = readl(port_array[wIndex]); temp = readl(port_array[wIndex]);
break; break;
} }
/* Port must be enabled */
/* Software should not attempt to set if (!(temp & PORT_PE)) {
* port link state above '3' (U3) and the port retval = -ENODEV;
* must be enabled. break;
*/ }
if ((temp & PORT_PE) == 0 || /* Can't set port link state above '3' (U3) */
(link_state > USB_SS_PORT_LS_U3)) { if (link_state > USB_SS_PORT_LS_U3) {
xhci_warn(xhci, "Cannot set link state.\n"); xhci_warn(xhci, "Cannot set port %d link state %d\n",
wIndex, link_state);
goto error; goto error;
} }
if (link_state == USB_SS_PORT_LS_U3) { if (link_state == USB_SS_PORT_LS_U3) {
slot_id = xhci_find_slot_id_by_port(hcd, xhci, slot_id = xhci_find_slot_id_by_port(hcd, xhci,
wIndex + 1); wIndex + 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册