From: Lukas Wunner <lukas@wunner.de>
To: James Dutton <james.dutton@gmail.com>
Cc: Linux PM mailing list <linux-pm@vger.kernel.org>
Subject: Re: USB4 thunderbolt device suspend/resume problems. Unplug during suspend.
Date: Fri, 25 Apr 2025 18:22:05 +0200 [thread overview]
Message-ID: <aAu2reEG9RHjRjL9@wunner.de> (raw)
In-Reply-To: <CAAMvbhEOLmSm97rzLKgjNV=7Uy8UspPAS1vc4W3xv5F_b6PNaQ@mail.gmail.com>
On Sat, Mar 22, 2025 at 01:38:34PM +0000, James Dutton wrote:
> > On Mon, Feb 17, 2025 at 08:44:19PM +0000, James Dutton wrote:
> > > I have a thunderbolt / usb4 10Gbps ethernet adapter.
> > > While plugged in, it appears to handle suspend and resume OK.
> > > The problem is the following:
> > > 1) Thunderbolt device plugged in. Device appears in "lscpi".
> > > 2) Suspend Laptop
> > > 3) Unplug the device while it is asleep.
> > > 4) Resume the Laptop
> > > 5) Laptop locks up, no stack trace, nothing output.
>
> I found something that worked for me.
> I found an infinite loop and adding a timeout to it fixed my problem:
> E.g.
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -6840,8 +6841,16 @@ void napi_disable(struct napi_struct *n)
> do {
> while (val & (NAPIF_STATE_SCHED | NAPIF_STATE_NPSVC)) {
> usleep_range(20, 200);
> + loop_counter++;
> + if (loop_counter > 625) {
> + break;
> + }
> val = READ_ONCE(n->state);
> }
> + if (loop_counter > 625) {
> + pr_warn("dev.c:napi_disable() timed out\n");
> + break;
> + }
>
> new = val | NAPIF_STATE_SCHED | NAPIF_STATE_NPSVC;
> new &= ~(NAPIF_STATE_THREADED | NAPIF_STATE_PREFER_BUSY_POLL);
I'm afraid that's a hack, not a proper fix. You can insert a call
to "dump_stack();" before the "break;" to see where the call to
napi_disable() is coming from.
It seems the driver of the network adapter built into the dock
gets confused if the adapter is no longer present on resume.
It would be good if you could report this to the maintainers of that
driver and/or netdev maintainers, as well as netdev@vger.kernel.org.
Thanks,
Lukas
prev parent reply other threads:[~2025-04-25 16:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-17 20:44 USB4 thunderbolt device suspend/resume problems. Unplug during suspend James Dutton
2025-03-13 20:45 ` Lukas Wunner
2025-03-22 13:38 ` James Dutton
2025-04-25 16:22 ` Lukas Wunner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aAu2reEG9RHjRjL9@wunner.de \
--to=lukas@wunner.de \
--cc=james.dutton@gmail.com \
--cc=linux-pm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox