All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Matyukevich <geomatsi@gmail.com>
To: ofono@ofono.org
Subject: [RFC PATCH 4/4] plugins: gemalto: fix incomplete at-chat shutdown
Date: Sun, 16 Aug 2020 00:43:58 +0300	[thread overview]
Message-ID: <20200815214358.69100-5-geomatsi@gmail.com> (raw)
In-Reply-To: <20200815214358.69100-1-geomatsi@gmail.com>

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

Function gemalto_modem_ready attempts to restart AT chat data->app
after  incomplete shutdown. As a result, new AT chat does not work
as expected loosing AT commands.

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
---
 plugins/gemalto.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/plugins/gemalto.c b/plugins/gemalto.c
index 238c7cc4..321c8c1b 100644
--- a/plugins/gemalto.c
+++ b/plugins/gemalto.c
@@ -222,6 +222,8 @@ static void sim_state_cb(gboolean present, gpointer user_data)
 	struct ofono_modem *modem = user_data;
 	struct gemalto_data *data = ofono_modem_get_data(modem);
 
+	DBG("");
+
 	at_util_sim_state_query_free(data->sim_state_query);
 	data->sim_state_query = NULL;
 
@@ -241,6 +243,8 @@ static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
 	struct ofono_modem *modem = user_data;
 	struct gemalto_data *data = ofono_modem_get_data(modem);
 
+	DBG("");
+
 	if (!ok) {
 		g_at_chat_unref(data->app);
 		data->app = NULL;
@@ -451,6 +455,8 @@ static void gemalto_modem_ready(GAtResult *result, gpointer user_data)
 	data->modem_ready_id = 0;
 	data->trial_cmd_id = 0;
 
+	g_at_chat_cancel_all(data->app);
+	g_at_chat_unregister_all(data->app);
 	g_at_chat_unref(data->app);
 
 	data->app = open_device(app);
@@ -466,6 +472,8 @@ static void gemalto_at_cb(gboolean ok, GAtResult *result, gpointer user_data)
 	struct ofono_modem *modem = user_data;
 	struct gemalto_data *data = ofono_modem_get_data(modem);
 
+	DBG("");
+
 	g_at_chat_unregister(data->app, data->modem_ready_id);
 	data->modem_ready_id = 0;
 
-- 
2.28.0

  parent reply	other threads:[~2020-08-15 21:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-15 21:43 [RFC PATCH 0/4] gemalto: USB ethernet data path for ELS81x Sergey Matyukevich
2020-08-15 21:43 ` [RFC PATCH 1/4] drivers: gemalto: add gprs-context driver Sergey Matyukevich
2020-08-17 19:23   ` Denis Kenzior
2020-08-15 21:43 ` [RFC PATCH 2/4] plugins: udevng: detect gemalto network interfaces Sergey Matyukevich
2020-08-15 21:43 ` [RFC PATCH 3/4] plugins: gemalto: add optional gprs-context driver Sergey Matyukevich
2020-08-15 21:43 ` Sergey Matyukevich [this message]
2020-08-17 16:56   ` [RFC PATCH 4/4] plugins: gemalto: fix incomplete at-chat shutdown Sergey Matyukevich
2020-08-17 19:54   ` Denis Kenzior
2020-08-17 20:22     ` Sergey Matyukevich
2020-08-18  9:06     ` Martin =?unknown-8bit?q?Hundeb=C3=B8ll?=
2020-08-18 14:33       ` 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=20200815214358.69100-5-geomatsi@gmail.com \
    --to=geomatsi@gmail.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 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.