Fix OpenRC boot hang in msm-modem-uim-selection, USB gadget UDC race/unbind, and SIM2 lock sync

This commit is contained in:
Luxferre
2026-10-25 12:32:46 +02:00
parent 33d3d225c1
commit b7c57aab2f
11 changed files with 1733 additions and 58 deletions
+13 -4
View File
@@ -387,11 +387,20 @@ ModemStatusData queryModemAndSimStatus() {
}
// Sync ModemManager lock info into active slot if QMI didn't report retries
int actIdx = (d.primaryGwSlot >= 1 && d.primaryGwSlot <= 2)
? (d.primaryGwSlot - 1)
: (d.preferredSlot - 1);
int actIdx = -1;
if (d.primaryGwSlot >= 1 && d.primaryGwSlot <= 2 &&
d.slots[d.primaryGwSlot - 1].state == "present") {
actIdx = d.primaryGwSlot - 1;
} else if (d.slots[1].state == "present" && d.slots[0].state != "present") {
actIdx = 1;
} else if (d.slots[0].state == "present" && d.slots[1].state != "present") {
actIdx = 0;
} else if (!d.qmiAvailable) {
actIdx = std::clamp(d.preferredSlot, 1, 2) - 1;
}
if (actIdx >= 0 && actIdx < 2) {
if (d.mmUnlockRequired == "sim-pin" && d.slots[actIdx].pin1State == "not-initialized") {
if (d.mmUnlockRequired == "sim-pin" &&
d.slots[actIdx].pin1State == "not-initialized") {
d.slots[actIdx].state = "present";
d.slots[actIdx].pin1State = "enabled-not-verified";
} else if (d.mmUnlockRequired == "sim-puk") {