aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Gerhold <stephan@gerhold.net>2022-03-23 17:54:08 +0100
committerStephan Gerhold <stephan@gerhold.net>2022-03-23 20:39:14 +0100
commit8d95c82f9c2d558148aec74cfcaf17e3941d806c (patch)
tree4b0ed347139e8e34b3da876600ed0d6a09760898
parent8ab31cf0e60b7fef7acc8790c034687b4c229459 (diff)
shared-qmi: ignore slot status indications until initial status is known
Recent ModemManager versions no longer work on the Samsung A5 (Qualcomm MSM8916) smartphone: MM ends up in an infinite loop trying to probe the modem over and over again. Looking at the debug log it seems to be related to a "Slot Status" indication that comes in during probe time and causes MM to restart the probing process: [/dev/wwan0qmi0] Sent generic request (translated)... << QMUX: service = "uim" << QMI: message = "Register Events" (0x002E) << TLV: translated = physical-slot-status [/dev/wwan0qmi0] Received generic indication (translated)... << QMUX: service = "uim" << QMI: message = "Slot Status" (0x0048) << TLV: translated = { [0] = '[ physical_card_status = 'present', ... [/dev/wwan0qmi0] Received generic response (translated)... << QMUX: service = "uim" << QMI: message = "Register Events" (0x002E) << TLV: translated = SUCCESS [modem42] registered for slot status indications [/dev/wwan0qmi0] Sent generic request (translated)... << QMUX: service = "uim" << QMI: message = "Get Slot Status" (0x0047) [modem42] received slot status indication [modem42] An active slot had a status change, will reprobe the modem <infinite loop> The "Slot Status" indication (uim_slot_status_indication_cb) arrives immediately after starting to listen for the event, which is before ModemManager has actually loaded the initial slot status in uim_get_slot_status_ready. In this situation !slot_array_status_equal() will always cause the modem to reprobe, even though it is not necessary during the probe phase. To fix this add a simple check to uim_slot_status_indication_cb() that ignores the indication if the initial slot status was not loaded yet.
-rw-r--r--src/mm-shared-qmi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mm-shared-qmi.c b/src/mm-shared-qmi.c
index 0326735b..83ebcc6c 100644
--- a/src/mm-shared-qmi.c
+++ b/src/mm-shared-qmi.c
@@ -3795,6 +3795,11 @@ uim_slot_status_indication_cb (QmiClientUim *client,
priv = get_private (self);
mm_obj_dbg (self, "received slot status indication");
+ if (!priv->slots_status) {
+ mm_obj_dbg (self, "initial slot status is not loaded yet");
+ return;
+ }
+
if (!qmi_indication_uim_slot_status_output_get_physical_slot_status (output,
&new_slots_status,
&error)) {