usb: CPU 100% hog upon device removal

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

 



Hi,

I'm using the latest stable tree v4.19.8,
and I'm noticing kworker and ksoftirqd hogging up the CPU
upon removing any USB devices on my laptop.

This issue was not present on any kernels below v4.19.

Doing a simple:
echo 1 > /sys/devices/pci0000:00/0000:00:14.0/usb1/1-6/remove
(or any other USB device for that matter)
and I'm able to reproduce the issue.

Kernel log seems fine, ending with:
"[  464.546444] usb 1-6: USB disconnect, device number 3"

top reports:
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+
COMMAND
  273 root      20   0       0      0      0 R  81.4  0.0   1:33.15
kworker/4:1+pm
   32 root      20   0       0      0      0 S  18.6  0.0   0:22.37
ksoftirqd/4

Doing a sysrq backtrace reports the following:

[  605.575727] NMI backtrace for cpu 4
[  605.575728] CPU: 4 PID: 273 Comm: kworker/4:1 Tainted: G     U
      4.19.8-zen+ #1
[  605.575729] Hardware name: LG Electronics
14ZD980-GX50K/14Z980, BIOS K2ZC0250 X64 03/08/2018
[  605.575729] Workqueue: pm pm_runtime_work
[  605.575730] RIP: 0010:xhci_hub_control+0x4c2/0x1a80
[  605.575732] Code: 10 0f 8f 45 fc ff ff 41 ff cc 48 8b 74 24 18 41
0f b7 c4 48 89 44 24 28 48 8d 04 c6 48 89 44 24 40 48 8b 00 48 8b 00
44 8b 38 <41> 83 ff ff 0f 84 f3 04 00 00 0f 1f 44 00 00 48 8b 84 24 80
00 00
[  605.575732] RSP: 0018:ffff8884279cb9a8 EFLAGS: 00000007
[  605.575733] RAX: ffffc90001cc0520 RBX: ffff888431246000 RCX: 000000000000000b
[  605.575734] RDX: 000000000000000b RSI: ffff8884278a6ae0 RDI: ffff88843124627c
[  605.575734] RBP: ffff888431246000 R08: ffff88842d5c6760 R09: 0000000000000004
[  605.575735] R10: ffff88842d5c6760 R11: 0000000000000004 R12: 000000000000000a
[  605.575735] R13: ffff88842d5c6760 R14: 000000000000a300 R15: 00000000000002a0
[  605.575736] FS:  0000000000000000(0000) GS:ffff888433500000(0000)
knlGS:0000000000000000
[  605.575736] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  605.575737] CR2: 00007f0862a03010 CR3: 0000000004608005 CR4: 00000000003606e0
[  605.575737] Call Trace:
[  605.575738]  ? pick_next_task_fair+0x485/0x510
[  605.575738]  ? _cond_resched+0x10/0x20
[  605.575738]  ? __kmalloc+0x16d/0x1a0
[  605.575739]  ? usb_hcd_submit_urb+0x6a5/0xa50
[  605.575739]  ? preempt_schedule_common+0xa/0x20
[  605.575740]  ? _cond_resched+0x18/0x20
[  605.575740]  ? wait_for_common+0x29/0x180
[  605.575740]  ? update_curr+0xa3/0x160
[  605.575741]  ? usb_start_wait_urb+0x50/0xc0
[  605.575741]  ? usb_control_msg+0xbe/0x110
[  605.575742]  ? hub_ext_port_status+0x86/0x130
[  605.575742]  ? hub_activate+0x1c3/0x5e0
[  605.575742]  ? hub_resume+0x1c/0xb0
[  605.575743]  ? hcd_bus_suspend+0x6c/0x130
[  605.575743]  ? usb_resume_interface.isra.2+0x6f/0xb0
[  605.575744]  ? usb_suspend_both+0x122/0x1f0
[  605.575744]  ? usb_probe_interface+0x290/0x290
[  605.575745]  ? usb_runtime_suspend+0x21/0x60
[  605.575745]  ? __rpm_callback+0x70/0x1c0
[  605.575746]  ? usb_probe_interface+0x290/0x290
[  605.575746]  ? rpm_callback+0x1a/0x70
[  605.575746]  ? usb_probe_interface+0x290/0x290
[  605.575747]  ? rpm_suspend+0x120/0x640
[  605.575747]  ? usb_runtime_resume+0x20/0x20
[  605.575748]  ? __pm_runtime_suspend+0x3c/0x70
[  605.575748]  ? usb_runtime_idle+0x26/0x30
[  605.575748]  ? __rpm_callback+0x70/0x1c0
[  605.575749]  ? rpm_idle+0x9f/0x300
[  605.575749]  ? pm_runtime_work+0x6e/0x90
[  605.575750]  ? process_one_work+0x1ff/0x3f0
[  605.575750]  ? worker_thread+0x28/0x3e0
[  605.575751]  ? kthread+0x107/0x120
[  605.575751]  ? process_one_work+0x3f0/0x3f0
[  605.575751]  ? kthread_park+0x80/0x80
[  605.575752]  ? ret_from_fork+0x1f/0x30

Here's a kernel log with grep -i 'usb\|hcd' before removal:

[    0.008613] ACPI: SSDT 0x00000000AFFAB000 001099 (v02 LGE
UsbCTabl 00001000 INTL 20160527)
[    0.247206] ACPI: bus type USB registered
[    0.247206] usbcore: registered new interface driver usbfs
[    0.247206] usbcore: registered new interface driver hub
[    0.247206] usbcore: registered new device driver usb
[    0.509498] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.511081] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.512623] uhci_hcd: USB Universal Host Controller Interface driver
[    0.513261] xhci_hcd 0000:00:14.0: xHCI Host Controller
[    0.513780] xhci_hcd 0000:00:14.0: new USB bus registered, assigned
bus number 1
[    0.515379] xhci_hcd 0000:00:14.0: hcc params 0x200077c1 hci
version 0x100 quirks 0x0000000001109810
[    0.515912] xhci_hcd 0000:00:14.0: cache line size of 64 is not supported
[    0.516031] usb usb1: New USB device found, idVendor=1d6b,
idProduct=0002, bcdDevice= 4.19
[    0.516583] usb usb1: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[    0.517120] usb usb1: Product: xHCI Host Controller
[    0.517661] usb usb1: Manufacturer: Linux 4.19.8-zen+ xhci-hcd
[    0.518197] usb usb1: SerialNumber: 0000:00:14.0
[    0.518838] hub 1-0:1.0: USB hub found
[    0.520851] xhci_hcd 0000:00:14.0: xHCI Host Controller
[    0.521389] xhci_hcd 0000:00:14.0: new USB bus registered, assigned
bus number 2
[    0.521932] xhci_hcd 0000:00:14.0: Host supports USB 3.0  SuperSpeed
[    0.522491] usb usb2: New USB device found, idVendor=1d6b,
idProduct=0003, bcdDevice= 4.19
[    0.523049] usb usb2: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[    0.523592] usb usb2: Product: xHCI Host Controller
[    0.524134] usb usb2: Manufacturer: Linux 4.19.8-zen+ xhci-hcd
[    0.524666] usb usb2: SerialNumber: 0000:00:14.0
[    0.525265] hub 2-0:1.0: USB hub found
[    0.526675] usb: port power management may be unreliable
[    0.527390] usbcore: registered new interface driver uas
[    0.527900] usbcore: registered new interface driver usb-storage
[    0.535367] usbcore: registered new interface driver btusb
[    0.890066] usb 1-5: new full-speed USB device number 2 using xhci_hcd
[    1.080467] usb 1-5: New USB device found, idVendor=8087,
idProduct=0a2b, bcdDevice= 0.10
[    1.080473] usb 1-5: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.239507] usb 1-6: new high-speed USB device number 3 using xhci_hcd
[    1.450895] usb 1-6: New USB device found, idVendor=0bda,
idProduct=562e, bcdDevice= 0.11
[    1.450895] usb 1-6: New USB device strings: Mfr=3, Product=1, SerialNumber=2
[    1.450896] usb 1-6: Product: LG Camera
[    1.450897] usb 1-6: Manufacturer: EBP63421702810008433
[    1.450897] usb 1-6: SerialNumber: 200901010001
[    1.600089] usb 1-8: new full-speed USB device number 4 using xhci_hcd
[    1.784507] usb 1-8: New USB device found, idVendor=10a5,
idProduct=0007, bcdDevice= 2.00
[    1.784508] usb 1-8: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    1.784509] usb 1-8: Product: FPC Sensor Controller
[    1.784509] usb 1-8: Manufacturer: FPC
[   13.805594] input: LG Camera: LG Camera as
/devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.0/input/input17
[   13.805640] usbcore: registered new interface driver uvcvideo
[   13.805640] USB Video Class driver (1.1.1)
[  464.546444] usb 1-6: USB disconnect, device number 3


I've already tried reverting some commits introduced from v4.19, but
it didn't help:

    Revert "USB: xhci-hcd: Add get_resuming_ports method"
    This reverts commit 8f9cc83c06d44081d7c7e179f778cbeb4d074fa7.

    Revert "USB: ehci-hcd: Add get_resuming_ports method"
    This reverts commit 00d423c8d0132915f4204b330343420c271b9142.

    Revert "USB: Report wakeup events on root-hub ports"
    This reverts commit 379cacc5e566f7197bdeb1ea3e99219d3e880c0a.

    Revert "USB: remove LPM management from usb_driver_claim_interface()"
    This reverts commit c183813fcee44a249339b7c46e1ad271ca1870aa.

    Revert "USB: fix error handling in usb_driver_claim_interface()"
    This reverts commit bd729f9d67aa9a303d8925bb8c4f06af25f407d1.


Rebooting works find, so I'm guessing the loop kworker is going
through is interruptible.


Any ideas?

Thanks,



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

  Powered by Linux