Re: usb: CPU 100% hog upon device removal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 13.12.2018 13:17, Mathias Nyman wrote:
On 13.12.2018 00:15, Ju Hyung Park wrote:
Hi,

I've just tried out Ubuntu's kernel PPA and this issue is still there.
At least I didn't screw something up on my personal builds.

I've used the following for activating USB dynamic debug:
echo "file drivers/usb/* +p" > /sys/kernel/debug/dynamic_debug/control
Let me know if I should have done something else.

Kernel log stays quiet until I do echo 1 > remove, and it goes nuts.
http://www.arter97.com/usblog.txt.xz
(uncompressed size 27M)

Please have a look.

Thanks.
On Thu, Dec 13, 2018 at 6:46 AM Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:

On Thu, 13 Dec 2018, Ju Hyung Park wrote:

Bus suspend tries to suspend bus after last device is removed, but for some reason
port status still shows as polling/USB3 link training. you end up in busyloop trying
to autosuspend the bus, and bus_suspend returning -EBUSY

this is due to 4.19.8 commit:

commit cc8b329fef53c74a4abf98b0755b3832d572d6ce
Author: Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>
Date:   Thu Nov 15 11:38:41 2018 +0200

     usb: xhci: Prevent bus suspend if a port connect change or polling state is detected
     commit 2f31a67f01a8beb22cae754c53522cb61a005750 upstream.


-Mathias

Looks like it's a USB2 device, seems that the above patch reacts to USB2 polling state as well,
which is a different case.

Does the below change help?

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 94aca1b..01b5818 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -1507,7 +1507,8 @@ int xhci_bus_suspend(struct usb_hcd *hcd)
                portsc_buf[port_index] = 0;
/* Bail out if a USB3 port has a new device in link training */
-               if ((t1 & PORT_PLS_MASK) == XDEV_POLLING) {
+               if ((hcd->speed >= HCD_USB3) &&
+                   (t1 & PORT_PLS_MASK) == XDEV_POLLING) {
                        bus_state->bus_suspended = 0;
                        spin_unlock_irqrestore(&xhci->lock, flags);
                        xhci_dbg(xhci, "Bus suspend bailout, port in polling\n");



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux