GNOME Bugzilla – Bug 703022
[MM 0.8] Nokia Icera not chosen for 21M
Last modified: 2013-06-26 09:10:09 UTC
The Nokia 21M is an icera-based device, but some of the ports apparently run limited command interpreters and don't support Icera commands: ModemManager[28787]: <debug> [1372132280.909330] [mm-at-serial-port.c:408] debug_log(): (ttyACM0): --> 'AT%IPSYS?<CR>' ModemManager[28787]: <debug> [1372132280.909858] [mm-at-serial-port.c:408] debug_log(): (ttyACM2): --> 'AT%IPSYS?<CR>' ModemManager[28787]: <debug> [1372132280.910431] [mm-at-serial-port.c:408] debug_log(): (ttyACM1): --> 'AT%IPSYS?<CR>' ModemManager[28787]: <debug> [1372132281.810068] [mm-at-serial-port.c:408] debug_log(): (ttyACM0): <-- 'AT%IPSYS?' ModemManager[28787]: <debug> [1372132281.810757] [mm-at-serial-port.c:408] debug_log(): (ttyACM0): <-- '<CR>' ModemManager[28787]: <debug> [1372132281.811390] [mm-at-serial-port.c:408] debug_log(): (ttyACM2): <-- 'AT%IPSYS?' ModemManager[28787]: <debug> [1372132281.812064] [mm-at-serial-port.c:408] debug_log(): (ttyACM2): <-- '<CR>' ModemManager[28787]: <debug> [1372132281.812775] [mm-at-serial-port.c:408] debug_log(): (ttyACM2): <-- '<CR><LF>ERROR<CR><LF>' ModemManager[28787]: <debug> [1372132281.813373] [mm-serial-parsers.c:363] mm_serial_parser_v1_parse(): Got failure code 100: Unknown error ModemManager[28787]: <debug> [1372132281.813918] [mm-port-probe.c:223] mm_port_probe_set_result_at_icera(): (tty/ttyACM2) Modem is NOT Icera-based ModemManager[28787]: <debug> [1372132281.814513] [mm-at-serial-port.c:408] debug_log(): (ttyACM0): <-- '<CR><LF>%IPSYS: 5,2<CR><LF><CR><LF>OK<CR><LF>' ModemManager[28787]: <debug> [1372132281.815068] [mm-port-probe.c:217] mm_port_probe_set_result_at_icera(): (tty/ttyACM0) Modem is Icera-based ModemManager[28787]: <debug> [1372132281.815649] [mm-at-serial-port.c:408] debug_log(): (ttyACM1): <-- '<CR><LF>ERROR<CR><LF>' ModemManager[28787]: <debug> [1372132281.815706] [mm-serial-parsers.c:363] mm_serial_parser_v1_parse(): Got failure code 100: Unknown error ModemManager[28787]: <debug> [1372132281.816295] [mm-port-probe.c:223] mm_port_probe_set_result_at_icera(): (tty/ttyACM1) Modem is NOT Icera-based ... ModemManager[28787]: <debug> [1372132281.830234] [mm-plugin.c:522] apply_post_probing_filters(): (Nokia) [ttyACM0] filtered as modem is icera ModemManager[28787]: <debug> [1372132281.836448] [mm-plugin-manager.c:365] plugin_supports_port_ready(): (Plugin Manager) (Nokia) [ttyACM2] found best plugin for port ModemManager[28787]: <debug> [1372132281.836495] [mm-plugin-manager.c:201] port_probe_context_finished(): (Plugin Manager) (Nokia) [ttyACM2]: found best plugin for device (/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-6) ... ModemManager[28787]: <debug> [1372132282.023974] [mm-plugin-manager.c:107] find_device_support_context_complete_and_free(): (Plugin Manager) [/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-6] device support check finished in '2.019571' seconds ModemManager[28787]: <info> [1372132282.024053] [mm-device.c:486] mm_device_create_modem(): Creating modem with plugin 'Nokia' and '4' ports The problem is that src/mm-plugin.c's apply_post_probing_filters() function only works on a per-port basis, so the Icera-responding port gets dropped from the Nokia plugin's list, and for some reason Nokia gets chosen as the best plugin instead of NokiaIcera. I poked around for a while but it's late and I have to go to bed; so if you have any ideas on how to fix it but don't have the time to do the patch, I could get to it, otherwise if you have a quick fix I'm happy to test. But it seems like having just one Icera-capable port should disqualify a plugin that sets FORBIDDEN_ICERA to TRUE, though it might require a bit of reworking of the port filtering logic in src/mm-plugin.c. Deleting the Nokia plugin successfully allows Nokia Icera to grab the device.
The situation is indeed unfortunate. The proper fix would be to have a second layer of 'per-device' filters, and apply the icera-forbidden and icera-allowed filters at that stage, not 'per-port'. But that is probably too complex and just to handle this specific case we can avoid it in some other way, like overriding the best plugin found for a device if the best plugins for different ports don't match (and if the reason is the icera-forbidden vs icera-allowed filters).
Created attachment 247706 [details] [review] Patch. The attached patch tries to solve the issue. I hardcoded the situation you're seeing and tested myself, and it seems to work well (see the 'overriding...' log message): [mm-plugin-manager.c:417] plugin_supports_port_ready(): (Plugin Manager) (Nokia) [ttyACM1] found best plugin for port [mm-plugin-manager.c:201] port_probe_context_finished(): (Plugin Manager) (Nokia) [ttyACM1]: found best plugin for device (/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2) [mm-plugin-manager.c:274] port_probe_context_finished(): (Plugin Manager) 'ttyACM1' port probe finished, still 1 running probes in this device (ttyACM0) [mm-plugin-manager.c:417] plugin_supports_port_ready(): (Plugin Manager) (Nokia (Icera)) [ttyACM0] found best plugin for port [mm-plugin-manager.c:242] port_probe_context_finished(): (Plugin Manager) (ttyACM0): overriding previously selected device plugin 'Nokia' with 'Nokia (Icera)', modem is Icera-capable [mm-plugin-manager.c:282] port_probe_context_finished(): (Plugin Manager) 'ttyACM0' port probe finished, last one in device, but minimum probing time not consumed yet ('1.770898' seconds elapsed) [mm-plugin-manager.c:639] min_probing_timeout_cb(): (Plugin Manager) [/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2] Minimum probing time consumed and no more ports to probe [mm-plugin-manager.c:107] find_device_support_context_complete_and_free(): (Plugin Manager) [/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2] device support check finished in '2.621933' seconds [mm-device.c:486] mm_device_create_modem(): Creating modem with plugin 'Nokia (Icera)' and '2' ports [mm-base-modem.c:275] mm_base_modem_grab_port(): (ttyACM1) type 'at' claimed by /sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2 [nokia/mm-plugin-nokia-icera.c:76] grab_port(): Nokia: AT port 'tty/ttyACM0' flagged as primary [mm-base-modem.c:275] mm_base_modem_grab_port(): (ttyACM0) type 'at' claimed by /sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2 [mm-base-modem.c:1056] log_port(): (/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2) tty/ttyACM0 at (primary) [mm-base-modem.c:1056] log_port(): (/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2) tty/ttyACM1 at (secondary) [mm-base-modem.c:1056] log_port(): (/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2) tty/ttyACM0 data (primary) Let me know if it works for you.
Yeah, the patch picks the correct plugins on the 21M and CS-18 (both Icera) and the N950 (not Icera).
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.