rild/ofono have really high % cpu once 3g is turned off

Bug #1204644 reported by Dave Morley on 2013-07-24
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
touch-preview-images
Fix Released
Critical
Tony Espy

Bug Description

From a virgin install of 20130724 if I enable 3g and then disable it the rild/ofono cpu usage is in the 20-30% each.

Steps:
1 Connect a Maguro device to a pc
2 Open a terminal
3 Run phablet-flash --pending --wipe
4 Run adb root && adb shell
5 Run top (screenshot1)
6 On the phone open NM indicator and enable 3g
7 On the phone open the webbrowser ensure 3g is working
8 On the computer Run top with 3g enabled (screenshot2)
9 Disable the 3g on the phone
10 On the computer Run top (screenshot3)

Root Cause:

This is caused by a tight loop between ofono and RILD. I made an incorrect assumption that our NM/ofono code would deactivate the data context when mobile data is disabled. In reality it actually sets the 'Powered' property of org.ofono.ConnectionManager to 'false'.

So when the core ofono code calls the gprs_driver set_attached function with attached=0, it merely results in a REQUEST_DATA_REGISTRATION_STATUS which returns active, when the desired state was inactive ( hence the loop ). Since the core is expecting GPRS to be detached, it calls the set_attached function again... hence the tight loop. This is similar to the recent problem with mobile data roaming which was recently fixed.

Related branches

Dave Morley (davmor2) wrote :
Dave Morley (davmor2) wrote :
Dave Morley (davmor2) wrote :
affects: indicator-server → ofono
Dave Morley (davmor2) on 2013-07-24
affects: ofono → touch-preview-images
Changed in touch-preview-images:
assignee: nobody → Tony Espy (awe)
description: updated
Tony Espy (awe) wrote :

So it seems there's definitely some funny business happening on maguro.

I've discovered that while the Wi-Fi toggles do indeed seem to trigger NM actions, and persist after reboots, NM doesn't correctly report the properties.

If you run the following dbus-send command after disabling one or both network types, the values of the associated properties are not shown as disabled.

dbus-send --system --print-reply --dest=org.freedesktop.NetworkManager /org/free
desktop/NetworkManager org.freedesktop.DBus.Properties.GetAll string:"org.freede
sktop.NetworkManager"

method return sender=:1.22 -> dest=:1.39 reply_serial=2
   array [
      dict entry(
         string "NetworkingEnabled"
         variant boolean true
      )
      dict entry(
         string "WirelessEnabled"
         variant boolean true
      )
      dict entry(
         string "WirelessHardwareEnabled"
         variant boolean true
      )
      dict entry(
         string "WwanEnabled"
         variant boolean true
      )
      dict entry(
         string "WwanHardwareEnabled"
         variant boolean true
      )

This only seems to happen on maguro. The same scenario on Mako seems to work.

Tony Espy (awe) wrote :

Also note that on my Maguro, I'm never actually able to get an active mobile data connection, as GPRS for some reason is not auto-connecting.

Dave Morley (davmor2) wrote :

This morning while my phone was in the high cpu usage state my Mom sent me an sms to say she was visiting I didn't get the text message but found out that I had missed it when she arrived and showed me the sent message.

I'm wondering if the disable gprs in NM indicator is actually switching off all data on modem, this would probable make ofono/rild think you were too far away from a tower so search for a new one (this is just an assumption not gospel)

Tony Espy (awe) on 2013-07-25
Changed in touch-preview-images:
status: New → Confirmed
importance: Undecided → Critical
Tony Espy (awe) on 2013-07-25
description: updated
Tony Espy (awe) wrote :

I have an initial fix for the problem, however it still requires a second change to rilmodem's gprs-context to deactivate all active contexts when GPRS is detached. I should have some ready for wider testing by mid-day tomorrow.

Tony Espy (awe) wrote :

Also according to Michael Frey, this bug occurs on mako, which is believable after inspecting the code.

summary: - Maguro: rild/ofono have really high % cpu once 3g is turned off
+ rild/ofono have really high % cpu once 3g is turned off
Tony Espy (awe) on 2013-07-29
Changed in touch-preview-images:
status: Confirmed → Fix Committed
Tony Espy (awe) on 2013-07-29
Changed in touch-preview-images:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers