aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Nyman <mathias.nyman@linux.intel.com>2018-02-12 07:24:47 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-02-15 12:36:19 -0500
commit1208d8a84fdcae6b395c57911cdf907450d30e70 (patch)
tree70c0a1777e6227324717e88d8fd8546b24339bb3
parentbde0716d1f076e4c913c7946bcc858f71243c7a0 (diff)
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: Mathias Nyman <mathias.nyman@linux.intel.com> Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/xhci-hub.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 1df0c362c436..72ebbc908e19 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -1224,17 +1224,17 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
1224 temp = readl(port_array[wIndex]); 1224 temp = readl(port_array[wIndex]);
1225 break; 1225 break;
1226 } 1226 }
1227 1227 /* Port must be enabled */
1228 /* Software should not attempt to set 1228 if (!(temp & PORT_PE)) {
1229 * port link state above '3' (U3) and the port 1229 retval = -ENODEV;
1230 * must be enabled. 1230 break;
1231 */ 1231 }
1232 if ((temp & PORT_PE) == 0 || 1232 /* Can't set port link state above '3' (U3) */
1233 (link_state > USB_SS_PORT_LS_U3)) { 1233 if (link_state > USB_SS_PORT_LS_U3) {
1234 xhci_warn(xhci, "Cannot set link state.\n"); 1234 xhci_warn(xhci, "Cannot set port %d link state %d\n",
1235 wIndex, link_state);
1235 goto error; 1236 goto error;
1236 } 1237 }
1237
1238 if (link_state == USB_SS_PORT_LS_U3) { 1238 if (link_state == USB_SS_PORT_LS_U3) {
1239 slot_id = xhci_find_slot_id_by_port(hcd, xhci, 1239 slot_id = xhci_find_slot_id_by_port(hcd, xhci,
1240 wIndex + 1); 1240 wIndex + 1);