* [2/6] xhci: Don't print a warning when setting link state for disabled ports
@ 2018-02-12 12:24 Mathias Nyman
0 siblings, 0 replies; 2+ messages in thread
From: Mathias Nyman @ 2018-02-12 12:24 UTC (permalink / raw)
To: gregkh; +Cc: linux-usb, Mathias Nyman
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>
---
drivers/usb/host/xhci-hub.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 1df0c36..72ebbc9 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,
temp = readl(port_array[wIndex]);
break;
}
-
- /* Software should not attempt to set
- * port link state above '3' (U3) and the port
- * must be enabled.
- */
- if ((temp & PORT_PE) == 0 ||
- (link_state > USB_SS_PORT_LS_U3)) {
- xhci_warn(xhci, "Cannot set link state.\n");
+ /* Port must be enabled */
+ if (!(temp & PORT_PE)) {
+ retval = -ENODEV;
+ break;
+ }
+ /* Can't set port link state above '3' (U3) */
+ if (link_state > USB_SS_PORT_LS_U3) {
+ xhci_warn(xhci, "Cannot set port %d link state %d\n",
+ wIndex, link_state);
goto error;
}
-
if (link_state == USB_SS_PORT_LS_U3) {
slot_id = xhci_find_slot_id_by_port(hcd, xhci,
wIndex + 1);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [2/6] xhci: Don't print a warning when setting link state for disabled ports
@ 2018-02-13 9:47 Yoshihiro Shimoda
0 siblings, 0 replies; 2+ messages in thread
From: Yoshihiro Shimoda @ 2018-02-13 9:47 UTC (permalink / raw)
To: Mathias Nyman, gregkh@linuxfoundation.org; +Cc: linux-usb@vger.kernel.org
Hi,
> From: Mathias Nyman, Sent: Monday, February 12, 2018 9:25 PM
>
> 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>
Thank you very much for the patch!
I tested this patch on my environment and then the error messages disappeared.
So,
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Best regards,
Yoshihiro Shimoda
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-02-13 9:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-12 12:24 [2/6] xhci: Don't print a warning when setting link state for disabled ports Mathias Nyman
-- strict thread matches above, loose matches on Subject: below --
2018-02-13 9:47 Yoshihiro Shimoda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).