Fix OpenRC boot hang in msm-modem-uim-selection, USB gadget UDC race/unbind, and SIM2 lock sync
This commit is contained in:
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user