Bug 60521 - [PATCH]usbnet changes in 3.10 stop use of sierra_net devices
Summary: [PATCH]usbnet changes in 3.10 stop use of sierra_net devices
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Network (show other bugs)
Hardware: All Linux
: P1 blocking
Assignee: drivers_network@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-05 14:30 UTC by Ryley Angus
Modified: 2013-11-20 13:44 UTC (History)
4 users (show)

See Also:
Kernel Version: 3.10
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
3.10 patch for sierra modems (403 bytes, patch)
2013-07-05 14:30 UTC, Ryley Angus
Details | Diff
sierra_net 3.10 patch v2 (1.48 KB, patch)
2013-07-06 07:12 UTC, Ryley Angus
Details | Diff
Fix usbnet_status_start behaviour (420 bytes, patch)
2013-07-20 03:20 UTC, Ryley Angus
Details | Diff
Fix usbnet behaviour v3 (422 bytes, patch)
2013-08-02 13:06 UTC, Ryley Angus
Details | Diff
Fix for usbnet when using sierra_net (284 bytes, patch)
2013-11-12 19:47 UTC, Christian Scheele
Details | Diff

Description Ryley Angus 2013-07-05 14:30:53 UTC
Created attachment 106810 [details]
3.10 patch for sierra modems

Hopefully this is the right section, sorry in advance if not. I'm using Arch Linux and my system is completely up to date. After upgrading to linux-3.10.0-1-ARCH, my Sierra 320U modem is no longer working correctly. It will repeatedly try and fail to connect properly . Until this, I had never had any issues connecting. This modem uses the mainline sierra and sierra_net modules. I don't have any other UMTS/HSDPA/CDMA modems to test to see if any other devices display similar behavior.

If I boot into linux-3.9.9 it will connect without issue. Using both 3.9.9 and 3.10, my WLAN works perfectly with all adapters and networks I have available, as does Ethernet (that's why I thought this might be specific to the sierra driver). From the status LED's on the modem I can see it connects to the 3G network, but the issue seems to be getting an IP address. The only relevant output in dmesg under 3.10 is "IPv6: ADDRCONF(NETDEV_UP): <interface>: link is not ready".

I usually use Network Manager to manage my connections, but I can also manually connect using minicom to control the modem and "dhcpcd -nw <interface>" to get an IP and bring the interface up. The behavior is same regardless, with dhcpcd outputting "<interface>: waiting for carrier" before timing out.

I looked at the changes to the sierra_net module from kernel 3.9 to 3.10 and changing "sierra_net_probe" to "usbnet_probe" restored the previous behavior exactly (for both Network Manager and minicom/dhcpcd). I have no idea why this fixed it or if it has broken anything else that I haven't noticed. I've attached a patch containing this change, but I'm pretty sure it's not the same layout patches usually are.

Please let me know if my fix was incorrect/dangerous/a coincidence,

ryley.
Comment 1 Ryley Angus 2013-07-06 07:10:35 UTC
So after testing (rebooting, suspending etc) that change to the sierra_net driver, I realized that it didn't work all the time. Or even most of the time. The same issue persisted. I tried reverting the the sierra_net.c file to its pre-3.10 state and this has been working all day. No other files had to be modified. Cold-reboots, warm-reboots and suspending haven't caused the behavior to regress. I've attached a patch reflecting this change (I manually reverted the changes in 3.10). Could someone with a Sierra 3G/4G modem please test it?

ryley
Comment 2 Ryley Angus 2013-07-06 07:12:29 UTC
Created attachment 106817 [details]
sierra_net 3.10 patch v2

Revert most (all?) changes to the sierra_net driver after kernel 3.9 to restore normal functionality
Comment 3 Ryley Angus 2013-07-20 03:16:32 UTC
Looking into this a bit more, I found my issue stemmed from the change in sierra_net.c to use sierra_net_probe instead of usbnet_probe (From http://patchwork.ozlabs.org/patch/241796/ ).

I looked at the sierra_net_probe function within sierra_net.c and I found my problem was with the usbnet_status_start function from usbnet.c (Introduced in http://patchwork.ozlabs.org/patch/241793/ ).

After removing the single reference to this function, my modem worked without issue. I then followed the usbnet_status_start function to see where it was stuffing me up. I found that replacing "if (++dev->interrupt_count == 1)" with "if (dev->interrupt_count == 0)" within usbnet.c fixed my issue without any modifications to the sierra_net driver. 

I think some changes may have to be made to the usbnet_status_stop function, but I'm not too sure about what I'd have to change exactly.

If someone could please respond to me about this it'd be great. I've tried emailing the aforementioned patches author (Dan Williams) without any response so far.
Comment 4 Ryley Angus 2013-07-20 03:20:36 UTC
Created attachment 106955 [details]
Fix usbnet_status_start behaviour

The usbnet_status_start function in usbnet.c does not properly function. It prevents mine (and I think all other) Sierra 3G/4G modems from functioning in kernels > 3.10.0. The Sierra devices are the only ones which actually utilise this function. This patch tries to fix the logic within usbnet_status_start. It has been tested without issue for several days.
Comment 5 Till Schmalmack 2013-07-31 09:41:54 UTC
Similar effect but possibly different reason filed in bug #60662.
Comment 6 Ryley Angus 2013-08-02 13:06:19 UTC
After playing around with the previous changes I'd made, I found "dev->interrupt_count == 0" was causing error messages in dmesg after removing the device. If I reattached it, it still worked without issue. By instead replacing "dev->interrupt_count == 1" with "dev->interrupt_count == 2", I get both a proper connection and a lack of any error messages in dmesg after removal/insertion of the device.
Comment 7 Ryley Angus 2013-08-02 13:06:53 UTC
Created attachment 107080 [details]
Fix usbnet behaviour v3
Comment 8 Ryley Angus 2013-08-02 13:08:14 UTC
@Till Schmalmack: Could apply my latest change to usbnet.c and rebuild the usbnet module/your current kernel? I think you may have a similar issue to me and I'd like to know if it fixes your problem.
Comment 9 Till Schmalmack 2013-08-07 19:26:11 UTC
(In reply to Ryley Angus from comment #8)
I did, didn't help.  It seems that we are indeed facing different problems.
Comment 10 Christian Scheele 2013-11-12 19:43:04 UTC
Hi,

today we found the real issue regarding usbnet + sierra_net.

Withou applying your patch, but using the patch that is posted here:

http://thread.gmane.org/gmane.linux.usb.general/97907

It resolves our problems using MC7710, MC8705, MC8700 with directip. 

Have fun
Comment 11 Christian Scheele 2013-11-12 19:47:49 UTC
Created attachment 114401 [details]
Fix for usbnet when using sierra_net

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