Bug 91189

Summary: Sierra Mobile Broadband EM7455 does not work.
Product: libmbim Reporter: Kai-Heng Feng <kai.heng.feng>
Component: GeneralAssignee: Aleksander Morgado <aleksander>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: aleksander, fourdollars
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Debug message from ModemManager.
Message from mbimcli.
Log file from mbim-proxy.
Log file from mbim-proxy.
Increase the retry interval to 5 seconds.
Increase the retry interval to 5 seconds.

Description Kai-Heng Feng 2015-07-02 11:11:18 UTC
Created attachment 116875 [details]
Debug message from ModemManager.

The EM7455 (Dell DW5811e) is not working when using the git master ModemManager/libmbim/libqmi.

The last message piece from "ModemManager --debug":
ModemManager[2470]: <info>  [1435834110.545710] [mm-device.c:520] mm_device_create_modem(): Creating modem with plugin 'Dell' and '2' ports
ModemManager[2470]: <debug> [1435834110.545727] [dell/mm-plugin-dell.c:382] create_modem(): Dell-branded generic modem found...
ModemManager[2470]: <warn>  [1435834110.545871] [mm-plugin.c:974] mm_plugin_create_modem(): Could not grab port (usbmisc/cdc-wdm0): 'Cannot add port 'usbmisc/cdc-wdm0', unsupported'
ModemManager[2470]: <debug> [1435834110.545898] [mm-base-modem.c:312] mm_base_modem_grab_port(): (wwan0) type 'net' claimed by /sys/devices/pci0000:00/0000:00:14.0/usb2/2-2
ModemManager[2470]: <debug> [1435834110.545926] [mm-base-modem.c:1493] finalize(): Modem (Dell) '/sys/devices/pci0000:00/0000:00:14.0/usb2/2-2' completely disposed
ModemManager[2470]: <warn>  [1435834110.545939] [mm-base-manager.c:158] find_device_support_ready(): Couldn't create modem for device at '/sys/devices/pci0000:00/0000:00:14.0/usb2/2-2': Failed to find primary AT port

I tried mbimcli by "mbimcli -d /dev/cdc-wdm0 --query-device-caps --verbose":
[02 Jul 2015, 19:02:36] [Debug] opening device...
[02 Jul 2015, 19:02:36] [Debug] [/dev/cdc-wdm0] Queried max control message size: 4096
[02 Jul 2015, 19:02:36] [Debug] [/dev/cdc-wdm0] Sent message...
<<<<<< RAW:
<<<<<<   length = 16
<<<<<<   data   = 01:00:00:00:10:00:00:00:01:00:00:00:00:10:00:00

[02 Jul 2015, 19:02:36] [Debug] [/dev/cdc-wdm0] Sent message (translated)...
<<<<<< Header:
<<<<<<   length      = 16
<<<<<<   type        = open (0x00000001)
<<<<<<   transaction = 1
<<<<<< Contents:
<<<<<<   max_control_transfer = 4096

And the transaction repeats for 30 times, in the end it says:

[02 Jul 2015, 19:03:06] [Debug] open operation timed out: closed
error: couldn't open the MbimDevice: Transaction timed out


But when using EM7305, everything works as expected.
Comment 1 Kai-Heng Feng 2015-07-02 11:12:06 UTC
Created attachment 116876 [details]
Message from mbimcli.
Comment 2 Aleksander Morgado 2015-07-06 07:43:26 UTC
Looks like the mbim-proxy cannot get the MBIM port open.

Could you run the following sequence?

[stop ModemManager]
$ sudo /usr/libexec/mbim-proxy --verbose > proxy.log 2>&1 &
$ sudo /usr/sbin/ModemManager --debug

And send back the proxy log?
Comment 3 Kai-Heng Feng 2015-07-06 09:29:23 UTC
Created attachment 116969 [details]
Log file from mbim-proxy.
Comment 4 Aleksander Morgado 2015-07-06 10:14:07 UTC
(In reply to Kai-Heng Feng from comment #3)
> Created attachment 116969 [details]
> Log file from mbim-proxy.

Looks like the proxy didn't receive anything. Was ModemManager run *after* running the proxy?
Comment 5 Kai-Heng Feng 2015-07-06 10:32:47 UTC
Created attachment 116971 [details]
Log file from mbim-proxy.

Yes. There was already a ModemManager instance running. Here's the correct log.
Comment 6 Aleksander Morgado 2015-07-06 10:39:25 UTC
(In reply to Kai-Heng Feng from comment #5)
> Created attachment 116971 [details]
> Log file from mbim-proxy.
> 
> Yes. There was already a ModemManager instance running. Here's the correct
> log.

Thanks. Pretty weird, the modem doesn't seem to ever reply to any MBIM message...
Comment 7 Kai-Heng Feng 2015-07-08 05:33:03 UTC
Is there any chance that cdc_mbim kernel module does not support this card?
Comment 8 Kai-Heng Feng 2015-07-17 11:19:42 UTC
Now I can make the device work by changing the retry timer from 1s to 4s in mbim_device_command():
http://cgit.freedesktop.org/libmbim/libmbim/tree/src/libmbim-glib/mbim-device.c#n1234

After changing that, the device can operate normally.
So looks like it may be a driver/firmware/hardware problem.
Comment 9 Shih-Yuan Lee 2015-09-24 08:42:49 UTC
Created attachment 118426 [details] [review]
Increase the retry interval to 5 seconds.
Comment 10 Aleksander Morgado 2015-09-24 09:08:46 UTC
Comment on attachment 118426 [details] [review]
Increase the retry interval to 5 seconds.

This breaks the timeout value given by the user. In open_message_ready() we'll do a ctx->timeout--; if we got a timeout error, so that we can retry. Instead of ctx->timeout--; there should be a ctx->timeout-=5 there, and along with that: make timeout a gint (not guint) and also don't do the (ctx->timeout) check, and instead do (ctx->timeout > 0)

Also, better #define RETRY_TIMEOUT_SECS 5 and use the symbol everywhere.

Could you update the patch and retest?
Comment 11 Shih-Yuan Lee 2015-09-24 09:56:03 UTC
Created attachment 118427 [details] [review]
Increase the retry interval to 5 seconds.

Sure.
Comment 12 Shih-Yuan Lee 2015-09-24 10:10:13 UTC
I have verified the patch of comment #11.
It works fine and is better than the previous one.
Comment 13 Aleksander Morgado 2015-09-24 10:57:52 UTC
Merged the patch to mbim-1-12 and git master, thanks!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.