Bug 194819
Summary: | rtsx_usb_ms prevents my computer from resuming from suspend - Dell Inspiron 5558 | ||
---|---|---|---|
Product: | Drivers | Reporter: | Diego Viola (diego.viola) |
Component: | USB | Assignee: | Zhang Rui (rui.zhang) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | joost, oleksandr, rui.zhang, yu.c.chen |
Priority: | P1 | ||
Hardware: | Intel | ||
OS: | Linux | ||
Kernel Version: | 4.9.11-1-ARCH | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
lspci
dmesg 1 dmesg 2 trace after the hang with no_console_suspend=1 trace after the hang with no_console_suspend=1 Picture of my desktop Uninterruptible processes after booting system lsusb dmidecode lsusb -t lsusb -t with USB 3.0 disabled on BIOS netconsole dmesg capture with xhci_hcd.dyndbg no_console_suspend=1 /sys/kernel/debug/tracing/trace /sys/kernel/debug/tracing/trace with successful suspend/resume dmesg with ftrace at the time of the crash. |
Description
Diego Viola
2017-03-08 19:57:08 UTC
Created attachment 255137 [details]
lspci
could you please upload the jpg and dmesg onto bugzilla as attachment, thx. Created attachment 255227 [details]
dmesg 1
Created attachment 255229 [details]
dmesg 2
Created attachment 255231 [details]
trace after the hang with no_console_suspend=1
Created attachment 255233 [details]
trace after the hang with no_console_suspend=1
(In reply to Chen Yu from comment #2) > could you please upload the jpg and dmesg onto bugzilla as attachment, thx. Done. Please note I'm not exactly sure USB3 is the problem in this case, as I said in my previous reply, I've found that disabling USB3 makes the problem go away, but I also noticed that after disabling HDMI (the external monitor I'm using), the problem also goes away. So I'm suspecting the problem could be related to power or I/O in some way, the laptop has a 5400 RPM hard drive and I'm not sure if the cause of the hang is due to pushing a lot of I/O and the drive/machine not being able to handle it. I'm not sure how I can further debug this problem, any advice welcome. Created attachment 255235 [details]
Picture of my desktop
Here is a picture of my desktop/setup, I'm using the external monitor over HDMI.
I also tried Linux 4.4.52 and the problem was also still there, which makes me suspect it's a hardware problem. I've found something interesting and what it seems to be the cause of my problem. As soon as I boot my system I can see the following process being in the D-state: [root@myhost ~]# ps aux | grep " D" root 269 0.0 0.0 0 0 ? D 14:11 0:00 [rtsx_usb_ms_2] root 1490 0.0 0.0 10788 2200 pts/2 S+ 14:23 0:00 grep D [root@myhost ~]# I'm not exactly sure why that process is in the D-state, but if I do a "modinfo rtsx_pci_ms" the problem is gone, I already tried suspending/resuming ~40 times after I disabled that module and the suspend/resume problem is gone. (In reply to Diego Viola from comment #11) > I've found something interesting and what it seems to be the cause of my > problem. > > As soon as I boot my system I can see the following process being in the > D-state: > > [root@myhost ~]# ps aux | grep " D" > root 269 0.0 0.0 0 0 ? D 14:11 0:00 > [rtsx_usb_ms_2] > root 1490 0.0 0.0 10788 2200 pts/2 S+ 14:23 0:00 grep D > [root@myhost ~]# > > I'm not exactly sure why that process is in the D-state, but if I do a > "modinfo rtsx_pci_ms" the problem is gone, I already tried > suspending/resuming ~40 times after I disabled that module and the > suspend/resume problem is gone. rmmod rtsx_pci_ms, not modinfo, sorry. Created attachment 255245 [details]
Uninterruptible processes after booting system
After booting the system those appear as D-state processes, only [rtsx_usb_ms_2] remains there and it seems to be the cause of my problem.
Created attachment 255251 [details]
lsusb
Created attachment 255253 [details]
dmidecode
According to this document: http://downloads.dell.com/manuals/all-products/esuprt_laptop/esuprt_inspiron_laptop/inspiron-15-5558-laptop_reference%20guide_en-us.pdf My computer only has a SD card slot and no MEMSTICK slot. lsusb says this though: Bus 001 Device 005: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Maybe the driver gets locked up looking for the MEMSTICK slot? (In reply to Diego Viola from comment #13) > Created attachment 255245 [details] > Uninterruptible processes after booting system > > After booting the system those appear as D-state processes, only > [rtsx_usb_ms_2] remains there and it seems to be the cause of my problem. Nice catch. Although I can not open your attachment, I suggest you can check the kernel stack via 'cat /proc/269/stack, this will tell us where the code was blocked at in kernel space, thus we can get some clue. (In reply to Chen Yu from comment #17) > (In reply to Diego Viola from comment #13) > > Created attachment 255245 [details] > > Uninterruptible processes after booting system > > > > After booting the system those appear as D-state processes, only > > [rtsx_usb_ms_2] remains there and it seems to be the cause of my problem. > Nice catch. Although I can not open your attachment, I suggest you can check > the kernel stack via 'cat /proc/269/stack, this will tell us where the code > was blocked at in kernel space, thus we can get some clue. 269 is the pid of the thread rtsx_usb_ms_2 [root@myhost ~]# ps aux | grep " D" root 214 0.0 0.0 0 0 ? D 10:03 0:02 [kworker/0:3] root 8579 0.0 0.0 0 0 ? D 11:45 0:00 [rtsx_usb_ms_2] root 8615 0.0 0.0 10788 2220 pts/8 S+ 11:46 0:00 grep D [root@myhost ~]# cat /proc/8579/stack [<ffffffffa062039e>] rtsx_usb_detect_ms_card+0x6e/0x120 [rtsx_usb_ms] [<ffffffff810a3361>] kthread+0x101/0x140 [<ffffffff8162eb9c>] ret_from_fork+0x2c/0x40 [<ffffffffffffffff>] 0xffffffffffffffff [root@myhost ~]# I'm confused as to why rtsx_usb_ms is being loaded at all if I don't have a MEMSTICK slot. (In reply to Diego Viola from comment #19) > [root@myhost ~]# ps aux | grep " D" > root 214 0.0 0.0 0 0 ? D 10:03 0:02 > [kworker/0:3] > root 8579 0.0 0.0 0 0 ? D 11:45 0:00 > [rtsx_usb_ms_2] > root 8615 0.0 0.0 10788 2220 pts/8 S+ 11:46 0:00 grep D > [root@myhost ~]# cat /proc/8579/stack > [<ffffffffa062039e>] rtsx_usb_detect_ms_card+0x6e/0x120 [rtsx_usb_ms] > [<ffffffff810a3361>] kthread+0x101/0x140 > [<ffffffff8162eb9c>] ret_from_fork+0x2c/0x40 > [<ffffffffffffffff>] 0xffffffffffffffff > [root@myhost ~]# Please note I ran this command while using the system normally (before suspend/resume). I can't do this after the system hangs because I won't be able to connect via ssh, the machine doesn't respond after it hangs. I think it blocked here: mutex_lock(&ucr->dev_mutex); but I don't know why, maybe we should let expert to deal with it, please help send an email to Roger Tseng <rogerable@realtek.com> (In reply to Chen Yu from comment #22) > I think it blocked here: > mutex_lock(&ucr->dev_mutex); > but I don't know why, maybe we should let expert to deal with it, > please help send an email to Roger Tseng <rogerable@realtek.com> Done. Created attachment 255301 [details]
lsusb -t
Created attachment 255303 [details]
lsusb -t with USB 3.0 disabled on BIOS
I've noticed rtsx_usb_ms is still being loaded after USB 3.0 is disabled on the BIOS, and at that point the hang doesn't occur on resume from suspend. // responding here as per author email request I cannot confirm the issue with my hardware: Bus 001 Device 003: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Device Descriptor: ... bcdUSB 2.00 ... idVendor 0x0bda Realtek Semiconductor Corp. idProduct 0x0129 RTS5129 Card Reader Controller ... rtsx_usb_ms_%d poller kthread is OK to be in D state. Mine: 416 ? D 0:56 [rtsx_usb_ms_1] It sleeps on schedule_timeout_idle(HZ), which is kinda normal sleep. Suspend works for me just fine. Please note my card reader reports USB 2.0 as highest supportable, so I assume there is some issue with USB 3.0 sleep on your system. (In reply to Oleksandr Natalenko from comment #27) > // responding here as per author email request > > I cannot confirm the issue with my hardware: > > Bus 001 Device 003: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card > Reader Controller > Device Descriptor: > ... > bcdUSB 2.00 > ... > idVendor 0x0bda Realtek Semiconductor Corp. > idProduct 0x0129 RTS5129 Card Reader Controller > ... > > rtsx_usb_ms_%d poller kthread is OK to be in D state. Mine: > > 416 ? D 0:56 [rtsx_usb_ms_1] > > It sleeps on schedule_timeout_idle(HZ), which is kinda normal sleep. > > Suspend works for me just fine. > > Please note my card reader reports USB 2.0 as highest supportable, so I > assume there is some issue with USB 3.0 sleep on your system. I can only make it hang with rtsx_usb_ms + USB 3.0 (xhci_hcd) and not with rtsx_usb_ms + USB 2.0 (ehci_hcd). Created attachment 255309 [details]
netconsole dmesg capture with xhci_hcd.dyndbg no_console_suspend=1
(In reply to Diego Viola from comment #29) > Created attachment 255309 [details] > netconsole dmesg capture with xhci_hcd.dyndbg no_console_suspend=1 In this attachment I did a couple of suspend/resume with i3lock, e.g. $ i3lock && systemctl suspend It hung after the third or so attempt at resuming from suspend. *** Bug 119401 has been marked as a duplicate of this bug. *** Created attachment 255367 [details]
/sys/kernel/debug/tracing/trace
I built Linux 4.11.0-rc3-ARCH and captured this trace with:
mount -t debugfs none /sys/kernel/debug
echo xhci-hcd >> /sys/kernel/debug/tracing/set_event
cat /sys/kernel/debug/tracing/trace
USB mouse/keyboard was unplugged before booting the machine.
This trace was requested by the USB 3 maintainer on the LKML (linux-kernel, linux-usb lists).
Created attachment 255369 [details]
/sys/kernel/debug/tracing/trace with successful suspend/resume
Created attachment 255419 [details]
dmesg with ftrace at the time of the crash.
kernel parameters used for getting the trace:
hung_task_panic=1 no_console_suspend=1 ftrace_dump_on_oops
USB keyboard and mouse were plugged.
The module netconsole was loaded/configured after the system was already running.
Fixed with this patch: https://patchwork.kernel.org/patch/9642795/ The patch has already been upstreamed and is already in Linux 4.11-rc5. |