From: "David Westen" <davidlwesten@gmail.com>
To: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>,
"David Westen" <davidlwesten@gmail.com>
Cc: <netdev@vger.kernel.org>,
"Loic Poulain" <loic.poulain@oss.qualcomm.com>,
"Sergey Ryazanov" <ryazanov.s.a@gmail.com>,
"Johannes Berg" <johannes@sipsolutions.net>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@kernel.org>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>
Subject: Re: [PATCH net v3 2/2] net: wwan: iosm: re-bind the driver when the modem rebooted during S3
Date: Fri, 27 Nov 2026 08:46:46 -0800 [thread overview]
Message-ID: <DN659J3QCZRL.2PU3PICXJW6K9@gmail.com> (raw)
In-Reply-To: <fd2a9a0a-106e-467b-acd0-7045410305e3@maciej.szmigiero.name>
Hi Maciej,
Thanks for taking the time to review this again!
On 27.11.2026 14:49, Maciej S. Szmigiero wrote:
> That's a much more intrusive change than simply re-binding the driver
> and to be honest, feels like a hack around various paths in the iosm
> driver that may be touching a modem that lost its power and then crashed.
Fair point about the size. The aim was to avoid behavioral changes
unless the modem rebooted, and, unlike v2, now also avoid possibly
re-binding on s2idle or opportunistic sleep.
On my laptop, the order is the other way around: the modem crashes
during suspend entry, from the FORCE_SLEEP doorbell (which my s2idle
series removes), and writes CD_READY to the shared memory. Then it
loses power and boots again during resume. So after resume the modem
is fine, and only that stale CD_READY says otherwise.
A plain re-bind of the unmodified driver after S3 worked in my tests,
but those had no port open and wwan0 down; with this patch I also
tested wwan0 up through the suspend. The checks are there because the
driver and the modem are out of sync until the re-bind, so the cleanup
shouldn't wait for replies or send commands the rebooted modem knows
nothing about. If you prefer the plain re-bind, I'll keep only the
detection and the re-bind, and test that with a port open and wwan0 up
before sending v4.
> Also, wouldn't the problematic things that you describe in your cover
> letter as happening at modem unbind during suspend also happen without
> any power transition if the iosm module is simply unloaded from the
> kernel (presumably with modem still connected)?
Yes, rmmod and hibernation run the same cleanup, and both problems
are already in mainline: unbinding with wwan0 up hits the
use-after-free that patch 1 fixes, and unbinding under traffic lets
the modem DMA into the freed MUX buffers. I reproduced them with my v2
patches applied, which leave that part of the cleanup unchanged.
> If yes, then this new approach is simply papering over bugs in the
> iosm module cleanup that really should be fixed at some point
> independently from any suspend/resume transition issues.
Agreed they need fixing, and I'd like to rework the teardown for
net-next. But the re-bind doesn't hide them: a modem that lost power
holds none of the driver's memory, and the remaining races are as
exposed as with rmmod today.
Thanks,
David
prev parent reply other threads:[~2026-11-27 16:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 19:41 [PATCH net v3 0/2] net: wwan: iosm: fix S3 resume by re-binding the driver after it David Westen
2026-11-26 19:41 ` [PATCH net v3 1/2] net: wwan: iosm: free the MUX after the netdevs that use it David Westen
2026-11-26 19:41 ` [PATCH net v3 2/2] net: wwan: iosm: re-bind the driver when the modem rebooted during S3 David Westen
2026-11-27 13:49 ` Maciej S. Szmigiero
2026-11-27 16:46 ` David Westen [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=DN659J3QCZRL.2PU3PICXJW6K9@gmail.com \
--to=davidlwesten@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=loic.poulain@oss.qualcomm.com \
--cc=mail@maciej.szmigiero.name \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ryazanov.s.a@gmail.com \
/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