All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: ofono@ofono.org
Subject: Re: [RFC PATCH 2/4] gprs: add automatic context settings provisioning
Date: Wed, 12 Jan 2011 08:37:56 -0800	[thread overview]
Message-ID: <1294850276.3873.95.camel@aeonflux> (raw)
In-Reply-To: <1294817213.24900.10.camel@jsaunama-desktop>

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

Hi Jukka,

> > > -void ofono_gprs_register(struct ofono_gprs *gprs)
> > > +static void ofono_gprs_finish_register(struct ofono_gprs *gprs)
> > >  {
> > >  	DBusConnection *conn = ofono_dbus_get_connection();
> > >  	struct ofono_modem *modem = __ofono_atom_get_modem(gprs->atom);
> > >  	const char *path = __ofono_atom_get_path(gprs->atom);
> > >  	struct ofono_atom *netreg_atom;
> > > -	struct ofono_atom *sim_atom;
> > > +
> > > +	if (gprs->contexts == NULL) /* Automatic provisioning failed */
> > > +		add_context(gprs, NULL, OFONO_GPRS_CONTEXT_TYPE_INTERNET);
> > 
> > so I see a potential race here between the UI trying to provision and us
> > trying to provision.
> > 
> > We don't wanna end up with duplicated contexts here. Any ideas on how we
> > could prevent that nicely? Or should we just fail any attempts to create
> > new contexts if provisioning is still ongoing?
> 
> Code continues there with:
> 	if (!g_dbus_register_interface(conn, path,
> 					OFONO_CONNECTION_MANAGER_INTERFACE,
> 					manager_methods, manager_signals, NULL,
> 					gprs, NULL)) {
> 		ofono_error("Could not create %s interface",
> 				OFONO_CONNECTION_MANAGER_INTERFACE);
> 
> 		return;
> 	}
> 
> 	ofono_modem_add_interface(modem,
> 				OFONO_CONNECTION_MANAGER_INTERFACE);
> 
> Patch rearranges the initial context creation and interface
> registration, so there is no DBUS interface for UI to use until
> provisioning is ready. Or have misunderstood something?

it could we well that I got lost in the re-arranged code ;)

If we wait with the Connection Manager interface registration until we
ran through all provision drivers, that seems fine. So no concerns from
my part then on the potential race conditions with the UI.

Regards

Marcel



  reply	other threads:[~2011-01-12 16:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-10 13:11 [RFC PATCHv3 0/4] Plugin API for provisioning of GPRS context settings Jukka Saunamaki
2011-01-10 13:11 ` [RFC PATCH 1/4] Added GPRS context provisioning driver API sources Jukka Saunamaki
2011-01-12  6:43   ` Marcel Holtmann
2011-01-12 16:43     ` Denis Kenzior
2011-01-10 13:11 ` [RFC PATCH 2/4] gprs: add automatic context settings provisioning Jukka Saunamaki
2011-01-12  6:51   ` Marcel Holtmann
2011-01-12  7:26     ` Jukka Saunamaki
2011-01-12 16:37       ` Marcel Holtmann [this message]
2011-01-10 13:11 ` [RFC PATCH 3/4] sim: add ofono_sim_get_mnc_length Jukka Saunamaki
2011-01-11  0:40   ` Marcel Holtmann
2011-01-11 15:03     ` Denis Kenzior
2011-01-10 13:11 ` [RFC PATCH 4/4] Dummy example GPRS context provisioning driver Jukka Saunamaki
2011-01-12  6:48   ` Marcel Holtmann
2011-01-12  7:41     ` Jukka Saunamaki
2011-01-12 16:46       ` Denis Kenzior
2011-01-13  6:36         ` Jukka Saunamaki
2011-01-13 15:57           ` Denis Kenzior
2011-01-14  6:53             ` Jukka Saunamaki
2011-01-14  7:47               ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont
2011-01-14 10:37               ` Marcel Holtmann
2011-01-14 10:46                 ` Jukka Saunamaki
2011-01-14 13:44                   ` Marcel Holtmann
2011-01-14 13:58                     ` Jukka Saunamaki
2011-01-14 14:10                       ` Marcel Holtmann
2011-01-14 14:42                         ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont
2011-01-15  1:30                           ` Marcel Holtmann
2011-01-17  6:20                             ` Jukka Saunamaki
2011-01-14 15:07               ` 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=1294850276.3873.95.camel@aeonflux \
    --to=marcel@holtmann.org \
    --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.