[openwrt/openwrt] qmi: increase SIM power-cycle timeouts

LEDE Commits lede-commits at lists.infradead.org
Sun Jun 8 12:04:52 PDT 2025


hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/fd85c0df78804adafa1e6b21f25c131fc89bac0b

commit fd85c0df78804adafa1e6b21f25c131fc89bac0b
Author: Antti Seppälä <a.seppala at gmail.com>
AuthorDate: Sat May 10 13:54:56 2025 +0300

    qmi: increase SIM power-cycle timeouts
    
    Some modems and SIM cards take a bit longer to initialize after UIM has been
    powered off. Waiting too little time can cause the qmi protocol to end up
    in a loop repeatedly power-cycling the SIM card.
    
    Avoid that by
     a) increasing the time we unconditionally sleep after --uim-power-on
     b) increasing the time we allow uqmi to wait for response for --uim-get-sim-state
    
    Signed-off-by: Antti Seppälä <a.seppala at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/18772
    (cherry picked from commit d63663601de4feb2b7a049c9b0901f10e79496cb)
    Signed-off-by: Felix Baumann <felix.bau at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/18965
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
index b08b225104..a6a3fdaa69 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -107,7 +107,7 @@ proto_qmi_setup() {
 	# Check if UIM application is stuck in illegal state
 	local uim_state_timeout=0
 	while true; do
-		json_load "$(uqmi -s -d "$device" -t 1000 --uim-get-sim-state)"
+		json_load "$(uqmi -s -d "$device" -t 2000 --uim-get-sim-state)"
 		json_get_var card_application_state card_application_state
 
 		# SIM card is either completely absent or state is labeled as illegal
@@ -122,7 +122,7 @@ proto_qmi_setup() {
 
 			if [ "$uim_state_timeout" -lt "$timeout" ] || [ "$timeout" = "0" ]; then
 				let uim_state_timeout++
-				sleep 1
+				sleep 5
 				continue
 			fi
 




More information about the lede-commits mailing list