Bug 684297

Summary: [PATCH] ZTE modem not working reliably
Product: Red Hat Enterprise Linux 6 Reporter: Lubomir Rintel <lkundrak>
Component: udevAssignee: Harald Hoyer <harald>
Status: CLOSED DUPLICATE QA Contact: qe-baseos-daemons
Severity: low Docs Contact:
Priority: low    
Version: 6.0CC: azelinka, pknirsch
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-01 18:08:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Lubomir Rintel 2011-03-11 17:58:51 UTC
Description of problem:

ZTE modem often disappears from the system after plugged. It happens because the following rule gets applied:

/lib/udev/rules.d/61-option-modem-modeswitch.rules:ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2000", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd"

When the device is initially inserted, it appears as CD-ROM device. While for most modems modem-modeswitch switches them into serial devices, for this one the correct action is to ask the drive to eject the media; modem-modeswitch causes it to disappear completely.

The rule for ejecting is already present:

/lib/udev/rules.d/61-mobile-action.rules:ACTION=="add", ENV{ID_CDROM}=="1", ENV{ID_VENDOR_ID}=="19d2", ENV{ID_MODEL_ID}=="2000", RUN+="/usr/bin/eject %k"

These two rules make up a race, where the device disappears if eject is not fast enough.

Version-Release number of selected component (if applicable):

udev-147-2.29.el6.i686

Additional information:

The device before and after eject:

Bus 001 Device 005: ID 19d2:2000 ONDA Communication S.p.A. ZTE MF627/MF628/MF628+/MF636+ HSDPA/HSUPA
Bus 001 Device 004: ID 19d2:0031 ONDA Communication S.p.A. ZTE MF636

Comment 2 Harald Hoyer 2011-03-14 08:37:14 UTC
so where is the patch?

a solution might be:

remove the rule from /lib/udev/rules.d/61-option-modem-modeswitch.rules
and extend the rule in /lib/udev/rules.d/61-mobile-action.rules:

ACTION=="add", ENV{ID_CDROM}=="1", \
    ENV{ID_VENDOR_ID}=="19d2", ENV{ID_MODEL_ID}=="2000", \
    RUN+="/usr/bin/eject %k", \
    RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd"

Comment 3 Lubomir Rintel 2011-03-14 21:31:23 UTC
Well, sorry for not being clear enough about the fix and abusing [patch] keyword.

The fix would be to remove the modeswitch rule completely; it is of no use; the device switches into serial mode right after the eject.

(Also, this works well in Fedora, where usb_modeswitch is used)

Comment 7 Harald Hoyer 2012-03-01 18:08:00 UTC
Already fixed:

$ fgrep 19d2 /lib/udev/rules.d/61-option-modem-modeswitch.rules
$ rpm -q udev
udev-147-2.40.el6.x86_64

http://rhn.redhat.com/errata/RHBA-2011-1649.html

*** This bug has been marked as a duplicate of bug 632646 ***