Open Source Telephony
 help / color / mirror / Atom feed
From: richard.rojfors@gmail.com
To: ofono@ofono.org
Subject: [PATCH v2 3/3] Revert "gprs: _cid_activated is an 'attaching' state"
Date: Tue, 20 Aug 2019 17:56:52 +0200	[thread overview]
Message-ID: <20190820155652.8598-3-richard.rojfors@gmail.com> (raw)
In-Reply-To: <20190820155652.8598-1-richard.rojfors@gmail.com>

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

From: Richard Röjfors <richard@puffinpack.se>

This reverts commit 1fd419e5b4b3a87673f8e0219edb0f3ed9fca774.

Since gprs_attached_update now guarantees that we
will not get attached without having a context activated
in LTE, this is not needed anymore. It also potentially
interferes in case the driver was actually attaching.
---
 src/gprs.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/src/gprs.c b/src/gprs.c
index bd9b3680..de172979 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -913,7 +913,6 @@ static void pri_read_settings_callback(const struct ofono_error *error,
 {
 	struct pri_context *pri_ctx = data;
 	struct ofono_gprs_context *gc = pri_ctx->context_driver;
-	struct ofono_gprs *gprs = pri_ctx->gprs;
 	DBusConnection *conn = ofono_dbus_get_connection();
 	dbus_bool_t value;
 
@@ -938,18 +937,11 @@ static void pri_read_settings_callback(const struct ofono_error *error,
 
 	value = pri_ctx->active;
 
-	gprs->flags &= ~GPRS_FLAG_ATTACHING;
-
-	gprs_set_attached_property(gprs, TRUE);
+	gprs_set_attached_property(pri_ctx->gprs, TRUE);
 
 	ofono_dbus_signal_property_changed(conn, pri_ctx->path,
 					OFONO_CONNECTION_CONTEXT_INTERFACE,
 					"Active", DBUS_TYPE_BOOLEAN, &value);
-
-	if (gprs->flags & GPRS_FLAG_RECHECK) {
-		gprs->flags &= ~GPRS_FLAG_RECHECK;
-		gprs_netreg_update(gprs);
-	}
 }
 
 static DBusMessage *pri_set_apn(struct pri_context *ctx, DBusConnection *conn,
@@ -2038,14 +2030,6 @@ void ofono_gprs_cid_activated(struct ofono_gprs  *gprs, unsigned int cid,
 					DBUS_TYPE_STRING, &apn);
 	}
 
-	/* Prevent ofono_gprs_status_notify from changing the 'attached'
-	 * state until after the context has been set to 'active' in
-	 * the pri_read_settings_callback; this prevents a race where
-	 * the connection manager sees the modem as attached before there
-	 * is an active context.
-	 */
-	gprs->flags |= GPRS_FLAG_ATTACHING;
-
 	gc->driver->read_settings(gc, cid, pri_read_settings_callback, pri_ctx);
 }
 
-- 
2.20.1


  parent reply	other threads:[~2019-08-20 15:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 15:56 [PATCH v2 1/3] gprs: Check for LTE in gprs_attached_update richard.rojfors
2019-08-20 15:56 ` [PATCH v2 2/3] Revert "gprs: set driver_attached when activating automatic contexts" richard.rojfors
2019-08-20 15:56 ` richard.rojfors [this message]
2019-08-21  6:01   ` [PATCH v2 3/3] Revert "gprs: _cid_activated is an 'attaching' state" Jonas Bonn
2019-08-21 15:55     ` Richard =?unknown-8bit?q?R=C3=B6jfors?=
2019-08-21 18:30     ` 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=20190820155652.8598-3-richard.rojfors@gmail.com \
    --to=richard.rojfors@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox