Hi Holger, On 03/12/2016 09:03 AM, Holger Freyther wrote: > Hi, > > my plugin is opening the serial on _enable and on _disable it is issuing a > AT+CFUN=0 and waits for the result before discarding the atchat. > > $ ./tests/enable-modem /wavecom_0 > ... > $ lsof | grep ttyUSB0 | wc -l > 1 > > $ ./tests/disable-modem /wavecom_0 > $ lsof | grep ttyUSB0 | wc -l > 0 > > So far so good. But if I run the above in a loop.. then I see dbus timeouts and > when I execute lsof.. I see that ofonod has 1023 FDs open. So at some point in > time either the state is messed up or the AT+CFUN doesn't respond.. but we open > the same device more than once. Without seeing the modem driver code, I can't comment. The core does set a timeout whenever .set_powered() method is called. If the method does not return in that time, the core does what cleanup that it can. Refer to src/modem.c for details. However, the modem driver is still responsible for cleaning up after itself, since the core has no visibility into what resources are being used by the modem driver. > > Is this known? Does ofono start timers? Does the GAtChat have a way to timeout > commands and then disclose it? How do other modems handle such situation? > GAtChat does not timeout the individual commands. The atom drivers would have no idea what to do with commands that timeout anyway. And we have never needed this capability in practice. Your modem driver would need to handle any modem idiosyncrasies, such as the modem firmware resetting on CFUN=0 and never returning an OK. Regards, -Denis