[PATCH] sim hot swap: improved error management

Tim Small tim at seoss.co.uk
Tue Jul 25 11:04:30 UTC 2017


On 25/07/17 10:24, Carlo Lobrano wrote:
> this is  the patch to improve SIM hot swap error management in both AT
> and MBIM based modems :)
> 
> The patch for GE910-QUAD is in thread  "[PATCH] telit-plugin: ignore QSS
> when SIM-ME interface is locked"

Sorry for the misunderstanding - with that applied the modem doesn't get
locked up during init, thanks!

I suppose there is a bit of a race in the code, because:

First the current SIM insertion state is checked (with AT#QSS?), and
stored, and afterwards unsolicited notifications are enabled "AT#QSS=1".

If a SIM eject happens between the two, then the SIM removed event
wouldn't be caught, and the internal stored state would be incorrect -
the fix would be to issue and parse the AT#QSS? command after the
AT#QSS=1 command.  This could also serve to verify that the modem did
enable hot swap notifiation.  In practise this is highly unlikely, but
just thought I'd mention it.

More importantly, after SIM hot swap is set up, an 'ATZ' command is
issued which resets the modem to power on state and so turns off sim hot
swap notification.

41.395075] (ttyUSB0): --> 'AT+CESQ=?<CR>'
41.414255] (ttyUSB0): <-- '<CR>'
41.414400] (ttyUSB0): <-- '<LF>'
41.414426] (ttyUSB0): <-- 'E'
41.414514] (ttyUSB0): <-- 'R'
41.414582] (ttyUSB0): <-- 'R'
41.414665] (ttyUSB0): <-- 'O'
41.414765] (ttyUSB0): <-- 'R'
41.414787] Got failure code 100: Unknown error
41.414808] Extended signal support check failed: 'Unknown error'
41.414824] Couldn't initialize interface: 'Extended Signal information
not supported'
41.414959] (ttyUSB0) device open count is 1 (close)
41.414984] (ttyUSB0): <-- '<CR><LF>'
41.415004] Couldn't initialize interface: 'OMA not supported'
41.415052] Couldn't initialize interface: 'Firmware interface not available'
41.415076] Creating ports context for SIM hot swap
41.415089] (ttyUSB0) device open count is 2 (open)
41.415161] Modem: state changed (unknown -> disabled)
41.415210] modem properly initialized
41.415543] [device /sys/devices/pci0000:00/0000:00:14.0/usb1/1-9]
exported modem at path '/org/freedesktop/ModemManager1/Modem/0'
41.415573] [device /sys/devices/pci0000:00/0000:00:14.0/usb1/1-9]
plugin:  Telit
41.415585] [device /sys/devices/pci0000:00/0000:00:14.0/usb1/1-9]
vid:pid: 0x067B:0x2303
41.415599] (ttyUSB0) device open count is 1 (close)
41.420844] Modem /org/freedesktop/ModemManager1/Modem/0: state changed
(disabled -> enabling)
41.421031] (ttyUSB0) device open count is 2 (open)
41.421053] Flashing primary AT port before enabling...
41.421300] (ttyUSB0): port attributes not fully set
41.442758] Simple connect started...
41.442816]    PIN: unspecified
41.442831]    Operator ID: unspecified
41.442843]    Allowed roaming: yes
41.442854]    APN: internetm2m.air.com
41.442866]    IP family: ipv4
41.442888]    Allowed authentication: unspecified
41.675882]    User: unspecified
41.675927]    Password: unspecified
41.675949]    Number: *99#
41.675961] Simple connect state (4/8): Wait to get fully enabled
41.676218] Running modem initialization sequence...
41.676251] (ttyUSB0) device open count is 3 (open)
41.676299] (ttyUSB0): --> 'ATZ<CR>'
41.691085] (ttyUSB0): <-- '<CR>'
41.691257] (ttyUSB0): <-- '<LF>'
41.691383] (ttyUSB0): <-- 'OK<CR>'
41.691424] (ttyUSB0): <-- '<LF>'
41.691464] Giving some time to settle the modem...
41.691481] (ttyUSB0) device open count is 2 (close)


Tim.

-- 
South East Open Source Solutions Limited
Registered in England and Wales with company number 06134732.
Registered Office: 2 Powell Gardens, Redhill, Surrey, RH1 1TQ
VAT number: 900 6633 53  http://seoss.co.uk/ +44-(0)1273-808309


More information about the ModemManager-devel mailing list