From 8d95c82f9c2d558148aec74cfcaf17e3941d806c Mon Sep 17 00:00:00 2001 From: Stephan Gerhold Date: Wed, 23 Mar 2022 17:54:08 +0100 Subject: 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 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. --- src/mm-shared-qmi.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mm-shared-qmi.c') 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)) { -- cgit v1.2.3-70-g09d2