linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bug 217915] New: System fails to resume correctly after Thunderbolt dock disconnected while sleeping
@ 2023-09-15 23:11 bugzilla-daemon
  2023-09-15 23:23 ` [Bug 217915] " bugzilla-daemon
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: bugzilla-daemon @ 2023-09-15 23:11 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=217915

            Bug ID: 217915
           Summary: System fails to resume correctly after Thunderbolt
                    dock disconnected while sleeping
           Product: Drivers
           Version: 2.5
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: USB
          Assignee: drivers_usb@kernel-bugs.kernel.org
          Reporter: mark.blakeney@bullet-systems.net
        Regression: No

After my comments on bug #216728, Mika Westerberg suggested I raise this new
bug.

I have a Dell XPS13 laptop and Dell WD19TB Thunderbolt dock and normally work
on two dock connected screens + keyboard + mouse with the laptop screen closed.
If my laptop suspends in this state, and I then unplug the dock (e.g. to take
the laptop away in the morning) then the screen stays blank when I try to
resume. This started when Arch Linux updated the kernel from 6.3.9 (good) to
6.4.1 (bad) and I have tested it bad with every point release of 6.4 since up
to 6.4.12 and is also bad on current 6.5.3. I have generally been using the LTS
kernel (currently 6.1.53) to avoid this bug.

If you wait about 60 to 70 secs then the screen does switch on. On 6.4 kernels
I had to wait about 2.5 mins, i.e. this delay has reduced on 6.5 kernels.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 217915] System fails to resume correctly after Thunderbolt dock disconnected while sleeping
  2023-09-15 23:11 [Bug 217915] New: System fails to resume correctly after Thunderbolt dock disconnected while sleeping bugzilla-daemon
@ 2023-09-15 23:23 ` bugzilla-daemon
  2023-09-15 23:29 ` bugzilla-daemon
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2023-09-15 23:23 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=217915

--- Comment #1 from Mark Blakeney (mark.blakeney@bullet-systems.net) ---
Mika, in bug #216728, you were concerned that I am using
"mem_sleep_default=deep" option but please note the very first thing I removed
(and have repeated a few times including today) to confirm that the problem
still occurs. I.e. that option is irrelevant to this issue. Note, I have used
that option for the 3 years I have had the laptop because if I don't then my
laptop battery will die overnight when simply suspending. I will remove it,
enable thunderbolt.dyndbg=+p, and then will capture a new dmesg output
(compared to what I did for bug #216728) to attach here.

Note that I use fwupd often to ensure my BIOS and dock etc are always running
the latest firmware. Dell updates both quite frequently and I am always running
the latest. It was mentioned in that email thread at
https://www.spinics.net/lists/linux-pci/msg142902.html that changing the BIOS
thunderbird setting to "No security" helps alleviate this issue but I don't
have any security options like that in my BIOS.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 217915] System fails to resume correctly after Thunderbolt dock disconnected while sleeping
  2023-09-15 23:11 [Bug 217915] New: System fails to resume correctly after Thunderbolt dock disconnected while sleeping bugzilla-daemon
  2023-09-15 23:23 ` [Bug 217915] " bugzilla-daemon
@ 2023-09-15 23:29 ` bugzilla-daemon
  2023-09-15 23:40 ` bugzilla-daemon
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2023-09-15 23:29 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=217915

--- Comment #2 from Mark Blakeney (mark.blakeney@bullet-systems.net) ---
Created attachment 305117
  --> https://bugzilla.kernel.org/attachment.cgi?id=305117&action=edit
dmesg output with thunderbolt.dyndbg=+p

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 217915] System fails to resume correctly after Thunderbolt dock disconnected while sleeping
  2023-09-15 23:11 [Bug 217915] New: System fails to resume correctly after Thunderbolt dock disconnected while sleeping bugzilla-daemon
  2023-09-15 23:23 ` [Bug 217915] " bugzilla-daemon
  2023-09-15 23:29 ` bugzilla-daemon
@ 2023-09-15 23:40 ` bugzilla-daemon
  2023-09-16  1:22 ` bugzilla-daemon
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2023-09-15 23:40 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=217915

Mark Blakeney (mark.blakeney@bullet-systems.net) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dev@mattleach.net,
                   |                            |mika.westerberg@linux.intel
                   |                            |.com
     Kernel Version|                            |6.4, 6.5
         Regression|No                          |Yes

--- Comment #3 from Mark Blakeney (mark.blakeney@bullet-systems.net) ---
Note the sequence I did to capture that dmesg output was:

1. Added thunderbolt.dyndbg=+p to boot and rebooted.
2. Have laptop lid closed and working with 2 screens + keyboard + mouse on
dock.
3. Suspended my laptop.
4. Unplugged dock.
5. Opened lid on laptop and witnessed the 60s blank screen delay.
6. Captured the dmesg output and attached here.

Unlike the dmesg capture I did for bug #216728, this time I did not reconnect
the dock because I wish to point out clearly that this must be a bug in Linux
given that at the time the bug occurs (i.e. the screen does not recover after
resume) the dock is physically disconnected.

I should also reiterate on this bug that user Matt L on the original bug has a
Dell XPS laptop and thunderbolt dock and reports this exact same issue as me so
have CC him here.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 217915] System fails to resume correctly after Thunderbolt dock disconnected while sleeping
  2023-09-15 23:11 [Bug 217915] New: System fails to resume correctly after Thunderbolt dock disconnected while sleeping bugzilla-daemon
                   ` (2 preceding siblings ...)
  2023-09-15 23:40 ` bugzilla-daemon
@ 2023-09-16  1:22 ` bugzilla-daemon
  2023-09-16  1:23 ` bugzilla-daemon
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2023-09-16  1:22 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=217915

--- Comment #4 from Mark Blakeney (mark.blakeney@bullet-systems.net) ---
Created attachment 305118
  --> https://bugzilla.kernel.org/attachment.cgi?id=305118&action=edit
dmesg output with CONFIG_PCI_DEBUG and thunderbolt.dyndbg=+p

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 217915] System fails to resume correctly after Thunderbolt dock disconnected while sleeping
  2023-09-15 23:11 [Bug 217915] New: System fails to resume correctly after Thunderbolt dock disconnected while sleeping bugzilla-daemon
                   ` (3 preceding siblings ...)
  2023-09-16  1:22 ` bugzilla-daemon
@ 2023-09-16  1:23 ` bugzilla-daemon
  2023-09-16 17:14 ` bugzilla-daemon
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2023-09-16  1:23 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=217915

--- Comment #5 from Mark Blakeney (mark.blakeney@bullet-systems.net) ---
Recompiled Arch kernel 6.5.3.arch1-1 with CONFIG_PCI_DEBUG=y and then repeated
above steps to create the attached dmesg output.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 217915] System fails to resume correctly after Thunderbolt dock disconnected while sleeping
  2023-09-15 23:11 [Bug 217915] New: System fails to resume correctly after Thunderbolt dock disconnected while sleeping bugzilla-daemon
                   ` (4 preceding siblings ...)
  2023-09-16  1:23 ` bugzilla-daemon
@ 2023-09-16 17:14 ` bugzilla-daemon
  2023-09-16 22:07 ` bugzilla-daemon
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2023-09-16 17:14 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=217915

Mario Limonciello (AMD) (mario.limonciello@amd.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mario.limonciello@amd.com

--- Comment #6 from Mario Limonciello (AMD) (mario.limonciello@amd.com) ---
Since you've already identified two relatively close targets of 6.3.9 to 6.4.1
would you be able to bisect between?

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 217915] System fails to resume correctly after Thunderbolt dock disconnected while sleeping
  2023-09-15 23:11 [Bug 217915] New: System fails to resume correctly after Thunderbolt dock disconnected while sleeping bugzilla-daemon
                   ` (5 preceding siblings ...)
  2023-09-16 17:14 ` bugzilla-daemon
@ 2023-09-16 22:07 ` bugzilla-daemon
  2023-09-17  6:57 ` bugzilla-daemon
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2023-09-16 22:07 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=217915

--- Comment #7 from Mark Blakeney (mark.blakeney@bullet-systems.net) ---
Mario, we already know that commit
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e8b908146d44310473e43b3382eca126e12d279c
caused this issue but Mika says that change (which is merely a timeout increase
from 1 sec to 60 sec) is valid and has merely exposed this latent problem.

What I don't get is that this bug occurs after the Thunderbolt dock is
disconnected and the system is then resumed so surely it has got to be a
straight out logical error that the kernel sits around for 60 secs waiting for
a device that is no longer connected?

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 217915] System fails to resume correctly after Thunderbolt dock disconnected while sleeping
  2023-09-15 23:11 [Bug 217915] New: System fails to resume correctly after Thunderbolt dock disconnected while sleeping bugzilla-daemon
                   ` (6 preceding siblings ...)
  2023-09-16 22:07 ` bugzilla-daemon
@ 2023-09-17  6:57 ` bugzilla-daemon
  2023-09-17 11:26 ` bugzilla-daemon
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2023-09-17  6:57 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=217915

--- Comment #8 from Mika Westerberg (mika.westerberg@linux.intel.com) ---
Created attachment 305120
  --> https://bugzilla.kernel.org/attachment.cgi?id=305120&action=edit
Mark devices as disconnected if resume fails

I can reproduce this myself now. The reason why it takes so long is indeed that
we try to resume the devices that are behind the port whose link did not come
up after suspend and since they are gone we end up waiting them for the ~60s
each.

Can you try the attached patch? On my system this makes the issue go away.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 217915] System fails to resume correctly after Thunderbolt dock disconnected while sleeping
  2023-09-15 23:11 [Bug 217915] New: System fails to resume correctly after Thunderbolt dock disconnected while sleeping bugzilla-daemon
                   ` (7 preceding siblings ...)
  2023-09-17  6:57 ` bugzilla-daemon
@ 2023-09-17 11:26 ` bugzilla-daemon
  2023-09-17 19:01 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2023-09-17 11:26 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=217915

--- Comment #9 from Mark Blakeney (mark.blakeney@bullet-systems.net) ---
Mika, yes I applied that patch to Arch kernel 6.5.3 and it does fix the issue.

So it seems this has nothing to do with Thunderbolt and would occur when any
USB dock is disconnected while the laptop is suspended? I am surprised there
were not heaps of users complaining about this issue since 6.4 and 6.5? Anyhow,
thanks very much for your time here and rapid fix.

At what next kernel version are we likely to see this fix included?

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 217915] System fails to resume correctly after Thunderbolt dock disconnected while sleeping
  2023-09-15 23:11 [Bug 217915] New: System fails to resume correctly after Thunderbolt dock disconnected while sleeping bugzilla-daemon
                   ` (8 preceding siblings ...)
  2023-09-17 11:26 ` bugzilla-daemon
@ 2023-09-17 19:01 ` bugzilla-daemon
  2023-09-18  5:36 ` bugzilla-daemon
  2023-10-10 23:23 ` bugzilla-daemon
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2023-09-17 19:01 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=217915

--- Comment #10 from Matt L (dev@mattleach.net) ---
Hi there,

I also commented on bug #216728 and can confirm that I am experiencing this
bug.  My hardware is a Dell 5430 Rugged plugging into a Dell WD22TB4. My Dell
XPS 13 Plus exhibits this issue too when plugging into the same dock.

I can also confirm that the proposed patch fixes the issue on both machines.

Thanks,
Matt

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 217915] System fails to resume correctly after Thunderbolt dock disconnected while sleeping
  2023-09-15 23:11 [Bug 217915] New: System fails to resume correctly after Thunderbolt dock disconnected while sleeping bugzilla-daemon
                   ` (9 preceding siblings ...)
  2023-09-17 19:01 ` bugzilla-daemon
@ 2023-09-18  5:36 ` bugzilla-daemon
  2023-10-10 23:23 ` bugzilla-daemon
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2023-09-18  5:36 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=217915

--- Comment #11 from Mika Westerberg (mika.westerberg@linux.intel.com) ---
Thanks for testing!

Yes, this can happen on any dock with PCIe devices (typically that's
Thunderbolt/USB4). I'm also surprised that we did not see this because this is
pretty common use case with laptops especially. Sorry about that.

I've submitted the patch upstream now:

https://lore.kernel.org/linux-pci/20230918053041.1018876-1-mika.westerberg@linux.intel.com/

It is up to the PCI maintainer to decide when it lands to mainline and the
stable trees but in this case I would expect it to be sooner rather than later.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 217915] System fails to resume correctly after Thunderbolt dock disconnected while sleeping
  2023-09-15 23:11 [Bug 217915] New: System fails to resume correctly after Thunderbolt dock disconnected while sleeping bugzilla-daemon
                   ` (10 preceding siblings ...)
  2023-09-18  5:36 ` bugzilla-daemon
@ 2023-10-10 23:23 ` bugzilla-daemon
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2023-10-10 23:23 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=217915

Mark Blakeney (mark.blakeney@bullet-systems.net) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |CODE_FIX

--- Comment #12 from Mark Blakeney (mark.blakeney@bullet-systems.net) ---
This bug can be closed since the patch above is now included in linux 6.5.7
which has been released on Arch.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-10-10 23:23 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-15 23:11 [Bug 217915] New: System fails to resume correctly after Thunderbolt dock disconnected while sleeping bugzilla-daemon
2023-09-15 23:23 ` [Bug 217915] " bugzilla-daemon
2023-09-15 23:29 ` bugzilla-daemon
2023-09-15 23:40 ` bugzilla-daemon
2023-09-16  1:22 ` bugzilla-daemon
2023-09-16  1:23 ` bugzilla-daemon
2023-09-16 17:14 ` bugzilla-daemon
2023-09-16 22:07 ` bugzilla-daemon
2023-09-17  6:57 ` bugzilla-daemon
2023-09-17 11:26 ` bugzilla-daemon
2023-09-17 19:01 ` bugzilla-daemon
2023-09-18  5:36 ` bugzilla-daemon
2023-10-10 23:23 ` bugzilla-daemon

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).