Deal with 'NotOpened' errors?
dcbw at redhat.com
Mon Feb 24 09:46:53 PST 2014
On Mon, 2014-02-24 at 18:08 +0100, Bjørn Mork wrote:
> Dan Williams <dcbw at redhat.com> writes:
> > On Mon, 2014-02-24 at 14:47 +0100, Bjørn Mork wrote:
> >> Aleksander Morgado <aleksander at aleksander.es> writes:
> >> > Just re-opening the MBIM port is not enough very
> >> > likely as we would need to re-send PIN at least... If we detect this,
> >> > we should likely mark the modem as invalid and re-start probing from
> >> > scratch, so that we keep a sane state within MM.
> >> Yes. This seems pretty straight forward for MBIM modems, where
> >> NotOpened will mean that everything must be reinitialized.
> >> But I guess similar issues will affect all types of USB attached modems.
> >> So MM should really handle "modem amnesia" regardless of modem driver.
> >> If USB power is removed and the USB core decides to apply the "persist
> >> feature", then you will see this as a modem forgetting every volatile
> >> configuration command you have sent it.
> > Perhaps the kernel provides some kind of "we're suspending now" signal
> > that MM can use to selectively invalidate modems. But I'm not sure it
> > does, as all that appears to currently be handled in userspace with
> > stuff like pm-utils, upower, or systemd. We could track the monotonic
> > timer by setting up a 2 or 3 second poll and see if it changes *more*
> > than 2 or 3 seconds, but that's a hack.
> Making MM aware of PM actions is unnecessary complicated. Dealing with
> unexpected errors instead of ignoring them should be sufficient. Or?
If there's a way that the kernel can indicate that the device *isn't* in
the same state (eg, don't do that disk hack for modems) without tying
that to PM operations, then great, we should use that instead of making
However, at some point MM might need to be come PM-aware so that it can
do things like inhibit suspend until it has cleaned up the data
connection or if an SMS is being sent at the same time as a suspend
request happens, to inhibit suspend for a short period until the SMS is
done. Stuff like that is more complicated if some external tool is
doing all the PM logic and telling MM what to do. But yes, MM should
*also* handle error recovery if the modem is suspended in the middle of
reading SMSs or stuff like that.
More information about the ModemManager-devel