Sierra Wireless EM7345 4G LTE modem radio is not really switched on after Linux rfkill unblock event

The radio of Sierra Wireless EM7345 4G LTE modem in my ThinkPad T450s laptop is switched off after Linux rfkill block command, but it does not switches back on after rfkill unblock command. When changing software radio state of the modem with mbimcli command error is registered in kernel ring buffer:

cdc_mbim 2-4:1.0: nonzero urb status received: -EPIPE

Additional info:

#uname -a
Linux redacted 5.14.5-arch1-1 #1 SMP PREEMPT Thu, 16 Sep 2021 11:02:40 +0000 x86_64 GNU/Linux
#lsusb | grep -i sierra
Bus 002 Device 002: ID 1199:a001 Sierra Wireless, Inc. Sierra Wireless EM7345 4G LTE
#pacman -Qs libmbim
local/libmbim 1.26.0-2
    MBIM modem protocol helper library

Steps to reproduce:

# rfkill
ID TYPE DEVICE SOFT HARD
0 bluetooth tpacpi_bluetooth_sw unblocked unblocked
1 wwan tpacpi_wwan_sw unblocked unblocked
2 wlan phy0 unblocked unblocked
3 bluetooth hci0 unblocked unblocked

# mbimcli -d /dev/cdc-wdm0 -p --query-radio-state
[/dev/cdc-wdm0] Radio state retrieved:
Hardware radio state: 'on'
Software radio state: 'on'

# rfkill block wwan

# rfkill
ID TYPE DEVICE SOFT HARD
0 bluetooth tpacpi_bluetooth_sw unblocked unblocked
1 wwan tpacpi_wwan_sw blocked unblocked
2 wlan phy0 unblocked unblocked
3 bluetooth hci0 unblocked unblocked

# mbimcli -d /dev/cdc-wdm0 -p --query-radio-state
[/dev/cdc-wdm0] Radio state retrieved:
Hardware radio state: 'on'
Software radio state: 'off'

# rfkill unblock wwan

# rkfill
ID TYPE DEVICE SOFT HARD
0 bluetooth tpacpi_bluetooth_sw unblocked unblocked
1 wwan tpacpi_wwan_sw unblocked unblocked
2 wlan phy0 unblocked unblocked
3 bluetooth hci0 unblocked unblocked

# mbimcli -d /dev/cdc-wdm0 -p --query-radio-state
[/dev/cdc-wdm0] Radio state retrieved:
Hardware radio state: 'on'
Software radio state: 'off'

# mbimcli -d /dev/cdc-wdm0 -p --set-radio-state=on
[/dev/cdc-wdm0] Radio state retrieved:
Hardware radio state: 'on'
Software radio state: 'on'

# dmesg
<...>
cdc_mbim 2-4:1.0: nonzero urb status received: -EPIPE

# mbimcli -d /dev/cdc-wdm0 -p --set-radio-state=off
[/dev/cdc-wdm0] Radio state retrieved:
Hardware radio state: 'on'
Software radio state: 'off'

# dmesg
<...>
cdc_mbim 2-4:1.0: nonzero urb status received: -EPIPE
cdc_mbim 2-4:1.0: nonzero urb status received: -EPIPE

Have you tried AT command like at+cfun=1

Yes. The output is OK.
I also tried at+cfun? and got the output:

+CFUN:  1,0

OK

That did not solve the problem.

The radio has been on

All known firmwares for the EM7345 are buggy beyond repair. The best advice is probably what you get if you google “doctor it hurts when i do this”.

Of you want more details, then I wrote a much too long explanation here:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/usb/class/cdc-wdm.c?id=8fec9355a968ad240f3a2e9ad55b823cf1cc52ff

This driver workaround was added because of a similar issue with another Intel-based modem. I am pretty sure the root cause is the same. We still do now know why these firmwares believe stalling is appropriate when we try to read data immediately after the modem is enabled, I assume it’s a symptom of an unexpected error in the firmware.

The kernel log message was deliberately kept to tell you that the modem firmware is buggy. The driver tries to do its best to continue anyway, but that doesn’t mean that stuff will work. Not much more we can do about that. What we see on the host side are just symptoms. Hiding them won’t fix anything.