Probing cancellations

Dan Williams dcbw at redhat.com
Mon Feb 29 22:33:19 UTC 2016


On Sat, 2016-01-16 at 01:57 +0100, Aleksander Morgado wrote:
> Hey,
> 
> We've seen reports from users where ModemManager would either crash
> or
> get in a bad loop if a device is unplugged/shutdown while it's being
> probed. This was because we really didn't cancel device/port probing
> tasks when the ports were gone: we just relied on them failing at
> some
> point; which worked more or less well, except for some corner cases
> (e.g. if the device was replugged quickly). These issues could be
> reproduced more or less easily by adding some sleeps here and there
> and making the probing very very slow (so easier to trigger the
> disconnections/reconnections).
> 
> The new 'aleksander/plugin-manager' branch in upstream git tries to
> cope with these issues, by expliclty cancelling the port probing
> tasks. The cancellation is tried at multiple levels, even down to the
> actual serial port probing tasks, so now it should be quite quick.
> 
> http://cgit.freedesktop.org/ModemManager/ModemManager/log/?h=aleksand
> er/plugin-manager
> 
> Along with the changes I bumped the GLib requirement to 2.36 (almost
> 3
> years old, March 2013), in order to use the cancellable async support
> through GTask.
> 
> Several components, especially the MMPluginManager, got quite heavily
> refactored, which is why I'm not sending the patches for review here;
> it may actually be better for reviewing those to look at the entire
> file, not just diffs with limited context.

For a Sony Ericsson MD300 this branch now reports:

  -------------------------
  System   |         device: '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-1'
           |        drivers: 'cdc_acm, cdc_wdm, cdc_ether'
           |         plugin: 'Ericsson MBM'
           |   primary port: 'cdc-wdm4'
           |          ports: 'cdc-wdm4 (at), ttyACM2 (at), cdc-wdm2 (at), cdc-wdm1 (at), enp0s20u1c3i9 (net), cdc-wdm3 (at), ttyACM1 (at)'

while git master reports:

  -------------------------
  System   |         device: '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-1'
           |        drivers: 'cdc_wdm, cdc_acm, cdc_ether'
           |         plugin: 'Ericsson MBM'
           |   primary port: 'ttyACM1'
           |          ports: 'ttyACM1 (at), cdc-wdm4 (at), cdc-wdm2 (at), cdc-wdm1 (at), enp0s20u1c3i9 (net), cdc-wdm3 (at), ttyACM2 (at)'

I honestly don't know if the wdm ports can be used as masters, but on
these devices we've always used the ACM ports as the masters.  Possibly
the new branch is just better at probing and for whatever reason the
wdm ports complete more quickly?

Dan


More information about the ModemManager-devel mailing list