Random input/output errors with /dev/cdc-wdm* in kernel 4.9.7

Kasper Holtze kasper at holtze.dk
Thu Feb 2 13:51:12 UTC 2017


Den 02-02-2017 kl. 13:57 skrev Bjørn Mork:
> Kasper Holtze <kasper at holtze.dk> writes:
>
>> Hello,
>>
>> After upgrading Linux from 4.4.8 to 4.9.7, I'm seeing some strange
>> issues connecting to my modems. The modem is Sierra MC7304, in QMI
>> mode.
>>
>> As it happened after upgrading the kernel, I'm not sure if it is
>> directly related to libqmi.. Could be the qmi_wwan driver?
>>
>> I see the issues with both qmicli and my custom software.
>>
>> libqmi is version 1.16.2.
>>
>> Usually it works fine when the system is first booted, or the modems
>> are reset. After a while, I'm getting i/o errors reading from
>> /dev/cdc-wdm*:
>>
>> Sometimes it just hangs, most of the times I get this message:
>>
>> Qmi-WARNING **: Error reading from istream: Error reading from file
>> descriptor: Input/output error
>>
>> I have enabled debugging in debugfs, and get this in the syslog:
>>
>> [ 5664.134111] wdm_open: qmi_wwan 1-1.3:1.8: draining queued data
>> [ 5664.134778] wdm_in_callback: qmi_wwan 1-1.3:1.8: nonzero urb status
>> received: -EPIPE
>> [ 5664.136365] wdm_int_callback: qmi_wwan 1-1.3:1.8:
>> NOTIFY_RESPONSE_AVAILABLE received: index 8 len 0
>> [ 5664.136390] wdm_int_callback: qmi_wwan 1-1.3:1.8: submit response URB 0
>> [ 5664.136903] wdm_in_callback: qmi_wwan 1-1.3:1.8: nonzero urb status
>> received: -EPIPE
>> [ 5664.137551] wdm_release: qmi_wwan 1-1.3:1.8: wdm_release: cleanup
>
> Not good.  This is a mess, and I can only admit that I have completely
> lost track of how it is supposed to work....
>
> I wonder if you are able to test a cdc-wdm/qmi-wwan driver with these
> two commits reverted one-by-one? :
>
>    c1da59dad0eb ("cdc-wdm: Clear read pipeline in case of error")
>    833415a3e781 ("cdc-wdm: fix "out-of-sync" due to missing notifications")
>     
>
> That's sort of a quick "bisect".  A full bisect would achieve the same,
> but I don't think it will provide more info.  I am pretty sure the
> problem is caused by one (or both) of those two commits which both went
> into v4.9.
>
> Let me know if you need more details on how to do this.
>
>
> Bjørn

Thank you very much, Bjørn!

I made a small test script:

-----

#!/bin/sh

while [ 1 ]; do
     qmicli -d /dev/cdc-wdm0 --dms-get-ids
     qmicli -d /dev/cdc-wdm0 --dms-uim-get-iccid
     qmicli -d /dev/cdc-wdm2 --dms-get-ids
     qmicli -d /dev/cdc-wdm2 --dms-uim-get-iccid
     sleep 1
done
---

With both patches applied:

root at imx6qsabresd:~# ./test.sh
[/dev/cdc-wdm0] UIM ICCID retrieved:
     ICCID: '8945061505200073502'
[/dev/cdc-wdm0] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853051353698'
     MEID: 'unknown'
[/dev/cdc-wdm0] UIM ICCID retrieved:
     ICCID: '8945061505200073502'
[/dev/cdc-wdm0] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853051353698'
     MEID: 'unknown'
[/dev/cdc-wdm0] UIM ICCID retrieved:
     ICCID: '8945061505200073502'
[/dev/cdc-wdm0] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853051353698'
     MEID: 'unknown'
[/dev/cdc-wdm0] UIM ICCID retrieved:
     ICCID: '8945061505200073502'
[/dev/cdc-wdm0] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853051353698'
     MEID: 'unknown'
[/dev/cdc-wdm0] UIM ICCID retrieved:
     ICCID: '8945061505200073502'
[/dev/cdc-wdm0] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853051353698'
     MEID: 'unknown'
[/dev/cdc-wdm0] UIM ICCID retrieved:
     ICCID: '8945061505200073502'
[/dev/cdc-wdm0] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853051353698'
     MEID: 'unknown'
[/dev/cdc-wdm0] UIM ICCID retrieved:
     ICCID: '8945061505200073502'
[/dev/cdc-wdm0] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853051353698'
     MEID: 'unknown'
[/dev/cdc-wdm0] UIM ICCID retrieved:
     ICCID: '8945061505200073502'
[/dev/cdc-wdm0] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853051353698'
     MEID: 'unknown'
[/dev/cdc-wdm0] UIM ICCID retrieved:
     ICCID: '8945061505200073502'
[/dev/cdc-wdm0] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853051353698'
     MEID: 'unknown'
[/dev/cdc-wdm0] UIM ICCID retrieved:
     ICCID: '8945061505200073502'
[/dev/cdc-wdm0] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853051353698'
     MEID: 'unknown'
[/dev/cdc-wdm0] UIM ICCID retrieved:
     ICCID: '8945061505200073502'
[/dev/cdc-wdm0] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853051353698'
     MEID: 'unknown'
[/dev/cdc-wdm0] UIM ICCID retrieved:
     ICCID: '8945061505200073502'
[/dev/cdc-wdm0] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853051353698'
     MEID: 'unknown'
[/dev/cdc-wdm0] UIM ICCID retrieved:
     ICCID: '8945061505200073502'
[02 Feb 2017, 13:13:38] -Warning ** Error reading from istream: Error 
reading from file descriptor: Input/output error
error: couldn't create client for the 'dms' service: CID allocation 
failed in the CTL client: Device must be open to send commands
[02 Feb 2017, 13:13:39] -Warning ** Error reading from istream: Error 
reading from file descriptor: Input/output error
error: couldn't create client for the 'dms' service: CID allocation 
failed in the CTL client: Device must be open to send commands
[02 Feb 2017, 13:13:39] -Warning ** Error reading from istream: Error 
reading from file descriptor: Input/output error
error: couldn't create client for the 'dms' service: CID allocation 
failed in the CTL client: Device must be open to send commands
[02 Feb 2017, 13:13:40] -Warning ** Error reading from istream: Error 
reading from file descriptor: Input/output error
error: couldn't create client for the 'dms' service: CID allocation 
failed in the CTL client: Device must be open to send commands
[02 Feb 2017, 13:13:40] -Warning ** Error reading from istream: Error 
reading from file descriptor: Input/output error
error: couldn't create client for the 'dms' service: CID allocation 
failed in the CTL client: Device must be open to send commands
[02 Feb 2017, 13:13:41] -Warning ** Error reading from istream: Error 
reading from file descriptor: Input/output error
error: couldn't create client for the 'dms' service: CID allocation 
failed in the CTL client: Device must be open to send commands
[02 Feb 2017, 13:13:42] -Warning ** Error reading from istream: Error 
reading from file descriptor: Input/output error
error: couldn't create client for the 'dms' service: CID allocation 
failed in the CTL client: Device must be open to send commands


^Ccancelling the operation...

^C^C^C^Z

-----------


After reverting  833415a3e781 ("cdc-wdm: fix "out-of-sync" due to 
missing notifications"), it seems to improve the situation - the error 
seems more recoverable:


root at imx6qsabresd:~# /data/writable/test.sh
[/dev/cdc-wdm0] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853050048117'
     MEID: 'unknown'
[/dev/cdc-wdm0] UIM ICCID retrieved:
     ICCID: '8945061505200073536'
[/dev/cdc-wdm2] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853051353698'
     MEID: 'unknown'
[/dev/cdc-wdm2] UIM ICCID retrieved:
     ICCID: '8945061505200073502'
[/dev/cdc-wdm0] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853050048117'
     MEID: 'unknown'
[/dev/cdc-wdm0] UIM ICCID retrieved:
     ICCID: '8945061505200073536'
[/dev/cdc-wdm2] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853051353698'
     MEID: 'unknown'
[/dev/cdc-wdm2] UIM ICCID retrieved:
     ICCID: '8945061505200073502'
[02 Feb 2017, 14:32:03] -Warning ** Error reading from istream: Error 
reading from file descriptor: Input/output error
error: couldn't create client for the 'dms' service: CID allocation 
failed in the CTL client: Transaction timed out
[/dev/cdc-wdm0] UIM ICCID retrieved:
     ICCID: '8945061505200073536'
[/dev/cdc-wdm2] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853051353698'
     MEID: 'unknown'
[/dev/cdc-wdm2] UIM ICCID retrieved:
     ICCID: '8945061505200073502'
[/dev/cdc-wdm0] Device IDs retrieved:
      ESN: '0'
     IMEI: '356853050048117'
     MEID: 'unknown'

....

---

After reverting  c1da59dad0eb ("cdc-wdm: Clear read pipeline in case of 
error"), the issue seems to have disappeared. I no longer get 
input/output errors or hangs.

I did not try re-applying 833415a3e781 - not sure if it makes sense to do?

I have only tested a few minutes, but it seems great so far. All in all, 
everything seems way more stable now. Will let you know if I see the 
issue again.

Thanks again!

Kasper



More information about the libqmi-devel mailing list