* [PATCH net] net: wwan: iosm: fix S3 resume by re-binding the driver around it
@ 2026-11-16 3:11 David Westen
0 siblings, 0 replies; only message in thread
From: David Westen @ 2026-11-16 3:11 UTC (permalink / raw)
To: netdev
Cc: loic.poulain, ryazanov.s.a, johannes, andrew+netdev, davem,
edumazet, kuba, pabeni, m.chetan.kumar, linux-kernel, mail,
David Westen, stable
On platforms where S3 cuts power to the WWAN card, the modem boots
again while the system sleeps, but the driver still treats it as
running. After resume its execution stage reads BOOT, and by the
first port open the boot code has crashed into the CD_READY stage:
iosm 0000:03:00.0: PORT open refused, phase A-CD_READY
The modem then stays unusable until an ACPI reset.
Unbind the driver before S3 and bind it again after resume, as
commit 0b6f6593aa8c ("net: wwan: iosm: Fix hibernation by re-binding
the driver around it") already does for hibernation, so the modem is
probed again once it has booted. Suspend-to-idle keeps the modem
powered and is still handled by the suspend/resume callbacks. The
target state isn't known yet when the PM notifier runs, so use the
default suspend mode to tell S3 from suspend-to-idle.
Fixes: 1f52d7b62285 ("net: wwan: iosm: Enable M.2 7360 WWAN card support")
Cc: stable@vger.kernel.org
Signed-off-by: David Westen <davidlwesten@gmail.com>
---
Notes:
Tested on an XMM7360 (ThinkPad X1 Carbon 6th gen, deep sleep) with
this patch applied to 7.2.15: after resume the modem is probed again
and comes up without an ACPI reset. Not tested on the XMM7560.
The investigation and the patch were done with an AI coding assistant
(Claude Opus 5.5). It read the driver and added temporary debug logging
to record the execution stage around suspend and resume. We wrote the
change and the changelog together, and I ran the tests.
drivers/net/wwan/iosm/iosm_ipc_pcie.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wwan/iosm/iosm_ipc_pcie.c b/drivers/net/wwan/iosm/iosm_ipc_pcie.c
index 49052eb511ba..ec27d6fd7910 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_pcie.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_pcie.c
@@ -534,12 +534,17 @@ void ipc_pcie_kfree_skb(struct iosm_pcie *ipc_pcie, struct sk_buff *skb)
static int pm_notify(struct notifier_block *nb, unsigned long mode, void *_unused)
{
- if (mode == PM_HIBERNATION_PREPARE || mode == PM_RESTORE_PREPARE) {
+ /* The modem loses power in S3 and S4 and boots again on resume, which
+ * the suspend/resume callbacks can't handle, so probe it again.
+ */
+ if (mode == PM_HIBERNATION_PREPARE || mode == PM_RESTORE_PREPARE ||
+ (mode == PM_SUSPEND_PREPARE && !pm_suspend_default_s2idle())) {
if (pci_registered) {
pci_unregister_driver(&iosm_ipc_driver);
pci_registered = false;
}
- } else if (mode == PM_POST_HIBERNATION || mode == PM_POST_RESTORE) {
+ } else if (mode == PM_POST_HIBERNATION || mode == PM_POST_RESTORE ||
+ mode == PM_POST_SUSPEND) {
if (!pci_registered) {
int ret;
base-commit: aa40afa831ebfe45e40a23721711059f2ac584d4
--
2.56.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-16 3:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16 3:11 [PATCH net] net: wwan: iosm: fix S3 resume by re-binding the driver around it David Westen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®