Open Source Telephony
 help / color / mirror / Atom feed
From: Tony Espy <espy@canonical.com>
To: ofono@ofono.org
Subject: Re: [PATCH] plugins/ril.c: avoid create a gril each time enable ril modem
Date: Tue, 12 Jan 2016 14:48:28 -0500	[thread overview]
Message-ID: <5695588C.3020009@canonical.com> (raw)
In-Reply-To: <1452569999-15593-1-git-send-email-caiwen.zhang@intel.com>

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

On 01/11/2016 10:39 PM, caiwen.zhang(a)intel.com wrote:
> From: Caiwen Zhang <caiwen.zhang@intel.com>
>
> ---
>   plugins/ril.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/plugins/ril.c b/plugins/ril.c
> index ea50d76..688a5bf 100644
> --- a/plugins/ril.c
> +++ b/plugins/ril.c
> @@ -400,9 +400,13 @@ static gboolean connect_rild(gpointer user_data)
>   int ril_enable(struct ofono_modem *modem)
>   {
>   	int ret;
> +  struct ril_data *rd = ofono_modem_get_data(modem);
>
>   	DBG("");
>
> +	if (rd->ril)
> +		return 0;
> +
>   	ret = create_gril(modem);
>   	if (ret < 0)
>   		g_timeout_add_seconds(RILD_CONNECT_RETRY_TIME_S,
>

Caiwen --

Thanks for the patch! It looks you are catching a valid error scenario, 
however although your fix avoids duplicate gril instances from being
created, the correct fix involves cleaning up the gril instance in 
ril_disable(), in addition to calling ril_send_power(rd, FALSE, ...).

This scenario is something we never actually exercised on Ubuntu Touch, 
as we always power the modem on boot, and only power it off when the 
system shuts down.

Regards,
/tony



      reply	other threads:[~2016-01-12 19:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-12  3:39 [PATCH] plugins/ril.c: avoid create a gril each time enable ril modem caiwen.zhang
2016-01-12 19:48 ` Tony Espy [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=5695588C.3020009@canonical.com \
    --to=espy@canonical.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox