All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] plugins/ril.c: avoid create a gril each time enable ril modem
@ 2016-01-12  3:39 caiwen.zhang
  2016-01-12 19:48 ` Tony Espy
  0 siblings, 1 reply; 2+ messages in thread
From: caiwen.zhang @ 2016-01-12  3:39 UTC (permalink / raw)
  To: ofono

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

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,
-- 
1.9.1


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

* Re: [PATCH] plugins/ril.c: avoid create a gril each time enable ril modem
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Espy @ 2016-01-12 19:48 UTC (permalink / raw)
  To: ofono

[-- 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



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

end of thread, other threads:[~2016-01-12 19:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.