Commit Graph
3358 Commits
Author SHA1 Message Date
Aleksander Morgado 089faef88c modem-helpers: support reporting 'terminated' call state in +CLCC 2019-10-14 15:45:18 +02:00
Aleksander Morgado d5d0ed0b24 tests: print MM logs only on verbose test mode
Therefore, avoid needing ENABLE_TEST_MESSAGE_TRACES build symbol.
2019-10-14 15:30:27 +02:00
Aleksander Morgado 03223fe786 tests,sms: print PDUs only on verbose test mode
Therefore, avoid needing TEST_SMS_PART_ENABLE_TRACE build symbol.
2019-10-14 15:30:03 +02:00
Aleksander Morgado 3b18d21ba5 tests: avoid g_print() and use g_debug() instead
The debug-level logs won't be printed e.g. during 'make check', but
will be included when running the tester manually.
2019-10-14 15:30:03 +02:00
Aleksander Morgado cc4e7f6cfd shared-qmi: fix NAS SSP support check during supported caps loading 2019-10-14 12:44:47 +02:00
Eric Caruso 33140e1fc3 mm-broadband-modem-mbim: fix incorrect log message
The log message would display a value based on combining the
notification flags with a CID, which doesn't make sense. Test
against the flag for this notification instead.
2019-10-12 04:23:26 +00:00
Aleksander Morgado 1277ebb4cc iface-modem: allow plugins to disable access technology polling
Same as with the signal quality polling, we may want to disable
explicitly the access technology polling if we can rely on plugin
specific URCs for this purpose.
2019-10-11 09:24:22 +00:00
Aleksander Morgado 45a238bca3 iface-modem: allow disabling signal quality polling during runtime
E.g. if we have a specific command to enable the signal quality URCs,
we should only disable polling if the command is supported by the
specific modem and the command succeeds. If unsupported or fails, we
shouldn't disable the polling.
2019-10-11 09:24:22 +00:00
Aleksander Morgado 765f26a40e iface-modem: don't log error if it's in progress
If we're loading signal quality or access technology, skip reporting
any error message if the specific error received is 'in-progress'.

Plugins will use this error when they cannot process the response to
the operation, e.g. if it was already consumed by a URC handler.
2019-10-11 09:24:22 +00:00
Aleksander Morgado c98a1a9dc8 simtech: disable CMER/CIND support explicitly
The logic to setup the generic +CIND indications in the SIM7600E seems
to end up breaking connectivity when in TTY+PPP mode. If we issue the
AT+CMER=3,0,0,1 command, this will end up in the modem not replying a
correct CONNECT response to the ATD command.

Let's disable these +CIND indications completely in the simtech
plugin, as there is even no AT command reference saying those are
supported.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/144
2019-10-11 09:24:22 +00:00
Aleksander Morgado feb6c8264a broadband-modem: allow disabling +CIND URC setup
Not all modems support correctly +CIND URCs and +CMER settings.
2019-10-11 09:24:22 +00:00
Aleksander Morgado 803c770551 broadband-modem-qmi: fix when >1 PRI images for the same modem image 2019-10-11 08:16:04 +00:00
Aleksander Morgado 6977b41adb broadband-modem-qmi: prefer ASCII unique IDs
If the manufacturer uses QMI unique IDs in ASCII, use the same format
in our APIs, instead of blindly converting them to a 16-byte HEX
string.

This makes user operations much nicer, e.g. instead of:

    $ sudo mmcli -m 0 --firmware-list
      ----------------
      Firmware | list: 02.20.03.00_GENERIC
               |        current: yes
               |        gobi pri unique id: 3030322E3031375F3030300000000000
               |        gobi modem unique id: 3F5F3F00000000000000000000000000
               |       02.14.03.02_SPRINT
               |        current: no
               |        gobi pri unique id: 3030322E3031325F3030310000000000
               |        gobi modem unique id: 3F5F3F00000000000000000000000000
               |       02.20.03.22_VERIZON
               |        current: no
               |        gobi pri unique id: 3030322E3032365F3030300000000000
               |        gobi modem unique id: 3F5F3F00000000000000000000000000
               |       02.14.03.00_VODAFONE
               |        current: no
               |        gobi pri unique id: 3030302E3030385F3030300000000000
               |        gobi modem unique id: 3F5F3F00000000000000000000000000

We will have:

    $ sudo mmcli -m 1 --firmware-list
      ----------------
      Firmware | list: 02.20.03.00_GENERIC
               |        current: no
               |        gobi pri unique id: 002.017_000
               |        gobi modem unique id: ?_?
               |       02.14.03.02_SPRINT
               |        current: no
               |        gobi pri unique id: 002.012_001
               |        gobi modem unique id: ?_?
               |       02.20.03.22_VERIZON
               |        current: yes
               |        gobi pri unique id: 002.026_000
               |        gobi modem unique id: ?_?
               |       02.14.03.00_VODAFONE
               |        current: no
               |        gobi pri unique id: 000.008_000
               |        gobi modem unique id: ?_?
2019-10-11 08:16:04 +00:00
Aleksander Morgado a55543d11e broadband-modem-qmi: fix listing images when 'Get Stored Image Info' is unsupported 2019-10-11 08:16:04 +00:00
Aleksander Morgado 1b29f7524c broadband-modem-qmi: move pri/modem pair list building to separate method 2019-10-11 08:16:04 +00:00
Aleksander Morgado 7986b2737d broadband-modem-qmi: move pri/modem list index lookup to separate method 2019-10-11 08:16:04 +00:00
Aleksander Morgado 5b8da2e1b9 broadband-modem-qmi: add note about index_of_running_image known issue
Since 02.20.xx.xx, the 'index_of_running_image' reported for MODEM
images is wrong.

https://forum.sierrawireless.com/t/mc74xx-wrong-running-image-in-qmi-get-stored-images/8998
2019-10-11 08:16:04 +00:00
Aleksander Morgado 66192288f9 broadband-modem-qmi: fix minor typo in comment 2019-10-11 08:16:04 +00:00
Aleksander Morgado 3f15293a0b daemon: register G_IO_ERROR_CANCELLED as "Cancelled" in DBus
We have deprecated the use of MM_CORE_ERROR_CANCELLED inside the
daemon in favor of using G_IO_ERROR_CANCELLED right away, and so, we
will now register G_IO_ERROR_CANCELLED as the error mapped to the
"Cancelled" error in the ModemManager error domain in DBus.

We therefore avoid sending unknown/unmapped errors via DBus, as in
this case:

    $ sudo ./test.sh
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    error: couldn't connect the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Cancelled: Connection attempt cancelled'
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    error: couldn't connect the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Cancelled: Connection attempt cancelled'
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
2019-10-11 07:27:59 +00:00
Aleksander Morgado cf0d3f36fd iface-modem: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado 651bfd62b4 port-serial: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado fa453a17a5 iface-modem-voice: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado cff3be23c0 broadband-modem: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado 7974933de8 broadband-modem-mbim: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado c0e1bde03e base-modem-at: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado 6de9c8cb29 base-bearer: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado 15b8156061 iface-modem-simple: fix Simple.Disconnect() when bearer path given
The Simple.Disconnect() method handler was totally broken when a
specific bearer path was given, because the user-provided bearer path
was never being stored in the DisconnectionContext struct...

This is an extremely bad error, but it also gives us an indication
that no one is really using this method to disconnect one single
bearer, mainly because we also have the Bearer.Disconnect() method,
which makes more sense. mmcli didn't even allow passing a bearer path
to --simple-disconnect.
2019-10-09 12:23:33 +02:00
Aleksander Morgado 1cd24a3106 iface-modem-firmware: use the explicit Firmware policy
The Firmware policy is always 'auth_admin'.
2019-09-25 13:08:32 +02:00
Aleksander Morgado 7a7b3aa5cb polkit,time: protect GetNetworkTime() with a new 'Time' policy rule 2019-09-25 13:08:32 +02:00
Aleksander Morgado 79a3965684 broadband-modem: shutdown firmware interface on dispose() 2019-09-23 18:15:29 +02:00
amol.lad 16145c29de sms-part-3gpp: SMS timestamp in ISO8601 format 2019-09-22 09:15:51 +02:00
Eric Caruso 59e82b3f32 mm-plugin: fix inverted condition in port grabbing
If QMI support was not compiled in, then every net port that wasn't
a QMI port would be force-ignored unless it had the qmi_wwan driver.
Instead, we want to ignore ports with only the qmi_wwan driver.
2019-09-17 15:08:03 -07:00
Aleksander Morgado a9797f44ae base-bearer: debug log only when ignoring disconnection from CGACT?
There are modems out there (e.g. SIM7600E) where we connect a given
CID >1 but once connected, only CID=1 is reported as connected, and
not the one we explicitly attempted to connect. In this situation the
modem is connected successfully, and we're properly ignoring the
disconnection report detected from CGACT? responses, but we're
probably better logging this situation only in debug level, not as
info, because this check is done periodically every 5s...

    <debug> [1568649020.333263] (ttyUSB5): --> 'AT+CGDCONT=7,"IP","inet.es"<CR>'
    <debug> [1568649020.383517] (ttyUSB5): <-- '<CR><LF>OK<CR><LF>'
    <debug> [1568649020.383617] (ttyUSB5) device open count is 3 (open)
    <debug> [1568649020.383655] Connection through a plain serial AT port (ttyUSB5)
    <debug> [1568649020.383683] (ttyUSB5) device open count is 4 (open)
    <debug> [1568649020.383802] (ttyUSB5) device open count is 3 (close)
    <debug> [1568649020.383873] (ttyUSB5): --> 'ATD*99***7#<CR>'
    <debug> [1568649020.405767] (ttyUSB5): <-- '<CR><LF>CONNECT 115200<CR><LF>'
    <debug> [1568649020.405853] [ttyUSB5] Setting flow control: rts-cts
    <debug> [1568649020.405878] (ttyUSB5): enabling RTS/CTS flow control
    <debug> [1568649020.405897] (ttyUSB5): port attributes not fully set
    <debug> [1568649020.405910] (ttyUSB5): flow control settings updated to rts-cts
    <debug> [1568649020.405940] (ttyUSB5): port now connected
    <debug> [1568649020.405983] Connected bearer '/org/freedesktop/ModemManager1/Bearer/0'
    <debug> [1568649020.406081] PPP is required for connection, will ignore disconnection reports
    <info>  [1568649020.406155] Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connecting -> connected)
    <info>  [1568649020.406361] Simple connect state (8/8): All done
    <debug> [1568649020.406461] (ttyUSB5) device open count is 2 (close)
    <debug> [1568649020.448483] (net/ppp0): adding device at sysfs path: /sys/devices/virtual/net/ppp0
    <debug> [1568649020.448738] (net/ppp0) could not get vendor/product id
    <debug> [1568649020.448776] [filter] (net/ppp0) port filtered: virtual device
    <debug> [1568649050.395662] (ttyUSB6) device open count is 2 (open)
    <debug> [1568649050.395871] (ttyUSB6): --> 'AT+CGACT?<CR>'
    <debug> [1568649050.408638] (ttyUSB6): <-- '<CR><LF>+CGACT: 1,1<CR><LF>+CGACT: 2,0<CR><LF>+CGACT: 3,0<CR><LF>+CGACT: 4,0<CR><LF>+CGACT: 5,0<CR><LF>+CGACT: 6,0<CR><LF>+CGACT: 7,0<CR><LF><CR><LF>OK<CR><LF>'
    <debug> [1568649050.408803] connection status loaded: disconnected
---> <info>  [1568649050.408825] ignoring disconnection report for bearer '/org/freedesktop/ModemManager1/Bearer/0'
    <debug> [1568649050.408848] (ttyUSB6) device open count is 1 (close)
    <debug> [1568649055.398994] (ttyUSB6) device open count is 2 (open)
    <debug> [1568649055.399084] (ttyUSB6): --> 'AT+CGACT?<CR>'
    <debug> [1568649055.411489] (ttyUSB6): <-- '<CR><LF>+CGACT: 1,1<CR><LF>+CGACT: 2,0<CR><LF>+CGACT: 3,0<CR><LF>+CGACT: 4,0<CR><LF>+CGACT: 5,0<CR><LF>+CGACT: 6,0<CR><LF>+CGACT: 7,0<CR><LF><CR><LF>OK<CR><LF>'
    <debug> [1568649055.411652] connection status loaded: disconnected
---> <info>  [1568649055.411674] ignoring disconnection report for bearer '/org/freedesktop/ModemManager1/Bearer/0'
2019-09-17 12:42:07 +02:00
Aleksander Morgado 21be687336 broadband-modem: do not add +CSQ response to cache
Otherwise, the +CSQ reported signal quality will never change!

Fixes edc1174068
2019-09-16 18:14:35 +02:00
Aleksander Morgado 1da694e9e0 iface-modem-3gpp: trivial macro rename to make it shorter 2019-09-16 17:08:58 +02:00
Aleksander Morgado 76b8c7d0ba iface-modem-3gpp: fix reporting 'denied' registration state
If all CS/PS/EPS report 'denied', we should not report 'unknown' as
consolidated...
    <debug> [1568556573.833928] building consolidated registration state: cs 'denied', ps 'denied', eps 'denied' --> 'unknown'
2019-09-16 14:22:12 +00:00
Aleksander Morgado ec4fe83db8 broadband-modem-qmi: retry lock check on 'SIM not inserted' errors
Very much like the MBIM implementation, we will now retry the lock
check if we get a 'SIM not inserted' error reported, because it may
very well be that the device has just been powered up and the SIM is
not fully detected yet.
2019-09-15 07:17:52 +00:00
Aleksander Morgado 6493f5f933 broadband-modem-mbim: use retry logic from generic modem interface
If the modem interface reports that this is the last attempt to load
the lock status and the modem is still reporting no sim, then, we'll
report a hard error right away. Otherwise, we'll let the generic logic
retry the operation, instead of doing it ourselves.
2019-09-15 07:17:52 +00:00
Aleksander Morgado f2f42e193e iface-modem: report last attempt to load_unlock_required implementations
The load_unlock_required() step will be automatically retried by the
generic interface logic unless some specific errors happen (e.g. it
won't be retried if a SIM missing error is received).

This patch allows telling the implementation of the method whether
this time being run is the last one before reporting a hard error or
not.
2019-09-15 07:17:52 +00:00
Aleksander Morgado 137ece0f2f broadband-bearer: setup cid selection as a testable method
Rework how the broadband bearer runs CGDCONT? and CGDCONT=? and setup
a helper method to perform the CID selection logic.

Also, implement unit tests for the CID selection logic.
2019-09-13 18:13:26 +00:00
Aleksander Morgado 80703b667b broadband-bearer: fix logic looking for unused CID
When looking for the first unused CID, we should also consider those
contexts defined with a different PDP type, not just the ones with the
same PDP type.
2019-09-13 18:13:26 +00:00
Aleksander Morgado e7881e4e29 broadband-bearer: prefer unused CID to overwriting an existing one
There are two places where we look for unused CIDs:

 * First, while processing the list of existing contexts returned by
   CGDCONT?, we look for gaps in the used CIDs. E.g. if the first
   context has CID=1 and the next one has CID=3, we can definitely use
   the unused CID=2.

 * Then, while processing the response of CGDCONT=?, we try to see
   whether there is any empty CID available after the last existing
   one found. E.g. if the last existing context has CID=3 and the
   format tells us that the max allowed CID is 16, we can definitely
   use the unused CID=4.

In both these cases, we should prefer using such an unused CID found
to overwriting other CIDs that are already defined.

This logic will now overwrite existing CIDs only if there are no
unused CIDs, and the preference to overwrite is as follows:

 * If there is any existing context defined without an explicit APN,
   overwrite it.

 * Otherwise, overwrite the last existing CID found.

 * And in the worst case, when no list of contexts was loaded
   properly (e.g. some Android phones don't allow querying), fallback
   to overwriting CID=1.
2019-09-13 18:13:26 +00:00
Matthew Starr e93b5c1c1f mm-broadband-bearer: fixed non-sequential CID selection
When a modem reported back non-sequential CIDs, MM was using the next
larger CID number after the last CID found.  In cases where the last CID
found was the highest numbered CID allowed and is not a modifiable CID,
MM would give up and fail to establish a data connection.

The above issue occurs on u-blox TOBY-R200 modems as of firmware 30.33
A02.02.  In this firmware version there are two default CIDs programmed
into the modem, one at CID 1 and another at CID 31.  The CID at 31 is
the highest CID number that can be used and cannot be modified.

This change makes it so while parsing CIDs for a match, if a jump in CID
numbers is detected, so not sequential, the first open CID will be used
before using the max CID +1 or replacing the max CID.  If an exact
match for IP type and APN is found, then that will still be used first.
2019-09-13 18:13:26 +00:00
Aleksander Morgado 60d5aefa1b broadband-modem: increase default CPIN? timeout
The Telit LE922 seems to take just a bit more than 3s to reply. Let's
increase it up to 10s to be on the safe side.

  <debug> [1568385270.124866] (ttyUSB3): --> 'AT+CPIN?<CR>'
  <debug> [1568385273.396659] Couldn't check if unlock required: 'Serial command timed out'
  <warn>  [1568385273.396847] Modem couldn't be initialized: Couldn't check unlock status: Serial command timed out
  <info>  [1568385273.397009] Modem: state changed (unknown -> failed)
  <debug> [1568385273.397215] (ttyUSB3) device open count is 1 (close)
  <debug> [1568385273.397268] Creating ports context for SIM hot swap
  <debug> [1568385273.397289] (ttyUSB3) device open count is 2 (open)
  <debug> [1568385273.397309] (ttyUSB4) opening serial port...
  <debug> [1568385273.397676] (ttyUSB4): setting up baudrate: 57600
  <debug> [1568385273.397699] (ttyUSB4): no flow control explicitly requested for device
  <debug> [1568385273.397724] (ttyUSB4): port attributes not fully set
  <debug> [1568385273.397760] (ttyUSB4) device open count is 1 (open)
  <debug> [1568385273.397776] (ttyUSB4): running init sequence...
  <debug> [1568385273.397856] Extended signal information reporting disabled
  <debug> [1568385273.397927] Couldn't finish initialization in the current state: 'Modem is unusable, cannot fully initialize'
  <debug> [1568385273.398432] [device /sys/devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.4/1-11.4.1] exported modem at path '/org/freedesktop/ModemManager1/Modem/0'
  <debug> [1568385273.398464] [device /sys/devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.4/1-11.4.1]    plugin:  Telit
  <debug> [1568385273.398484] [device /sys/devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.4/1-11.4.1]    vid:pid: 0x1BC7:0x1040
  <debug> [1568385273.398509] (ttyUSB3) device open count is 1 (close)
  <debug> [1568385273.398546] (ttyUSB4): --> 'ATE0<CR>'
  <debug> [1568385273.400412] (ttyUSB3): <-- '<CR><LF>+CPIN: READY<CR><LF><CR><LF>OK<CR><LF>'
  <debug> [1568385273.404870] (ttyUSB4): <-- '<CR><LF>OK<CR><LF>'
2019-09-13 17:29:52 +02:00
Matthew Starr 06b6d0ce10 mm-broadband-bearer: Increase CGACT timeout on deactivation
On u-blox modems it has been observed that attempting to force down the
bearer when the modem had an active data connection, lost the connection
but the bearer is still up, and the modem is searching for the network,
ModemManager would timeout before the CGACT command could return.  This
can put the modem in a state where the ModemManager state does not match
the modem's actual state of being connected.

When deactivating the current active bearer, the timeout has been
changed from 10 seconds to 45 seconds.  u-blox modems can take up to 40
seconds to respond to deactivation requests through the AT+CGACT
command according to the u-blox AT command reference.
2019-09-12 11:23:49 -05:00
Aleksander Morgado 51c4626471 filter: update plugin whitelist logic to use 'allowed product ids'
Several plugins define the specific device vid:pid pairs they
support. Let's use this information as a direct indication that
ModemManager can probe the devices.
2019-09-11 18:01:50 +00:00
Aleksander Morgado 0e02771e5c filter: require >1 port in devices with AT-capable ttyACMs
Instead of blindly allowing to be probed all ttyACM ports that report
them as AT-capable, we will now instead forbid all ttyACM ports that
don't report themselves as AT-capable.

Also, require the modem to expose other additional ports (of any kind
usable by ModemManager) in addition to the AT-capable ttyACM port.

This update should avoid automatically probing Arduino devices that
wrongly report their exposed single ttyACM port as AT-capable.

https://github.com/arduino/ArduinoCore-avr/pull/92
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/140
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/127
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930264
2019-09-11 16:46:55 +00:00
Aleksander Morgado 2a8d20292a port-serial: force-close the port if reopen fails
If the reopening operation fails when attempting to recover the
previous open count, it could mean the port is already gone. We didn't
get a HUP in the TTY because the channel I/O monitoring isn't in place
during this time, so this is the best way to detect that at this
point.

And if we do see an error, we'll flag the port as forced closed so
that we do not attempt to reopen it again.

  ModemManager[4219]: <debug> [1568123246.421399] Disconnecting bearer '/org/freedesktop/ModemManager1/Bearer/0'
  ModemManager[4219]: <info>  [1568123246.421465] Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connected -> disconnecting)
  ModemManager[4219]: <debug> [1568123246.421698] Reopening data port (modemu)...
  ModemManager[4219]: <debug> [1568123246.421722] (modemu) reopening port (2)
  ModemManager[4219]: <debug> [1568123246.421740] (modemu) device open count is 1 (close)
  ModemManager[4219]: <debug> [1568123246.421754] (modemu) device open count is 0 (close)
  ModemManager[4219]: <debug> [1568123246.421770] (modemu) closing serial port...
  ModemManager[4219]: <debug> [1568123246.421786] (modemu): port now disconnected
  ModemManager[4219]: <debug> [1568123246.421816] (modemu) serial port closed
  ModemManager[4219]: <info>  [1568123248.028573] (tty/modemu): released by device '/sys/devices/pci0000:00/0000:00:00.0'
  ModemManager[4219]: <debug> [1568123248.028637] Removing empty device '/sys/devices/pci0000:00/0000:00:00.0'
  ModemManager[4219]: <debug> [1568123248.028866] Removing from DBus bearer at '/org/freedesktop/ModemManager1/Bearer/0'
  ModemManager[4219]: <debug> [1568123248.028914] [device /sys/devices/pci0000:00/0000:00:00.0] unexported modem from path '/org/freedesktop/ModemManager1/Modem/0'
  ModemManager[4219]: <debug> [1568123248.028944] Periodic signal checks disabled
  ModemManager[4219]: <debug> [1568123256.401738] Connection monitoring is unsupported by the device
  ModemManager[4219]: <debug> [1568123256.422939] (modemu) opening serial port...
  ModemManager[4219]: <warn>  [1568123256.423062] (modemu) could not open serial device (2)
  ModemManager[4219]: <debug> [1568123256.423104] Couldn't disconnect bearer '/org/freedesktop/ModemManager1/Bearer/0': Couldn't reopen port (0): Could not open serial device modemu: No such file or directory
  ModemManager[4219]: _close_internal: assertion 'self->priv->open_count > 0' failed

  Thread 1 "ModemManager" received signal SIGTRAP, Trace/breakpoint trap.
  0x00007ffff77894e6 in ?? () from /usr/lib/libglib-2.0.so.0
  (gdb)
  (gdb) bt
  #0  0x00007ffff77894e6 in  () at /usr/lib/libglib-2.0.so.0
  #1  0x00007ffff7789738 in g_logv () at /usr/lib/libglib-2.0.so.0
  #2  0x00007ffff777ff80 in g_log () at /usr/lib/libglib-2.0.so.0
  #3  0x0000555555661115 in _close_internal (self=0x555555796380, force=0) at mm-port-serial.c:1378
  #4  0x0000555555661865 in mm_port_serial_close (self=0x555555796380) at mm-port-serial.c:1503
  #5  0x00005555556078cc in ports_context_unref (ctx=0x5555557c4ca0) at mm-broadband-modem.c:9801
  #6  0x000055555560e33a in finalize (object=0x5555557a4250) at mm-broadband-modem.c:11940
  #7  0x00007ffff787b351 in g_object_unref () at /usr/lib/libgobject-2.0.so.0
  #8  0x00005555555b1c71 in detailed_disconnect_context_free (ctx=0x555555785000) at mm-broadband-bearer.c:1369
  #9  0x00007ffff795d62a in  () at /usr/lib/libgio-2.0.so.0
  #10 0x00007ffff787b351 in g_object_unref () at /usr/lib/libgobject-2.0.so.0
  #11 0x00005555555b2532 in data_reopen_3gpp_ready (data=0x555555796380, res=0x55555573a580, task=0x55555573a040) at mm-broadband-bearer.c:1605
  #12 0x00007ffff795d584 in  () at /usr/lib/libgio-2.0.so.0
  #13 0x00007ffff7962a87 in  () at /usr/lib/libgio-2.0.so.0
  #14 0x0000555555661bc6 in reopen_do (self=0x555555796380) at mm-port-serial.c:1607
  #15 0x00007ffff778e3c4 in  () at /usr/lib/libglib-2.0.so.0
  #16 0x00007ffff778ebb0 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
  #17 0x00007ffff7790b11 in  () at /usr/lib/libglib-2.0.so.0
  #18 0x00007ffff7791a63 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
  #19 0x000055555559afb0 in main (argc=3, argv=0x7fffffffea58) at main.c:181
2019-09-11 14:34:40 +00:00
Aleksander Morgado 25011ec733 port-serial: flash cancellation always completed in idle
We cannot complete the flash task cancellation right away because this
may be called from within _close_internal() during a forced port close
after the TTY has gone, which would mean the object is fully disposed
already after the flash cancellation has been requested.

By making the task cancellation complete in idle, we're sure that
there will be at least one reference valid (the one in the task)
during the port close operation.

  ModemManager[25156]: <debug> [1568121341.696563] Modem (Generic) '/sys/devices/pci0000:00/0000:00:00.0' completely disposed
  **
  ERROR:mm-port-serial.c:2067:finalize: assertion failed: (self->priv->iochannel == NULL)

  (gdb) bt
  #0  0x00007ffff757c755 in raise () at /usr/lib/libc.so.6
  #1  0x00007ffff7567851 in abort () at /usr/lib/libc.so.6
  #2  0x00007ffff7741062 in  () at /usr/lib/libglib-2.0.so.0
  #3  0x00007ffff776d99d in g_assertion_message_expr () at /usr/lib/libglib-2.0.so.0
  #4  0x0000555555662f0a in finalize (object=0x55555577a380) at mm-port-serial.c:2067
  #5  0x0000555555664d81 in finalize (object=0x55555577a380) at mm-port-serial-at.c:632
  #6  0x00007ffff787b351 in g_object_unref () at /usr/lib/libgobject-2.0.so.0
  #7  0x00007ffff795d5eb in  () at /usr/lib/libgio-2.0.so.0
  #8  0x00007ffff787b351 in g_object_unref () at /usr/lib/libgobject-2.0.so.0
  #9  0x0000555555662126 in mm_port_serial_flash_cancel (self=0x55555577a380) at mm-port-serial.c:1747
  #10 0x0000555555661224 in _close_internal (self=0x55555577a380, force=1) at mm-port-serial.c:1397
  #11 0x000055555566197b in port_serial_close_force (self=0x55555577a380) at mm-port-serial.c:1526
  #12 0x000055555565fbe5 in common_input_available (self=0x55555577a380, condition=(G_IO_IN | G_IO_ERR | G_IO_HUP)) at mm-port-serial.c:971
  #13 0x00005555556600c0 in iochannel_input_available (iochannel=0x55555578a0a0, condition=(G_IO_IN | G_IO_ERR | G_IO_HUP), data=0x55555577a380) at mm-port-serial.c:1073
  #14 0x00007ffff778ebb0 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
  #15 0x00007ffff7790b11 in  () at /usr/lib/libglib-2.0.so.0
  #16 0x00007ffff7791a63 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
  #17 0x000055555559afb0 in main (argc=3, argv=0x7fffffffea58) at main.c:181
2019-09-11 14:34:40 +00:00
Aleksander Morgado f116fb4d1c base-bearer: include disconnection error message in log 2019-09-10 16:05:00 +02:00