write(9, "A", 1) = -1 EAGAIN

Dan Williams dcbw at redhat.com
Wed Sep 23 14:41:13 PDT 2015


On Wed, 2015-09-23 at 22:51 +0200, Jean-Christian de Rivaz wrote:
> Hello,
> 
> I use ModemManager 1.4.0 from Debian Jessie armhf on an embedded system 
> with a u-blox SARA-U270 modem over USB and the generic MM driver. 
> Sometimes MM fail to make the modem connected to the Internet because it 
> always get this:
> 
> write(9, "A", 1) = -1 EAGAIN (Resource temporarily unavailable)
> 
> Searching more on the system, I found the observations below:
> 
> 1) This happens always when the modem try to connect. The registration 
> is not affected so far.
> 
> 2) If it pass the connected state, the modem is not affected so far.
> 
> 3) A tshark using usbmon show that the kernel don't send the expected 
> "A" char to the modem CDC.
> 
> 4) The same tshark show that the modem still report +CIEV messages on 
> the same CDC.
> 
> 5) Others CDC of the modem are still working well.
> 
> 6) A restart of the ModemManager is enough to recover from this situation.
> 
> 7) MM code have a kind of protection against this EAGIN in the form of 
> eagain_count:
> http://cgit.freedesktop.org/ModemManager/ModemManager/tree/src/mm-port-serial.c#n593

MM allows about 3 seconds of EAGAIN:

http://cgit.freedesktop.org/ModemManager/ModemManager/tree/src/mm-port-serial.c#n187

does the modem return this status code for more than 3 seconds?  Maybe
we need to bump that value up.  We may also need a custom plugin for
your ublox device if it has specific needs for the serial port for flow
control and the like.  That's quite variable for actual serial modems
(eg, ones that aren't necessarily USB connected), and MM has logic to
allow plugins to handle port characteristics.

Dan

> 8) I have not yet understand what MM will do when eagain_count expire, 
> but pragmatically this don't seem as effective as a restart of MM.
> 
> I don't know yet if the problem is in the modem, in the kernel, or in 
> MM. For a while I suspected a control flow problem, either with the 
> modem disabling CTS on the CDC or with a XOFF char send by the modem, 
> but this would not explain why the message from the modem are on the USB 
> and not reported to the application.
> 
> Any hint would be greatly appreciate,
> 
> Best Regards,
> 
> Jean-Christian de Rivaz
> 
> _______________________________________________
> ModemManager-devel mailing list
> ModemManager-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel




More information about the ModemManager-devel mailing list