modem: workaround ofono crash

Since commit bfd0b2310c, the IMSI is
retreived from ofono. To get the IMSI, the modme must be powered ON
previously. The imsi() method is called before calling connect() in
order to set up the IMSI in the HLR. As a result, the following
behaviour occurs:
- Powered=true (in imsi())
- SimManager.GetProperties() (several of them)
- Powered=false (power_cycle() in connect()

It seems powering off the modem immediately after using the SIM service
makes ofono crash. Proof of it is that crashes were seen mainly on tests
using only 1 MS, in which we don't spend that much time between
SimManager.GetProperties() and Powered=false for the same modem.

Let's workaround the crash for now increasing the time between using the
SIM services and powering the modem off.

Related: OS#3064

Change-Id: Ief052cac5a862d6ef9391d40c294ba017387506c
This commit is contained in:
Pau Espin 2018-03-14 19:19:28 +01:00
parent 7ad177f396
commit f8d12196f0
1 changed files with 1 additions and 0 deletions

View File

@ -577,6 +577,7 @@ class Modem(log.Origin):
req_ifaces = self._required_ifaces()
if self.is_powered():
self.dbg('Power cycling')
event_loop.sleep(self, 1.0) # workaround for ofono bug OS#3064
self.power_off()
else:
self.dbg('Powering on')