OpenWrt: unexpected disconnect requiring manual restart of ModemManager

Bjørn Mork bjorn at mork.no
Sun Apr 26 10:40:32 UTC 2020


Aleksander Morgado <aleksander at aleksander.es> writes:

> Anyway, as you also said, having lost the AT port may indicate other
> kinds of internal problems, so attempting to trigger a reset ourselves
> wouldn't be that bad in this case? I'm open to suggestions on how to
> best handle this. Until now ModemManager hasn't done too many control
> things "by itself", but I understand this may be one of those things
> that could be automatically handled. It wouldn't be a bad idea to
> start using a configuration file that would allow disabling these
> smarts if needed.

For the record:  I believe the current design where ModemManager takes
few actions by itself, and just provides the framwork for e.g
NetworkManager, is a very good one.

So, yes, I have some problems putting my finger exactly on what I
believe is wrong here. Sorry about all the self contradictions while I
try to figure out where i really want to go ;-)

Maybe the "declare modem as invalid" is an action which should be
delegated to some upper layer, if we are sticking to that design?  You
don't leave much choice to the ModemManager "user", as in the
application controlling MM, when you just delete the modem like that.
MM knows the modem wasn't disconnected from the USB bus, so it cannot
expect any hotplug events in this situation.  How should the controlling
application realise that it is supposed to do something? And what can it
do?  Restart MM? On what trigger?

I guess this leads to either
1) don't delete devices unless told to by e.g OS or managing
   application, or
2) delete *and* take the responsibility for rediscovery of
   the deleted device

I am fine with deletion on fatal error if we can trust there will an
automatic rediscovery attempt. This might obviously fail in cases where
a modem really did silently die without disconnecting from the bus.  But
we should give rediscovery at least one chance.

I don't have a strong opinion whether this rediscovery action should be
handled by MM directly, or by the application using MM.  But I do
believe both delete and rediscovery must be initiated by same entity,
since both actions are parts of the same decision.


Bjørn


More information about the ModemManager-devel mailing list