Skip to content

iface-modem-3gpp: fix crash when trying to set unknown power state

Certain QMI-based USB modems will report an "unknown" power state upon boot, before our first attempt to set one:

$ sudo qmicli --dms-get-operating-mode -d /dev/cdc-wdm0 -p [/dev/cdc-wdm0] Operating mode retrieved: Mode: 'unknown' HW restricted: 'no'

Due to this, the logic trying to recover the previous power state during an attach settings update would end up asserting:

[modem3] set initial EPS bearer settings state (3/5): recover previous power state ** ERROR:../src/mm-iface-modem.c:4554:mm_iface_modem_set_power_state: code should not be reached Bail out! ERROR:../src/mm-iface-modem.c:4554:mm_iface_modem_set_power_state: code should not be reached Aborted

This is a rare case, and instead of handling it in the QMI specific implementation, we can try to fix it in a safer way directly in the logic that handles the attach settings update. If we ever detect that the reported power state is "unknown", we will default it to "on" while emitting a warning.

Merge request reports

Loading