Re: [MM] [PATCH] sim: retry SIM operations during initialization

2012-08-29 Thread Ben Chan
Attached is a patch which makes the after-sim-unlock step get run also when PIN request is disabled. Could you give it a try with your use case and a proper implementation of the modem_after_sim_unlock() callback? I would actually try the ZTE way (running +CPMS? retries), as IIRC you were

Re: [MM] [PATCH] sim: retry SIM operations during initialization

2012-08-29 Thread Aleksander Morgado
Attached is a patch which makes the after-sim-unlock step get run also when PIN request is disabled. Could you give it a try with your use case and a proper implementation of the modem_after_sim_unlock() callback? I would actually try the ZTE way (running +CPMS? retries), as IIRC you were

Re: [MM] [PATCH] sim: retry SIM operations during initialization

2012-08-29 Thread Ben Chan
On a related note, since ModemManager already uses AT+CRSM to read ICCID and operator name/ID, I wonder if it makes sense to AT+CRSM=176,28423,0,0,9 instead of AT+CIMI for reading IMSI, or use it as a fallback solution if AT+CIMI fails or is not supported by a modem. At least on one modem I have,

Re: [MM] [PATCH] sim: retry SIM operations during initialization

2012-08-29 Thread Aleksander Morgado
On a related note, since ModemManager already uses AT+CRSM to read ICCID and operator name/ID, I wonder if it makes sense to AT+CRSM=176,28423,0,0,9 instead of AT+CIMI for reading IMSI, or use it as a fallback solution if AT+CIMI fails or is not supported by a modem. At least on one modem

Re: [MM] [PATCH] sim: retry SIM operations during initialization

2012-08-28 Thread Aleksander Morgado
On 08/28/2012 07:09 AM, Ben Chan wrote: For (1), the 'Modem' interface has a generic 'modem_after_sim_unlock' step which allows plugin implementations to provide a method to (try to) ensure that the SIM access is valid. Some plugins may just provide a N second timeout to be run in that step. I

Re: [MM] [PATCH] sim: retry SIM operations during initialization

2012-08-28 Thread Ben Chan
Do you mean that you still need the timeout even if the PIN request is not enabled? If the code tries to load Sim properties before unlocking the PIN and those fail, they will anyway get retried after the successful PIN unlock. Yes, the issue happens on a SIM without PIN locked. One scenario

Re: [MM] [PATCH] sim: retry SIM operations during initialization

2012-08-28 Thread Aleksander Morgado
Do you mean that you still need the timeout even if the PIN request is not enabled? If the code tries to load Sim properties before unlocking the PIN and those fail, they will anyway get retried after the successful PIN unlock. Yes, the issue happens on a SIM without PIN locked. One

Re: [MM] [PATCH] sim: retry SIM operations during initialization

2012-08-28 Thread Aleksander Morgado
Hey Ben, Do you mean that you still need the timeout even if the PIN request is not enabled? If the code tries to load Sim properties before unlocking the PIN and those fail, they will anyway get retried after the successful PIN unlock. Yes, the issue happens on a SIM without PIN locked.

Re: [MM] [PATCH] sim: retry SIM operations during initialization

2012-08-27 Thread Aleksander Morgado
After the +CPIN: READY response, there is a period of time where SIM operations are not reliable on some modems. I've observed issues with reading ICCID and IMSI. The following example shows that the modem reports bogus values of ICCID. The first reply of AT+CRSM=176,12258,0,0,10 is IMSI

Re: [MM] [PATCH] sim: retry SIM operations during initialization

2012-08-27 Thread Ben Chan
For (1), the 'Modem' interface has a generic 'modem_after_sim_unlock' step which allows plugin implementations to provide a method to (try to) ensure that the SIM access is valid. Some plugins may just provide a N second timeout to be run in that step. I didn't want to provide a generic

Re: [MM] [PATCH] sim: retry SIM operations during initialization

2012-08-25 Thread Ben Chan
On Fri, Aug 24, 2012 at 8:21 AM, Ben Chan benc...@chromium.org wrote: On Thu, Aug 23, 2012 at 11:51 PM, Aleksander Morgado aleksan...@lanedo.com wrote: The timeout + retries really tries to address flaky SIM operations on some modems. We could limit the retries to certain error codes, but

Re: [MM] [PATCH] sim: retry SIM operations during initialization

2012-08-24 Thread Aleksander Morgado
The timeout + retries really tries to address flaky SIM operations on some modems. We could limit the retries to certain error codes, but that won't address flakiness, unfortunately :( We could let individual plugins to configure whether it should retry on failed SIM operations. For a

Re: [MM] [PATCH] sim: retry SIM operations during initialization

2012-08-23 Thread Aleksander Morgado
On 08/22/2012 07:28 AM, Ben Chan wrote: This patch modifies the MMSim interface to validate the IMSI value reported by AT+CIMI and retry the command upon an error. It also modifies other SIM operations during the interface initialization to retry upon an error. I'm a bit worried about the

Re: [MM] [PATCH] sim: retry SIM operations during initialization

2012-08-23 Thread Ben Chan
The timeout + retries really tries to address flaky SIM operations on some modems. We could limit the retries to certain error codes, but that won't address flakiness, unfortunately :( We could let individual plugins to configure whether it should retry on failed SIM operations. For a modem that

[MM] [PATCH] sim: retry SIM operations during initialization

2012-08-21 Thread Ben Chan
This patch modifies the MMSim interface to validate the IMSI value reported by AT+CIMI and retry the command upon an error. It also modifies other SIM operations during the interface initialization to retry upon an error. --- src/mm-sim.c | 124