Bug 817504 - ZTE MF60 3G Modem Not Working Without Boot Parameters
ZTE MF60 3G Modem Not Working Without Boot Parameters
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: ModemManager (Show other bugs)
20
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Dan Williams
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-30 06:03 EDT by Marko Myllynen
Modified: 2015-04-07 03:40 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-04-07 03:40:02 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
dmesg output without boot params (2.17 KB, text/plain)
2012-04-30 06:05 EDT, Marko Myllynen
no flags Details
dmesg output with boot params (2.04 KB, text/plain)
2012-04-30 06:07 EDT, Marko Myllynen
no flags Details
lsusb output (5.97 KB, text/plain)
2012-06-25 14:11 EDT, Marko Myllynen
no flags Details
zte-log.txt (8.17 KB, text/plain)
2014-01-14 10:51 EST, Marko Myllynen
no flags Details
zte-log-2.txt (11.00 KB, text/plain)
2014-02-26 05:53 EST, Marko Myllynen
no flags Details
zte-mm-nm-debug.txt (126.65 KB, text/plain)
2014-03-10 12:43 EDT, Marko Myllynen
no flags Details

  None (edit)
Description Marko Myllynen 2012-04-30 06:03:14 EDT
Description of problem:
When plugging in ZTE MF60 3G Modem with USB cable without any special boot parameters the standard storage dialog to either Open with Files or Eject is presented. If Eject is selected the device is still not recognized by NetworkManager.

When booting up with usbserial.vendor=0x19d2 usbserial.product=0x1402 boot parameters, plugging in the modem and selecting Eject, NetworkManager quickly detects the modem and it is shown under the Mobile Broadband menu, Internet access works then perfectly.

Adding new usb_modeswitch rules at /etc/usb_modeswitch.d/19d2:2000 and/or /lib/udev/rules.d/40-usb_modeswitch.rules does not seem to affect in any way how the device works (as there exists a rule for 19d2:2000 already).

There has been discussion elsewhere about this device:

http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=793
http://lists.freedesktop.org/archives/libqmi-devel/2012-March/000013.html

It is also worth to note that Ubuntu switched back from usbserial being built-in to build it as kernel module again due to many 3G modems not working:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/345002
http://packages.ubuntu.com/precise/i386/linux-image-3.2.0-23-generic/filelist


Dan, it might be that there's nothing NetworkManager can do about this but I'm filing this initially against NM to let you provide suggestions how to proceed with this one.


I'll attach the dmesg output for both cases described above.

Version-Release number of selected component (if applicable):
Fedora 17
Comment 1 Marko Myllynen 2012-04-30 06:05:41 EDT
Created attachment 581166 [details]
dmesg output without boot params

dmesg output without boot parameters after connecting the modem and selecting Eject in the dialog. NM does not recognize the device.
Comment 2 Marko Myllynen 2012-04-30 06:07:00 EDT
Created attachment 581167 [details]
dmesg output with boot params

dmesg output with boot parameters after connecting the modem and selecting Eject in the dialog. NM correctly recognizes the device and allows accessing Internet using Mobile Broadband.
Comment 3 Dan Williams 2012-06-25 11:08:15 EDT
Can you attach 'lsusb -v -d 19d2:1402' to the bug after doing the 'eject' sequence?

It likely is a kernel driver issue of not handling the IDs correctly.  Also, usbserial is not the correct driver here, as that will give you lower performance than 'option'.
Comment 4 Marko Myllynen 2012-06-25 14:11:19 EDT
Created attachment 594252 [details]
lsusb output

> Can you attach 'lsusb -v -d 19d2:1402' to the bug after doing the 'eject' sequence?

Sure, done.
Comment 5 Dan Williams 2012-08-08 13:34:59 EDT
Added upstream to the Option driver on 2012-07-02 in commit 8e16e33c.

    USB: option: add ZTE MF60
    
    Switches into a composite device by ejecting the initial
    driver CD.  The four interfaces are: QCDM, AT, QMI/wwan
    and mass storage.  Let this driver manage the two serial
    interfaces:
    
Unfortunately that means it's only in 3.5 and later.  That said, it *should* work if you force-bind it to usbserial or option, but only ttyUSB1 is expected to use AT commands, and ttyUSB0 is expected to be QCDM.  In 3.5 cdc_wdm and qmi_wwan will bind to the third USB interface.  There should never be more than two "tty" interface exposed by this device; the problem with option is that it's quite aggressive and only recently has the capability to bind only to specific interfaces where the vendor hasn't bothered to give each interface a different type.

We also might be running into usb_modeswitch's force-binding option; does it consistently work if you move usb_modeswitch out of the way and always "eject /dev/sr1"?
Comment 6 Fedora End Of Life 2013-07-03 17:59:48 EDT
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 7 JanS 2013-07-13 05:44:39 EDT
I just did managed to make ZTE MF60 modeswitch after being plugged in into Fedora 17. This could be treated as a workaround, since there is clearly something I do not understand about the difference between ATTR and ATTRS in udev.

The problem was, that udev rule for device 19d2:2000 (in /lib/udev/rules.d/40-usb_modeswitch.rules) was not starting. The rule is:

 ATTRS{bInterfaceNumber}=="03", ATTRS{bInterfaceClass}=="08", ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2000", GOTO="modeswitch_rules_begin"

The rule was not activated for any of those devices, that showed up after plugging in MF60 modem: 

When plugged in MF60 there device are added (udevadm monitor --udev):
UDEV  [43965.040359] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2 (usb)
UDEV  [43965.046826] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3 (usb)
UDEV  [43965.055805] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/host30 (scsi)
UDEV  [43965.065657] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/host30/scsi_host/host30 (scsi_host)
....(and so on).

The
  udevadm info --path=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3 --attribute-walk
gives:

  looking at device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3':
    KERNEL=="1-1.2:1.3"
    SUBSYSTEM=="usb"
    DRIVER=="usb-storage"
    ATTR{bInterfaceClass}=="08"
    ATTR{bInterfaceSubClass}=="06"
    ATTR{bInterfaceProtocol}=="50"
    ATTR{bNumEndpoints}=="02"
    ATTR{supports_autosuspend}=="1"
    ATTR{bAlternateSetting}==" 0"
    ATTR{bInterfaceNumber}=="03"

  looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2':
    KERNELS=="1-1.2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{devpath}=="1.2"
    ATTRS{idVendor}=="19d2"
    ATTRS{speed}=="480"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{busnum}=="1"
    ATTRS{devnum}=="16"
    ATTRS{configuration}=="ZTE Configuration"
    ATTRS{bMaxPower}=="500mA"
    ATTRS{authorized}=="1"
    ATTRS{bmAttributes}=="c0"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{maxchild}=="0"
    ATTRS{bcdDevice}=="0000"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{serial}=="MF60__ZTED010000"
    ATTRS{version}==" 2.00"
    ATTRS{urbnum}=="2513"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="ZTE,Incorporated"
    ATTRS{removable}=="removable"
    ATTRS{idProduct}=="2000"
    ATTRS{bDeviceClass}=="00"
    ATTRS{product}=="ZTE WCDMA Technologies MSM"

I did not understand why the rule did not work. However I did notice that changing the rule either to:
a)  ATTRS{bInterfaceNumber}=="03", ATTRS{bInterfaceClass}=="08", GOTO="modeswitch_rules_begin"
or to:
b)  ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2000", GOTO="modeswitch_rules_begin"
did worked.

First rule was fired for device /2-1.2:1.3 resulting in starting:
 usb_modeswitch_dispatcher --switch-mode /2-1.2:1.3 /usr/lib/udev/usb_modeswitch
which worked and changed mode of the device.
The second rule, only on VID and PID, was firing twice, for both /2-1.2 and /2-1.2:1.3 resulting in issuing commands:
 usb_modeswitch_dispatcher --switch-mode /2-1.2 /usr/lib/udev/usb_modeswitch
 usb_modeswitch_dispatcher --switch-mode /2-1.2:1.3 /usr/lib/udev/usb_modeswitch
one by one.
 
Why, o, why the full original rule did not fire for the /2-1.2:1.3 device but modified rule a) did, I HAVE NO IDEA. We require both conditions to fire the the command anyway!

In the process, I have noticed that attribute-walk actually returned ATTR{bInterfaceClass}=="08" and not ATTRS{bInterfaceClass}=="08" !
I have tried my chances, and changed udev rule to:

  ATTR{bInterfaceNumber}=="03", ATTR{bInterfaceClass}=="08", ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2000", GOTO="modeswitch_rules_begin"
(where I changed ATTRS to ATTR) and it worked! But why?!

And why modified rule a) from above, despite having ATTRS and not ATTR, did work I do not know either.
Comment 8 Dan Williams 2013-07-30 14:39:18 EDT
Given this, moving to usb_modeswitch for rules updates.
Comment 9 Fedora End Of Life 2013-07-31 23:31:59 EDT
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 10 Marko Myllynen 2013-08-05 12:00:56 EDT
Jan, thanks a lot for the additional information - I'm reopening this since this is still an issue with fully up-to-date F19.
Comment 11 Marko Myllynen 2014-01-14 10:49:46 EST
The modem still does not work with Fedora 20 with the following packages:

kernel-3.12.6-300.fc20
libqmi-1.6.0-1.fc20
usb_modeswitch-1.2.7-3.fc20
ModemManager-1.1.0-2.git20130913.fc20
NetworkManager-0.9.9.0-23.git20131003.fc20

I checked the current udev rules on F20 and they are not like the ones pasted in comment 7 at all, the only udev rule for the device is

ATTR{idVendor}=="19d2", ATTR{idProduct}=="2000", RUN+="usb_modeswitch '%b/%k'"

which is basically the same for almost all devices in the file 40-usb_modeswitch.rules.

Looking at current logs makes me think this is not a usb_modeswitch issue:

Jan 14 17:24:15 localhost.localdomain ModemManager[359]: <info>  Creating modem with plugin 'ZTE' and '4' ports
Jan 14 17:24:15 localhost.localdomain ModemManager[359]: <warn>  Could not grab port (net/wwp0s29f7u8i2): 'Ignoring net port in non-Icera ZTE modem'
Jan 14 17:24:15 localhost.localdomain ModemManager[359]: <warn>  Could not grab port (usbmisc/cdc-wdm0): 'unsupported subsystem: 'usbmisc''
Jan 14 17:24:15 localhost.localdomain ModemManager[359]: <warn>  (ttyUSB1): port attributes not fully set
Jan 14 17:24:15 localhost.localdomain ModemManager[359]: <info>  Modem for device at '/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-8' successfully created
Jan 14 17:24:16 localhost.localdomain ModemManager[359]: <info>  Modem: state changed (unknown -> disabled)

I'll attach full log when inserting the modem and reassign to ModemManager, please feel free to rereassign if you think that's not the correct component.

Thanks.
Comment 12 Marko Myllynen 2014-01-14 10:51:09 EST
Created attachment 850015 [details]
zte-log.txt

Log from F20.
Comment 13 Marko Myllynen 2014-02-26 05:51:56 EST
With ModemManager/libqmi from Rawhide things are looking slightly better but we still have an issue:

Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <info>  Creating modem with plugin 'ZTE' and '4' ports
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <info>  Modem for device at '/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-8' successfully created
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0] Checking version info (10 retries)...
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0] QMI Device supports 4 services:
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0]    ctl (1.3)
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0]    wds (1.5)
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0]    dms (1.2)
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0]    nas (1.0)
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0] Setting network port data format...
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0] Network port data format operation finished
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0] Allocating new client ID...
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0] Registered 'dms' (version 1.2) client with ID '4'
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0] Allocating new client ID...
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0] Registered 'nas' (version 1.0) client with ID '4'
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <warn>  (ttyUSB1): port attributes not fully set
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <warn>  couldn't load Supported Bands: 'QMI operation failed: Cannot send message: QMI service 'dms' version '1.3' required, got version '1.2''
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <warn>  couldn't load SIM identifier: 'QMI operation failed: Cannot send message: QMI service 'dms' version '1.3' required, got version '1.2''
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <warn>  couldn't load IMSI: 'QMI operation failed: Cannot send message: QMI service 'dms' version '1.3' required, got version '1.2''
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <warn>  couldn't load list of Own Numbers: 'Couldn't get MSISDN: QMI protocol error (16): 'NotProvisioned''
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <warn>  couldn't load current allowed/preferred modes: 'Loading current modes is not supported by this device'
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <warn>  couldn't load current Bands: 'QMI operation failed: Cannot send message: QMI service 'nas' version '1.1' required, got version '1.0''
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <info>  Modem: state changed (unknown -> disabled)

The packages in use were:

ModemManager-1.2.0-1.fc21
ModemManager-glib-1.2.0-1.fc21
NetworkManager-0.9.9.0-30.git20131003.fc20
NetworkManager-glib-0.9.9.0-30.git20131003.fc20
kernel-3.13.3-201.fc20
libqmi-1.8.0-1.fc21
usb_modeswitch-1.2.7-3.fc20

I'll attach full log captured after inserting the modem and clicking Eject on the presented pop-up dialog.

Thanks.
Comment 14 Marko Myllynen 2014-02-26 05:53:01 EST
Created attachment 867919 [details]
zte-log-2.txt
Comment 15 Marko Myllynen 2014-03-10 12:43:58 EDT
Created attachment 872797 [details]
zte-mm-nm-debug.txt

Debug log created as instructed in http://www.freedesktop.org/wiki/Software/ModemManager/Debugging/.
Comment 16 Dan Williams 2014-03-10 13:52:04 EDT
MM sends StartNetwork at 1394467151.  MM gets no response to the StartNetwork command, so it aborts the StartNetwork request at 1394467196.  Then the modem firmware appears to crash.  I guess the big question is what's taking the modem so long to start the network, or is something else going on here.
Comment 17 Marko Myllynen 2014-03-10 14:06:22 EDT
(In reply to Dan Williams from comment #16)
> MM sends StartNetwork at 1394467151.  MM gets no response to the
> StartNetwork command, so it aborts the StartNetwork request at 1394467196. 
> Then the modem firmware appears to crash.

That's indeed the case.

> I guess the big question is what's taking the modem so long to start the
> network, or is something else going on here.

The modem is configured to autoconnect so I've waited its on-screen display to say "Connected" before plugging it in.

Thanks.
Comment 18 Aleksander Morgado 2014-03-10 15:55:46 EDT
Firmware crash when running WDS Start Network is what Bjorn reported for the MF60 long ago:

http://lists.freedesktop.org/archives/libqmi-devel/2012-July/000098.html
Comment 19 Marko Myllynen 2014-09-08 01:22:55 EDT
Thanks to Aleksander, the required changes are now in ModemManager master/1.4 branch.
Comment 20 Marko Myllynen 2015-04-07 03:40:02 EDT
And ModemManager 1.4 is now part of Fedora 22 Alpha, thanks!

Note You need to log in before you can comment on or make changes to this bug.