ofono read_contexts code needs some re-work

Bug #1440917 reported by Tony Espy on 2015-04-06
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
High
Tony Espy
network-manager (Ubuntu RTM)
High
Tony Espy

Bug Description

This bug is bring reported as of network-manager version 0.9.10.0-4ubuntu13 ( latest in vivid at bug filing time ).

The code in src/devices/wwan/nm-modem-ofono.c needs some optimization.

Currently, the function ofono_read_contexts() is triggered when the modem becoming enabled, which happens when the three private boolean flags modem_online, gprs_powered, and gprs_attached are all TRUE, or when a new context is detected via a 'ContextAdded' signal sent by ofono's ConnectionManager interface.

This function in turn, synchronously reads ( with a 2s timeout ) the ConnectionManager's 'SubscriberIdentity' property ( aka 'IMSI' ), and then calls the DBus method com.canonical.NMOfono.ReadImsiContexts, which triggers the ofono plugin to re-read the contexts directly from ofono's gprs settings file ( found in /var/lib/ofono/<IMSI>/ ).

This could be optimized by instead having NM read the IMSI whenever the ConnectionManager's 'Powered' property is set, caching the value, and watching for changes to the 'SubscriberIdentity'.

Also it's curious that the contexts aren't re-read when a 'ContextRemoved' signal is received.

Related branches

Tony Espy (awe) on 2015-06-09
Changed in network-manager (Ubuntu):
assignee: nobody → Tony Espy (awe)
importance: Undecided → High
Tony Espy (awe) on 2015-07-17
Changed in network-manager (Ubuntu):
status: New → In Progress
Changed in network-manager (Ubuntu RTM):
assignee: nobody → Tony Espy (awe)
importance: Undecided → High
Tony Espy (awe) wrote :

This change was released to the vivid stable overlay PPA for touch as version:

0.9.10.0-4ubuntu15.1.3

..as such marked as FixReleased for Ubuntu RTM task.

Changed in network-manager (Ubuntu RTM):
status: New → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package network-manager - 0.9.10.0-4ubuntu19

---------------
network-manager (0.9.10.0-4ubuntu19) wily; urgency=medium

  [ Tony Espy ]
  * debian/patches/add_ofono_settings_support.patch: remove code
    that added APN, USERNAME and PASSWORD to NM_SETTING_GSM object.
    NM doesn't actually need access to these settings, and USERNAME/
    PASSWORD can cause issues with NM's secrets needed logic.
  * debian/patches/0001-wwan-add-support-for-using-oFono-as-a-modem-manager.patch,
    debian/patches/lp1461593-add-nm-settings-connection-reset-retries-methods.patch,
    debian/patches/add_ofono_settings_support.patch,
    debian/patches/lp1461593-add-modem-reconnect-delay-to-policy.patch: More changes
    to NMModemOfono's modem_state handling. Added get/set_reset_retries_timeout
    methods to NMSettingsConnection, and use the set method to lower the timeout for
    ofono connections to 30s. Finally added a 5s delay to NM_POLICY's activation
    logic triggered when a modem device is disconnected. This allows modem time to
    settle and NM to process the resulting DBus state changes. (LP: #1461593)
  * debian/patches/0001-wwan-add-support-for-using-oFono-as-a-modem-manager.patch,
    debian/patches/lp1445080-modify-device-modem-avail.patch,
    debian/patches/lp1445080-nm-modem-check-for-set-mm-enabled-func.patch,
    debian/patches/lp1461593-add-modem-reconnect-delay-to-policy.patch: These
    changes collectively fix flight-mode on arale ( and other devices ), due to
    some fundemental race conditions in the ofono logic. (LP: #1445080, #1440917)
  * debian/patches/0001-wwan-add-support-for-using-oFono-as-a-modem-manager.patch,
    debian/patches/add_ofono_settings_support.patch: Add support for the ofono
    gprs-context 'Preferred' property. (LP: #1361864)

  [ Mathieu Trudel-Lapierre ]
  * d/p/0002-wifi-cull-the-scan-list-before-signalling-ScanDone-b.patch:
    Re-add schedule_scan() call after we get the ScanDone signal from the
    supplicant. Otherwise we'd do one scan on startup and never scan again.
    (LP: #1445134)

 -- Mathieu Trudel-Lapierre <email address hidden> Wed, 05 Aug 2015 12:17:28 -0400

Changed in network-manager (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers