Commit Graph
6 Commits
Author SHA1 Message Date
Rukun Mao 469c686504 sim-mbim: fix preload_cancellable bug that causes a crash
In merge request !1405, when handling subscriber_ready_status_ready()
fails, it exits early and allows preload retry without resetting
`self->priv->preload_cancellable`. When the preload_subscriber_info() runs
again, it fails at g_assert check and causes a crash.
Before !1405, `self->priv->preload_cancellable` is reset within
application_list_query_ready().

Signed-off-by: Rukun Mao <rmao@google.com>
2025-10-15 18:24:19 +00:00
Rukun Mao 9ec1d25607 sim-mbim: continue preload retry if previous attempt(s) fails
Before the change, preload is attempted once regardless of its
results. When the first attempt fails, it got stuck and can not get valid
SIM info.

Signed-off-by: Rukun Mao <rmao@google.com>
2025-10-01 15:29:58 -05:00
Rukun Mao ca4334de94 broadband-modem: exit with error if enable() is called in enabling state
We should not assert. We can error out the latest enabling attempt and let
the previous enabling gracefully reach an end.

Issue log:
"2025-06-22T21:56:52.972448Z NOTICE ModemManager[1842]: <msg> [modem2] state changed (disabled -> enabling)
...
2025-06-22T21:57:53.146572Z ERR ModemManager[1842]: <err> [modem2] port cdc-wdm0 timed out 10 consecutive times, marking modem as invalid
...
2025-06-22T21:57:53.185751Z INFO shill[870]: INFO shill: [modem_info.cc(120)] RemoveModem: /org/freedesktop/ModemManager1/Modem/2
2025-06-22T21:57:53.187595Z INFO ModemManager[1842]: <inf> [modem2] processing user request to enable modem...
"

which led to a crash:
"
0x00007c474ceb979f (libc.so.6 -pthread_kill.c:44)               ??__pthread_kill_implementation
0x00007c474ce6d92c (libc.so.6 -raise.c:26)                      ??raise
0x00007c474ce584aa (libc.so.6 -abort.c:79)                      ??abort
0x00007c474d72b269 (libglib-2.0.so.0 -gtestutils.c:3450)        ??g_assertion_message
0x00007c474d72b2e3 (libglib-2.0.so.0 -gtestutils.c:3476)        ??g_assertion_message_expr
0x00005979074b4b6a (ModemManager -mm-broadband-modem.c)         enable
0x00005979074e3b9c (ModemManager -mm-iface-modem.c:2340)        handle_enable_auth_ready
0x00007c474d591997 (libgio-2.0.so.0 -gtask.c:1309)              g_task_return_now
0x00007c474d590555 (libgio-2.0.so.0 -gtask.c:1378)              g_task_return
0x00005979074a57bd (ModemManager -mm-base-modem.c:2011)         lock_after_authorize_ready
0x00007c474d591997 (libgio-2.0.so.0 -gtask.c:1309)              g_task_return_now
0x00007c474d590555 (libgio-2.0.so.0 -gtask.c:1378)              g_task_return
0x00005979074a3fa8 (ModemManager -mm-base-modem.c:1841)         base_modem_operation_run
...
"

Signed-off-by: Rukun Mao <rmao@google.com>
2025-06-26 20:24:16 +00:00
Rukun Mao 7b878765c6 broadband-modem-mbim: reprobe modem and update SIM info after "nonInitialized" error
When the subscriber ready status notification's ready state becomes "initialized"
from "nonInitialized", it indicates a new SIM is inserted, for which a modem
reprobe is needed.
2023-10-18 21:18:50 +00:00
Rukun Mao b7433b4c14 iface-modem: new logic to detect SIM swap with explicit IMSI/ICCID query
This improves SIM hot swap check process, and it can help avoid unnecessary
modem reprobe during suspend-resume without SIM inserted.

The changes in this CL implemented the new logic ONLY for MBIM, and the
new logic has not been implemented for QMI and AT yet. Thus, we keep the
legacy `mm_iface_modem_check_for_sim_swap()' till the new logic for QMI
and AT has been implemented.
2023-10-11 14:01:33 +00:00
Rukun Mao 3da84c2079 suspend: add suspend/resume support with powerd on ChromeOS
ModemManager handles suspend and resume signals sent from powerd

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/547
2022-06-09 08:32:13 +00:00