All of lore.kernel.org
 help / color / mirror / Atom feed
* Stuck in modem driver enable
@ 2018-10-18 10:52 Mattias =?unknown-8bit?q?M=C3=A5nsson?=
  2018-10-18 22:48 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Mattias =?unknown-8bit?q?M=C3=A5nsson?= @ 2018-10-18 10:52 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1121 bytes --]

We have implemented a driver for the Gemalto modem we are using and today I noticed that it got stuck in initialization (during enable). The problem is that the AT+CFUN=4 (which is the last step of our init) now returned a CME error. The error handling for this is inspired from all the other drivers:


static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
{
struct ofono_modem *modem = user_data;
struct verimalto_data *data = ofono_modem_get_data(modem);

if (!ok) {
g_at_chat_unref(data->app);
data->app = NULL;

g_at_chat_unref(data->mdm);
data->mdm = NULL;

ofono_modem_set_powered(modem, FALSE);
return;
}

// Get initial SIM state
data->sim_state_query = at_util_sim_state_query_new(data->app,
2, 20, sim_state_cb, modem,
NULL);
}


This will put the modem in not powered state. The problem is that as it has not completed the initialization, there is now no interfaces at all set up. So we can not try to power it again or anything else. Are all these drivers having an issue with error handling or have I missed something else? And how could I handle it better?

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 2446 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Stuck in modem driver enable
  2018-10-18 10:52 Stuck in modem driver enable Mattias =?unknown-8bit?q?M=C3=A5nsson?=
@ 2018-10-18 22:48 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2018-10-18 22:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1691 bytes --]

Hi Mattias,

On 10/18/2018 05:52 AM, Mattias Månsson wrote:
> We have implemented a driver for the Gemalto modem we are using and 
> today I noticed that it got stuck in initialization (during enable). The 
> problem is that the AT+CFUN=4 (which is the last step of our init) now 
> returned a CME error. The error handling for this is inspired from all 
> the other drivers:
> 
> 
> static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
> {
> struct ofono_modem *modem = user_data;
> struct verimalto_data *data = ofono_modem_get_data(modem);
> 
> if (!ok) {
> g_at_chat_unref(data->app);
> data->app = NULL;
> 
> g_at_chat_unref(data->mdm);
> data->mdm = NULL;
> 
> ofono_modem_set_powered(modem, FALSE);
> return;
> }
> 
> // Get initial SIM state
> data->sim_state_query = at_util_sim_state_query_new(data->app,
> 2, 20, sim_state_cb, modem,
> NULL);
> }
> 
> This will put the modem in not powered state. The problem is that as it 
> has not completed the initialization, there is now no interfaces at all 

What interfaces?  DBus interfaces?  You still have the Modem interface 
present...

> set up. So we can not try to power it again or anything else. Are all 

The above code does not actually trigger the removal of the Modem 
itself.  So that object is still present and you can still try to set 
Powered to True.  It might still fail the second time of course...

> these drivers having an issue with error handling or have I missed 
> something else? And how could I handle it better?
Not that I'm aware of.  Is there perhaps something deeper happening here 
than what you describe?

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-18 22:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-18 10:52 Stuck in modem driver enable Mattias =?unknown-8bit?q?M=C3=A5nsson?=
2018-10-18 22:48 ` Denis Kenzior

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.