After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 637934 - While disconnecting, mark state as disabled if port is closed.
While disconnecting, mark state as disabled if port is closed.
Status: RESOLVED INCOMPLETE
Product: NetworkManager
Classification: Platform
Component: ModemManager
git master
Other Linux
: Normal normal
: ---
Assigned To: Dan Williams
Depends on:
Blocks:
 
 
Reported: 2010-12-24 10:58 UTC by Amit Mendapara
Modified: 2011-12-07 21:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
modem-manager --debug (20.66 KB, text/x-log)
2010-12-24 10:58 UTC, Amit Mendapara
  Details
Mark state as disabled if port is closed. (1.99 KB, patch)
2010-12-25 06:10 UTC, Amit Mendapara
none Details | Review
modem-manager --debug (31.38 KB, text/x-log)
2011-01-24 08:59 UTC, Amit Mendapara
  Details
wvdial.conf (422 bytes, application/octet-stream)
2011-05-04 05:57 UTC, Amit Mendapara
  Details

Description Amit Mendapara 2010-12-24 10:58:00 UTC
Created attachment 177002 [details]
modem-manager --debug

For some weired reasons, if modem is unable to connect. The modem-manager fails to mark the modem state accordingly. You can test this by using some invalid APN name.

See these state change debug info form the attached log file:

** ... : state changed (connected -> disconnecting)
** ... : state changed (disconnecting -> connected)

After debugging the issue, I found that the `disconnect_done` function of `mm-generic-gsm.c` restores the previous state if there is any error (in this case the error is MM_SERIAL_ERROR_NOT_OPEN).
Comment 1 Amit Mendapara 2010-12-25 06:10:32 UTC
Created attachment 177033 [details] [review]
Mark state as disabled if port is closed.

I observed that this happens in several cases like invalid APN or unstable network coverage. When the connection is dropped automatically due to network issue, it was not possible to reconnect without removing the device.

This patch has fixed this issue.
Comment 2 Dan Williams 2011-01-24 06:05:11 UTC
In this case, does the port actually get destroyed by the kernel?  When MM closes the port here:

** (modem-manager:7223): DEBUG: <1293184713.730061> (ttyACM0) device open count is 0 (close)
** (modem-manager:7223): DEBUG: <1293184713.730130> (ttyACM0) closing serial port...
** (modem-manager:7223): DEBUG: <1293184713.730164> (ttyACM0): port now disconnected
** (modem-manager:7223): DEBUG: <1293184713.745834> (ttyACM0) serial port closed

we don't have quite enough information about why it's been closed.  Would be nice to get more info here so we can figure out what to do.

I've added more logging in git master to help debug this situation, can you reproduce it with the latest and hopefully we'll see better what's going on?  Thanks!
Comment 3 Amit Mendapara 2011-01-24 08:59:49 UTC
Created attachment 179138 [details]
modem-manager --debug

Look at the line 220. The state has been changed to `connected`. BTW, I don't think the kernel is destroying the ports as I can see both /dev/ttyACM0 and /dev/ttyACM1 are there.
Comment 4 Tobias Mueller 2011-05-01 15:24:21 UTC
Reopening as I think the requested information has been provided.
Comment 5 Dan Williams 2011-05-03 14:58:53 UTC
Yeah, this device is pretty weird.  It's not replying to requests for information on ttyUSB1 too, whiel ttyUSB0 is taken with data.  I wonder if it really wants us to use ttyUSB1 for PPP instead?
Comment 6 Amit Mendapara 2011-05-04 05:57:00 UTC
I have also implemented ofono plugin for this device and it's working flawlessly with ofono. The device is using ttyACM1 for AT commands and ttyUACM0 for data exclusively (it can be swappable however).

On ttyUSB0, we only need to send initialization commands:

AT &F
AT+CFUN=1

Other AT commands should be sent to ttyACM1 and should listen to it for unsolicited messages. The data port is not emitting anything once data connection is established.

I have created a wvdial configuration to know the exact behavior. Here I am attaching the wvdial config...
Comment 7 Amit Mendapara 2011-05-04 05:57:27 UTC
Created attachment 187168 [details]
wvdial.conf
Comment 8 Dan Williams 2011-08-02 20:24:42 UTC
Can the initialization commands be sent on ttyACM1?
Comment 9 Fabio Durán Verdugo 2011-12-07 21:05:19 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for.
Thanks!