From: Jonas Bonn <jonas@southpole.se>
To: ofono@ofono.org
Subject: Re: [PATCH 1/1] he910: set modem unpowered after IO disconnect
Date: Wed, 07 May 2014 08:29:41 +0200 [thread overview]
Message-ID: <5369D2D5.20705@southpole.se> (raw)
In-Reply-To: <5368E5DC.1040409@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2249 bytes --]
Hi Denis,
On 05/06/2014 03:38 PM, Denis Kenzior wrote:
> Hi Jonas,
>
> On 05/02/2014 09:15 AM, Jonas Bonn wrote:
>> This patch address an issue with SIM hotplug. If the SIM card is removed
>> while there is an active connection then the io_disconnect function
>> of gatchat.c pulls the rug out from under us by cleaning up the modem
>> chat that we hold a reference to.
>
> So what actually happens when the SIM is pulled? This seems to imply
> that the modem port at least sends a HUP and is no longer usable. Is
> the control port also HUPed?
The control port is still usable so it doesn't appear that it HUP's.
>
>>
>> This patch addresses this by hooking into the notification from
>> io_disconnect and setting the modem to 'unpowered' state in order to force
>> a reinitialization when the SIM is reinserted.
>>
>> The modem is not actually powered off as that would turn off SIM detection
>> as well.
>
> Are you able to at least turn off radio circuits, e.g. via CFUN=4?
As the control port is usable, I presume so. Setting CFUN=4 kills power
to the SIM, though, so we wouldn't be able to detect SIM reinsertion if
we did this (though I don't think that's what you're asking for).
>
>>
>> With this patch, SIM hotplug works reliably.
>
> When the modem is turned off, the application really has no idea why it
> was turned off (whether due to an administrative action or due to SIM
> being removed). So the proposed patch is not a good implementation of
> 'SIM hotplug'. One should implement this via
> ofono_sim_inserted_notify(). Any reason why this can't be done?
I'm not sure that's sufficient...
When the modem port HUP's, io_disconnect is called which results in
modem->chat being cleaned up; not unref'd, either, but forcibly free'd.
Somehow we need to be able to recreate this data structure, but since
it's created in the modem's init function it won't be unless we "power
down" the modem (or something along those lines).
Suggestions for a better way forward welcome...
/Jonas
>
> Regards,
> -Denis
> _______________________________________________
> ofono mailing list
> ofono(a)ofono.org
> https://lists.ofono.org/mailman/listinfo/ofono
>
next prev parent reply other threads:[~2014-05-07 6:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-02 14:15 [PATCH 1/1] he910: set modem unpowered after IO disconnect Jonas Bonn
2014-05-06 13:38 ` Denis Kenzior
2014-05-07 6:29 ` Jonas Bonn [this message]
2014-05-07 16:03 ` Denis Kenzior
2014-05-07 12:14 ` [PATCH v2 1/1] he910: reset modem " Jonas Bonn
2014-05-07 16:28 ` Denis Kenzior
2014-05-08 6:41 ` Jonas Bonn
2014-05-08 14:06 ` Denis Kenzior
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=5369D2D5.20705@southpole.se \
--to=jonas@southpole.se \
--cc=ofono@ofono.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.