Closed Bug 1084023 Opened 10 years ago Closed 10 years ago

SIM randomly gets permanently stuck in "unknown" state, survives reboots

Categories

(Firefox OS Graveyard :: RIL, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.2 S2 (19dec)

People

(Reporter: khuey, Assigned: edgar)

References

Details

Attachments

(5 files, 1 obsolete file)

This has happened to me twice in the last two weeks.  I get the SIM card stuck in an "unknown" state, at which point I can't make phone calls or send SMSs.  Rebooting the device has no effect.  My data connection still works though.

When this happens, if I do a full flash and restore profile data from before this happened everything works again.  If I do a full flash and restore profile data from after it happens it is still broken.  And if I restore known good profile data after it happens without doing a full flash it is still broken.
Flags: needinfo?(htsai)
This is git diff --stat good bad run on the git repository that has my b2g profile stored in it.
Discussed with teams but cannot thinking of anything obviously suspicious. Do you think you are able to provide us log with ril messages? https://wiki.mozilla.org/B2G/QA/Tips_And_Tricks#RIL_Debugging
Attachment #8507186 - Attachment mime type: text/x-log → text/plain
Flags: needinfo?(htsai)
Did you find anything in the log?  This happened to me again tonight, and it's super annoying.
Flags: needinfo?(htsai)
I found some interesting things in your log, the timing of some messages is suspicious, but I still can not figure out what is the root cause of 'unknown' state. 

Would you mind help to provide the normal log for us to compare (device boots up log)? And have you tried to switch airplane mode on/off when it happens?

Thank you.

ni? me for tracking.
Flags: needinfo?(htsai) → needinfo?(echen)
(In reply to Edgar Chen [:edgar][:echen] from comment #5)
> Would you mind help to provide the normal log for us to compare (device
> boots up log)? And have you tried to switch airplane mode on/off when it
> happens?

Airplane mode doesn't help, and neither does rebooting the device.  The only way to fix it is to reflash from scratch.

I narrowed the "broken" part of the profile down to the settings database.  I can provide a copy of that if it would be helpful.
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #8)
> (In reply to Edgar Chen [:edgar][:echen] from comment #5)
> > Would you mind help to provide the normal log for us to compare (device
> > boots up log)? And have you tried to switch airplane mode on/off when it
> > happens?
> 
> Airplane mode doesn't help, and neither does rebooting the device.  The only
> way to fix it is to reflash from scratch.
> 
> I narrowed the "broken" part of the profile down to the settings database. 
> I can provide a copy of that if it would be helpful.

Having more information is always helpful. :)
Thank you, Kyle.
Rg
Attachment #8509723 - Attachment mime type: text/x-log → text/plain
Flags: needinfo?(echen)
Attachment #8509722 - Attachment mime type: text/x-log → text/plain
Comment on attachment 8509723 [details]
bad-ril.log

Ah, somehow device switches to cdma mode, so unable to recognize a gsm card.

> I/Gecko   (  185): RIL Worker: [0] Handling parcel as REQUEST_VOICE_RADIO_TECH
> I/Gecko   (  185): RIL Worker: [0] Radio tech is set to: is95a, it is a cdma technology

Device reports card state as 'unknown'.

> I/Gecko   (  185): -*- RadioInterface[0]: Received message from worker: {"rilMessageType":"cardstatechange","cardState":0,"rilMessageClientId":0}
> I/Gecko   (  185): -*- RILContentHelper: Received message 'RIL:CardStateChanged': {"clientId":0,"data":{"rilMessageType":"cardstatechange","cardState":0,"rilMessageClientId":0}}
Any progress?
Flags: needinfo?(echen)
Somehow device is initialized in cdma mode.
And then sends an unsolicited event switching to gsm mode.
(This unsolicited event is usually used for world phone)

But moz ril doesn't support dynamical switching phone mode yet [2].

> I/Gecko   (  185): RIL Worker: [0] Handling parcel as REQUEST_VOICE_RADIO_TECH
> I/Gecko   (  185): RIL Worker: [0] Radio tech is set to: is95a, it is a cdma technology
> 
> I/Gecko   (  185): RIL Worker: [0] Unsolicited response for request type 1035
> I/Gecko   (  185): RIL Worker: Parcel handler didn't consume whole parcel, 8 bytes left over

Probably because the preferred network type is set to `lte/wcdma/gsm/cdma/evdo`? But in good-ril.log, device has the same configuration and it works good. Have no idea why.

> I/Gecko   (  185): RIL Worker: [0] Received chrome message {"type":"lte/wcdma/gsm/cdma/evdo","rilMessageClientId":0,"rilMessageToken":10,"rilMessageType":"setPreferredNetworkType"}

Could you try to set system property, `ro.moz.ril.0.network_types`, to `gsm,wcdma,lte` to see if it helps? 
This can hide the cdma options in Gaia (you probably still need to clear settings database).

Thank you.

[1] https://github.com/mozilla-b2g/platform_hardware_ril/blob/master/include/telephony/ril.h#L3801-L3811
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=866038
Flags: needinfo?(echen)
So I didn't make any of the changes from comment 12 yet, but I also haven't seen this in several weeks.  Will update if I see it again.
This happened again with the network set to just LTE in the Gaia::Settings.  Next time it happens I will try setting the system property.
Messing with the network types manually doesn't seem to help.

I've gone back to Android for the time being.
Is there anything else we can do here? It sucks to be losing dogfooders =( I was also considering switching to using a nexus5, so this is super painful to see.
Flags: needinfo?(htsai)
Flags: needinfo?(echen)
Hmm, looks like restricting network types doesn't help too much here. Let me provide a quick patch for supporting RIL_UNSOL_VOICE_RADIO_TECH_CHANGED to see if it fixes this annoying issue. Keeps ni? to me for tracking.
Flags: needinfo?(htsai)
(In reply to Kevin Grandon :kgrandon (In Europe/Conf until 11/24) from comment #16)
> Is there anything else we can do here? 

Discussed with Edgar, we have some ideas in mind. He will first provide a proof-of-concept patch to update sim info when radio tech is somewhat switched, and see how thing goes. However, the gaia implementation of handling these update events might be a concern, not sure if we need gaia work as well, but we will see. 

> It sucks to be losing dogfooders =( I
> was also considering switching to using a nexus5, so this is super painful
> to see.

Understood. This is also painful for us to deal with different modem behaviours :( I don't want to see we lose dogfooders, and I am very thankful of you being using mozril and reporting drawbacks. But please kindly understand we have such limited bandwidth as we have to take care of the reference phone (and partner devices) first, so the progress might be relatively slow. :(
Attached patch Patch, v1 (obsolete) — Splinter Review
I verified this patch in emulator by hacking it to simulate this behaviour, it works good. But I still would like to have a test in real device.
Hi Kyle, could you help to test this patch for me to see if it fixes the issue? Thank you.

*Note that this patch is just a quick solution for supporting RIL_UNSOL_VOICE_RADIO_TECH_CHANGED in order to fix this issue, we still need a full solution for world phone (bug 866038).
Flags: needinfo?(echen) → needinfo?(khuey)
The earliest I could test this would be after Portland, and it usually requires several days of use for the issue to manifest.  If you think it is likely to fix the problem please just get it reviewed and landed.
Flags: needinfo?(khuey)
Comment on attachment 8526715 [details] [diff] [review]
Patch, v1

Hi Hsinyi, may I have your review? Thank you.
Attachment #8526715 - Flags: review?(htsai)
Comment on attachment 8526715 [details] [diff] [review]
Patch, v1

Review of attachment 8526715 [details] [diff] [review]:
-----------------------------------------------------------------

Thank you :)

::: dom/system/gonk/ril_worker.js
@@ +6972,5 @@
>    this.setRadioEnabled({enabled: false});
>  };
> +RilObject.prototype[UNSOLICITED_VOICE_RADIO_TECH_CHANGED] = function UNSOLICITED_VOICE_RADIO_TECH_CHANGED(length) {
> +  // This unsolicited response will be sent when the technology of a multi-tech
> +  // modem is changed, ex. switch between gsm and cdma. Currently the only known

The line of "Currently the only know..." doesn't look 100% right, nexus 5 is an example. Could we remove or revise this? Thank you.

@@ +6975,5 @@
> +  // This unsolicited response will be sent when the technology of a multi-tech
> +  // modem is changed, ex. switch between gsm and cdma. Currently the only known
> +  // multi-tech modem is emulator (qemu can support both gsm and cdma).
> +  // TODO: We may need to reset some data when switching between gsm and cdma
> +  //       mode, like IMEI, ESN ... etc. See Bug 866038.

With Bug 1110619, we don't need to worry about updates of IMEI, ESN, etc.

The patch fixes the accidental change, and agree that to fully support world phone case, we need  to do more on updating iccInfo and iccType.
Attachment #8526715 - Flags: review?(htsai) → review+
This is not a regression but triggered by different device behaviour.
Keywords: regression
Assignee: nobody → echen
Address review comment #22.
Attachment #8526715 - Attachment is obsolete: true
Attachment #8535525 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/776f432e007d
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S2 (19dec)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: