Skip to content

Commit

Permalink
net: uqmi: fix blocking in endless loops when unplugging device
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
commodo authored and lynxis committed Oct 9, 2017
1 parent f8595a5 commit a5d016f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ proto_qmi_setup() {
[ -n "$delay" ] && sleep "$delay"

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

Expand Down Expand Up @@ -102,6 +103,7 @@ proto_qmi_setup() {

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

Expand Down

0 comments on commit a5d016f

Please sign in to comment.