Quectel em12-g: Random unexpected USB disconnections - connections on Linux

Hello,

We are having Unexpected USB disconnections - connections on Linux with the LTE modem EM12-G under Debian 11 Linux distribution.
Sometimes it does not disconnect but when the modem starts to disconnect from USB, it can happen up to 30 times per hour.
Other times the USB disconnects and reconnects when we try to stablish a connection:

root@icu-net1:~# mbimcli -d /dev/cdc-wdm0 --query-pin-state 
[/dev/cdc-wdm0] PIN info:
           PIN state: 'locked'
            PIN type: 'pin2'
  Remaining attempts: '3'
root@icu-net1:~# mbimcli -d /dev/cdc-wdm0 --enter-pin=0000
Nov 03 12:52:33 icu-net1.dc1 kernel: usb 2-4: USB disconnect, device number 72
Nov 03 12:52:33 icu-net1.dc1 kernel: option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
Nov 03 12:52:33 icu-net1.dc1 kernel: option 2-4:1.0: device disconnected
Nov 03 12:52:33 icu-net1.dc1 kernel: option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
Nov 03 12:52:33 icu-net1.dc1 kernel: option 2-4:1.1: device disconnected
Nov 03 12:52:33 icu-net1.dc1 kernel: option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
Nov 03 12:52:33 icu-net1.dc1 kernel: option 2-4:1.2: device disconnected
Nov 03 12:52:33 icu-net1.dc1 kernel: option1 ttyUSB3: GSM modem (1-port) converter now disconnected from ttyUSB3
Nov 03 12:52:33 icu-net1.dc1 kernel: option 2-4:1.3: device disconnected
Nov 03 12:52:33 icu-net1.dc1 kernel: cdc_mbim 2-4:1.8 wwan0: unregister 'cdc_mbim' usb-0000:00:14.0-4, CDC MBIM
Nov 03 12:52:34 icu-net1.dc1 kernel: usb 2-4: new SuperSpeed Gen 1 USB device number 73 using xhci_hcd
Nov 03 12:52:34 icu-net1.dc1 kernel: usb 2-4: config 1 has an invalid interface number: 8 but max is 5
Nov 03 12:52:34 icu-net1.dc1 kernel: usb 2-4: config 1 has an invalid interface number: 9 but max is 5
Nov 03 12:52:34 icu-net1.dc1 kernel: usb 2-4: config 1 has an invalid interface number: 9 but max is 5
Nov 03 12:52:34 icu-net1.dc1 kernel: usb 2-4: config 1 has no interface number 4
Nov 03 12:52:34 icu-net1.dc1 kernel: usb 2-4: config 1 has no interface number 5
Nov 03 12:52:34 icu-net1.dc1 kernel: usb 2-4: New USB device found, idVendor=2c7c, idProduct=0512, bcdDevice= 3.18
Nov 03 12:52:34 icu-net1.dc1 kernel: usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Nov 03 12:52:34 icu-net1.dc1 kernel: usb 2-4: Product: EM12-G
Nov 03 12:52:34 icu-net1.dc1 kernel: usb 2-4: Manufacturer: Quectel
Nov 03 12:52:34 icu-net1.dc1 kernel: usb 2-4: SerialNumber: 0123456789ABCDEF
Nov 03 12:52:34 icu-net1.dc1 kernel: option 2-4:1.0: GSM modem (1-port) converter detected
Nov 03 12:52:34 icu-net1.dc1 kernel: usb 2-4: GSM modem (1-port) converter now attached to ttyUSB0
Nov 03 12:52:34 icu-net1.dc1 kernel: option 2-4:1.1: GSM modem (1-port) converter detected
Nov 03 12:52:34 icu-net1.dc1 kernel: usb 2-4: GSM modem (1-port) converter now attached to ttyUSB1
Nov 03 12:52:34 icu-net1.dc1 kernel: option 2-4:1.2: GSM modem (1-port) converter detected
Nov 03 12:52:34 icu-net1.dc1 kernel: usb 2-4: GSM modem (1-port) converter now attached to ttyUSB2
Nov 03 12:52:34 icu-net1.dc1 kernel: option 2-4:1.3: GSM modem (1-port) converter detected
Nov 03 12:52:34 icu-net1.dc1 kernel: usb 2-4: GSM modem (1-port) converter now attached to ttyUSB3
Nov 03 12:52:34 icu-net1.dc1 kernel: cdc_mbim 2-4:1.8: cdc-wdm0: USB WDM device
Nov 03 12:52:34 icu-net1.dc1 kernel: cdc_mbim 2-4:1.8 wwan0: register 'cdc_mbim' at usb-0000:00:14.0-4, CDC MBIM, 12:92:c7:c4:f0:3f
error: operation failed: Transaction timed out

The firmware of the modem we are using is: EM12GPAR01A21M4G
The Linux kernel we are using is: 5.10.0-22-amd64
Could it be a firmware version error?
Can anyone help me?
Thank you.

Hi @mikel.garcia
May I ask if you’re using a Quectel driver? If not, I have sent you the Quectel driver, you can find the corresponding kernel version of the driver.