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

> 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 instead of ICCID, which is
> surprisingly odd. Retrying after 1s, it replies "+CRSM: 110,0,"".
> Retrying one more time after 1s, it finally replies the expected ICCID
> value.
> I can see two issues here: (1) +CPIN: READY doesn't necessarily
> guarantee the SIM is ready, (2) it may not be reliable to determine if
> we should retry a SIM operation based on the modem response (the modem
> could just be flaky or give bogus replies). There is a chance that if
> we address (1), (2) may not be an issue anymore.

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 implementation of that step, as that would affect every modem
out there, but maybe it's not a bad idea after all... a 3s timeout after
PIN unlock could solve most of the issues; or not.

Regarding (2), not sure what to do with that. Maybe that specific modem
requires a longer time to settle down after sim unlock; so a longer wait
time needed? This specific case is hard to handle, as the modem does not
tell 'sim not ready' errors or the like that we can detect and act upon.

Why don't you add the N second timeout after sim unlock and see how it
behaves? Check for other plugins already doing it.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]