($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: Lyubimov Maxim <m.lyubimov@aqsi.ru>, ofono@lists.linux.dev
Subject: Re: Modem: Add Reboot and SwitchOff methods
Date: Tue, 31 Oct 2023 10:42:46 -0500	[thread overview]
Message-ID: <d68602a8-c3ca-48db-96a5-fc72fc0ce403@gmail.com> (raw)
In-Reply-To: <2e5311edd0a8f307352b925466f0778041b7a707.camel@aqsi.ru>

Hi Maxim,

>> Note that Shutdown should already be covered by Modem.Powered =
>> False.  Drivers
>> are free to implement this in a way they best see fit.  See for
>> example the
>> really old calypso.c driver for the Neo Freerunner.  It writes to the
>> GPIO port
>> to physically shut down the modem.
> 
> There are several problems. On different devices, the on or off signal
> can be implemented differently, so it is difficult to take this into
> account in the driver. Some devices may not have hardware turn-on
> signals at all, therefore, after turning off the AT modem with a

Yes, I'm aware.  Which is why some drivers leave the modem in a 'low power' 
state.  It isn't ideal, but life almost never is.

> command, it will be impossible to turn it on. I think that using the
> Modem.Powered property the modem should be both turned on and off. If
> the driver cannot turn on the modem after turning it off, then it
> should, for example, not turn it off, but put it into a mode with
> minimal functionality, from which it can then be released after issuing

Right.

> a turn-on command. And using the SwitchOff method, you can simply turn
> off the modem without the ability to turn it on when it is definitely
> no longer needed, for example, before turning off the device.

Okay, I think I understand the use case now.  My opinion is that this gets 
really into the low level platform details.  For example, are you sure you 
wouldn't want to shut down oFono before sending the magic command to make the 
modem disappear?  Why have oFono running at that point?

Another question would be the modem detection method.  Right now serial modems 
are essentially static.  They're detected at oFono startup and that's pretty 
much it.  If you send this shutdown command to the modem and the modem shuts 
down, the Modem object still exists, but becomes completely non-functional.  You 
could forcefully remove it from oFono via ofono_modem_remove, but what if oFono 
is restarted?  The serial device would be re-discovered.

And then there are some nasty details to consider as well.  For example, when 
.disable() is called, the driver is assumed to relinquish control over any 
devices associated with the modem.  If you maintain these devices in the open 
state for Shutdown / Reset purposes it might break some applications which 
assume the device can now be accessed.  This might be a problem for devices 
where explicit control over the device is required (QMI, non-multiplexed modems, 
etc).  But this may not be that much of a worry for the use case you have in mind...

I'm not sure oFono is the right place for something like this, but I don't feel 
strongly either way.  If you think you can make this work and can come up with 
some sort of proposal, please go ahead.

Regards,
-Denis

      reply	other threads:[~2023-10-31 15:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30  7:30 Modem: Add Reboot and SwitchOff methods Lyubimov Maxim
2023-10-30 14:34 ` Denis Kenzior
2023-10-31  5:13   ` Lyubimov Maxim
2023-10-31 15:42     ` Denis Kenzior [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d68602a8-c3ca-48db-96a5-fc72fc0ce403@gmail.com \
    --to=denkenz@gmail.com \
    --cc=m.lyubimov@aqsi.ru \
    --cc=ofono@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).