Re: [PATCH net] net: wwan: iosm: fix S3 resume by re-binding the driver around it

From: David Westen

Date: Wed Nov 18 2026 - 22:43:25 EST


> - [Medium] pm_notify() in drivers/net/wwan/iosm/iosm_ipc_pcie.c decides
> whether to unbind the driver on PM_SUSPEND_PREPARE by checking…
> - [Medium] The changelog limits the problem to "platforms where S3 cuts
> power to the WWAN card".
>
> Pre-existing issues:
> - [High] ipc_imem_cleanup()
> (drivers/net/wwan/iosm/iosm_ipc_imem.c:1231-1266) cancels…

Thanks for the review, these were good points. I tried the suggestions
and will send a v2; details below.

> Could this be gated on ipc_pcie->d3l2_support or a platform check? And
> since the patch is tagged Cc: stable, could the changelog mention this
> change in behaviour?

I looked at gating on d3l2_support first, but it doesn't match the
power behavior here: the X1 Carbon 6th gen reports D0L12 and the modem
still loses power in S3.

So I tried checking the hardware instead: on resume, read the exec
stage before touching the modem, and only re-bind the driver from
PM_POST_SUSPEND if it no longer reads RUN. That covered every sleep
state and left platforms that keep the modem powered alone, and it
worked in most runs. The catch is that the re-bind then tears down a
modem that has already booted again. When a port was still open at
that point, port close sent PIPE_CLOSE messages to the new firmware,
they timed out, and the modem crashed:

iosm 0000:03:00.0: modem lost power while suspended (stage 0xfeedb007), probing it again
iosm 0000:03:00.0: msg timeout
iosm 0000:03:00.0: msg timeout
(exec stage now 0xbadc0ded, the probe then fails)

Making the teardown safe against that would mean changing every path
that talks to the modem during removal, which seemed like a lot of
change for a stable fix. Unbinding before S3 tears the driver down
while the modem still answers and has worked reliably, so v2 keeps it.
The trade-off is that on platforms that keep the slot powered in S3,
the modem is probed again on resume, which drops data sessions and
recreates the ports. As you suggested, the changelog will spell that
out.

If you'd rather see the resume-time check, I'm happy to work on that
instead.

> Can pm_suspend_default_s2idle() tell S3 apart from s2idle here? It only
> reports which state the "mem" label maps to:

Good catch, it's the default mode, not the target state. The target
isn't known yet when PM_SUSPEND_PREPARE is sent, and
pm_suspend_via_firmware() is only set later, in platform_suspend_begin(),
so I didn't find a better signal for the notifier. In the cases you
list the patch either probes the modem again when it didn't need to, or
behaves as before. I'll describe those limits in the changelog and
correct the suspend-to-idle sentence.

> Should ipc_imem_cleanup() call hrtimer_cancel(&ipc_imem->adb_timer) along
> with the other timers before this path runs on every S3?

Yes, thanks for spotting it. v2 adds a patch for that ahead of this
one. I could only build-test it, since the XMM7360 doesn't use UL
aggregation.

pw-bot: cr