Skip to content

Commit a5d016f

Browse files
commodolynxis
authored andcommitted
net: uqmi: fix blocking in endless loops when unplugging device
If you unplug a QMI device, the /dev/cdc-wdmX device disappears but uqmi will continue to poll it endlessly. Then, when you plug it back, you have 2 uqmi processes, and that's bad, because 2 processes talking QMI to the same device [and the same time] doesn't seem to work well. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
1 parent f8595a5 commit a5d016f

File tree

1 file changed

+2
-0
lines changed
  • package/network/utils/uqmi/files/lib/netifd/proto

1 file changed

+2
-0
lines changed

package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ proto_qmi_setup() {
6565
[ -n "$delay" ] && sleep "$delay"
6666

6767
while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do
68+
[ -e "$device" ] || return 1
6869
sleep 1;
6970
done
7071

@@ -102,6 +103,7 @@ proto_qmi_setup() {
102103

103104
echo "Waiting for network registration"
104105
while uqmi -s -d "$device" --get-serving-system | grep '"searching"' > /dev/null; do
106+
[ -e "$device" ] || return 1
105107
sleep 5;
106108
done
107109

0 commit comments

Comments
 (0)