mtk_t7xx: resume after power loss reported as success, modem stays dead
Subsystems (2)
Hi,
After system suspend the t7xx module on this machine can lose power and not come back. The PCI core notices, but mtk_t7xx reports the resume as successful and keeps its ports registered. Userspace is left with a modem that exists and rejects every write, and only a reboot recovers it.
I have seen this on 4 of at least 13 s2idle cycles, on Fedora's 7.2.5 to 7.2.15. Line numbers are from current mainline.
Machine: LENOVO 21RMCTO1WW (ThinkPad X13 Gen 6), AMD
Module: Rolling Wireless RW350R-GL, 14c3:4d75 (2099:3552)
Firmware: 81601.0000.00.29.25.05_DT
BIOS: R32ET20W (1.03), and R32ET28W (1.11) for the latest one
From 7.2.15 on BIOS 1.11, on the first standby after the BIOS update:
PM: suspend entry (s2idle)
mtk_t7xx 0000:c3:00.0: Unable to change power state from D3hot to D0,
device inaccessible
PM: suspend exit
mtk_t7xx 0000:c3:00.0: Write error on MBIM port, -19
The driver logs nothing else about it. Config space then reads all ff (on 7.2.8 it still did seven minutes later), while /dev/wwan0mbim0 and /dev/wwan0at0 stay present. Runtime PM is not involved: power/control is "on" and power/runtime_suspended_time reads 0.
The root port 00:02.5 sees nothing either: SltSta shows PresDet-, and LnkSta shows DLActive- and Train-, with 2.5GT/s x16 on a port that is x1. So the link is down and the port is not training.
The ACPI power code for this slot (\_SB.PCI0.GPP7, P0WW) is identical in both BIOS versions.
From the code, not traced:
1. __t7xx_pci_pm_resume() reads T7XX_PCIE_PM_RESUME_STATE at t7xx_pci.c:586. From an absent device that gives 0xffffffff, which matches none of the PM_RESUME_REG_STATE_* values.
2. It reaches the else-if at t7xx_pci.c:632, sends FSM_CMD_STOP and returns 0.
3. t7xx_port_send_skb() returns -ENODEV for MD_STATE_STOPPED (t7xx_port_proxy.c:345), which is the -19 above.
4. t7xx_port_wwan_md_state_notify() ignores every state except MD_STATE_READY, so the WWAN ports stay registered.
The next system suspend is then refused. On 7.2.5 two attempts each hung for about 37 s until t7xx_pci_pm_suspend() returned -110, and systemd-sleep gave up, leaving the machine awake.
Checking pci_device_is_present(), or for an all-ones read, before acting on prev_state would make the failure visible. The L3 branch handles power loss but needs the device back on the bus first. What should the driver do here: fail the resume, or remove the WWAN ports so userspace notices?
This looks separate from Tim JH Chen's series "fix DPMAIF data path vs system PM suspend", but I have adjusted CC in case it overlaps.
Thanks,
Andreas
Signature · 9 lines
foundata GmbH Steinhäuserstr. 20 76135 Karlsruhe Web: https://foundata.com Sitz der Gesellschaft: Karlsruhe Registergericht: Amtsgericht Mannheim, HRB 714807 Geschäftsführung: Andreas Haerter USt-IdNr.: DE284122682