Bug 466136 - wifi: age scan results on resume from suspend
wifi: age scan results on resume from suspend
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
9
All Linux
medium Severity low
: ---
: ---
Assigned To: John W. Linville
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-08 12:43 EDT by August Schwerdfeger
Modified: 2009-04-02 13:22 EDT (History)
8 users (show)

See Also:
Fixed In Version: 2.6.27.21-78.2.41.fc9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-04-02 13:22:07 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch against 2.6.27.15 from F-9 updates as of 2009-02-25 (5.13 KB, patch)
2009-02-25 22:29 EST, Dan Williams
no flags Details | Diff
patch against 2.6.28.2 from F-9 package CVS as of 2009-02-25 (5.54 KB, patch)
2009-02-25 22:30 EST, Dan Williams
no flags Details | Diff
patch against 2.6.29-rc6 from F-10 package CVS as of 2009-02-25 (5.34 KB, patch)
2009-02-25 22:31 EST, Dan Williams
no flags Details | Diff
patch against 2.6.29-rc6 from F-10 package CVS as of 2009-02-25 (5.10 KB, patch)
2009-02-25 22:40 EST, Dan Williams
no flags Details | Diff
ipw2x00 scan age patch against 2.6.28.2 from F-9 package CVS (6.62 KB, patch)
2009-02-26 07:19 EST, Dan Williams
no flags Details | Diff
ipw2x00 scan age patch against 2.6.29-rc6 from F-10 package CVS (6.88 KB, patch)
2009-02-26 07:20 EST, Dan Williams
no flags Details | Diff

  None (edit)
Description August Schwerdfeger 2008-10-08 12:43:14 EDT
Description of problem:

I regularly use my laptop with two wireless networks in different locations. When I suspend the laptop while it is connected to network "A," then resume it within the range of network "B," NetworkManager usually made an immediate connection to network "B."

With the latest update, NetworkManager instead attempts to connect to network "A," which is over 10 miles away. Failing at this, it will prompt me for network secrets; clicking "Cancel" in this dialog box will cause it to connect to network "B" as was previously its practice.

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

NetworkManager version: 0.7.0-0.11.svn4022.4.fc9.x86_64
Wireless driver: iwl3945
Comment 1 Dan Williams 2008-10-19 22:37:37 EDT
This isn't an issue with NM actually, but something either in the supplicant or the drivers.  This bug has been around for a long time but I've traced it to layers below NM.

What's your kernel version, and what version of wpa_supplicant do you have on the machine?
Comment 2 August Schwerdfeger 2008-10-20 01:14:22 EDT
kernel-2.6.26.5-45.fc9.x86_64

wpa_supplicant-0.6.3-6.fc9.x86_64
Comment 3 Kevin J. Cummings 2009-01-19 01:54:18 EST
I am seeing this as well.

kernel-2.6.27.9-73.fc9.x86_64
wpa_supplicant-0.6.4-2.fc9.x86_64

iwl3945 as well.

Lately networking is disabled after returning from a suspend.  Re-enabling networking seems to work.

In the past I have also seen the system restore to the previous connection (which was 20+ miles away) and continue to think it was connected until I again suspended, then return to the original location and resumed.  Upon resume, NM usually had to prompt me for the network password (which was preloaded into the dialogue box) which I had to select CONNECT before it would reconnect me.

Shouldn't NM automatically restore the previous connection if it is still available?

If it helps, I've disabled HW scanning when loading the iwl3945 module as it helps me make a connection more reliably upon the initial system boot-up:

options iwl3945 disable_hw_scan=1
Comment 4 Craig White 2009-01-19 02:44:33 EST
also chipping in here...

no supplicant but using NM and wireless, suspend to disk and upon wakeup, network manager wireless connections are disabled until I 'service restart NetworkManager'

Fedora 10, Acer Aspire One (some Intel wireless chipset)
Comment 5 Dan Williams 2009-02-14 14:59:23 EST
(In reply to comment #3)
> I am seeing this as well.
> 
> kernel-2.6.27.9-73.fc9.x86_64
> wpa_supplicant-0.6.4-2.fc9.x86_64
> 
> iwl3945 as well.
> 
> Lately networking is disabled after returning from a suspend.  Re-enabling
> networking seems to work.

Kevin: this is a pm-utils issue caused by a dbus bug; see https://bugzilla.redhat.com/show_bug.cgi?id=477964 .
Comment 6 Dan Williams 2009-02-14 15:05:18 EST
For the original bug where NM tries to connect to an access point that's clearly not present, that's actually a kernel bug which I traced down this week.  The drivers weren't correctly aging scan results from before suspend, thus when NM woke up all the APs from before suspend looked like they had been seen less than 10 seconds ago.  These patches were submitted to the kernel this past week and should get into Fedora fairly soon; though we may need to backport them to recent kernels.

http://marc.info/?l=linux-wireless&m=123439060131140&w=2  (mac80211-based cards)
http://marc.info/?l=linux-wireless&m=123437688107698&w=2  (ipw2100 & ipw2200)

These patches should cover most cards in use today.
Comment 7 John W. Linville 2009-02-25 15:17:26 EST
I don't see a practical way to backport this (at least the cfg80211/mac80211 bits) to anything earlier than 2.6.30.  The patch depends on cfg80211 PM ops support and cfg80211-based scanning.  It could be rewritten, but it would require either layering violations or work-arounds, all to produce a one-off patch for an aging kernel.  I just can't justify the time.
Comment 8 Dan Williams 2009-02-25 15:44:58 EST
I'll do the backport for mac80211 if you like.  When I looked at it I didn't think it would be that bad in mac80211, but I may have been wrong.
Comment 9 John W. Linville 2009-02-25 16:00:48 EST
I'm happy for you to do that if you are interested.

The way I read it, you'd need to backport "cfg80211: add PM hooks" (which is trivial), then either backport all the cfg80211 scanning (yuk!) or add something to cfg80211_ops to notify mac80211 of suspend/resume events.  Given the later, then you'll need to reformulate our aging changes around bss->last_update.

Of course, YMMV...maybe you see something I missed! :-)
Comment 10 Dan Williams 2009-02-25 22:29:22 EST
Created attachment 333269 [details]
patch against 2.6.27.15 from F-9 updates as of 2009-02-25
Comment 11 Dan Williams 2009-02-25 22:30:58 EST
Created attachment 333270 [details]
patch against 2.6.28.2 from F-9 package CVS as of 2009-02-25
Comment 12 Dan Williams 2009-02-25 22:31:40 EST
Created attachment 333271 [details]
patch against 2.6.29-rc6 from F-10 package CVS as of 2009-02-25
Comment 13 Dan Williams 2009-02-25 22:33:34 EST
I hope the 2.6.29-rc6 patch that I did against the F-10 package CVS kernel will work for devel too; looks like Rawhide is using 2.6.29-rc6 as well.  Let me know if you find issues; I tested the patches using ath5k and suspend-to-disk.
Comment 14 Dan Williams 2009-02-25 22:40:09 EST
Created attachment 333273 [details]
patch against 2.6.29-rc6 from F-10 package CVS as of 2009-02-25

remove some debugging stuff that got left in the previous version of this patch
Comment 15 Dan Williams 2009-02-25 22:41:05 EST
If these look OK I'll do the ipw2x00 patches too.
Comment 16 Dan Williams 2009-02-26 07:19:08 EST
Created attachment 333319 [details]
ipw2x00 scan age patch against 2.6.28.2 from F-9 package CVS
Comment 17 Dan Williams 2009-02-26 07:20:09 EST
Created attachment 333320 [details]
ipw2x00 scan age patch against 2.6.29-rc6 from F-10 package CVS
Comment 18 John W. Linville 2009-02-26 15:19:40 EST
Hey, looks great.  I've pushed them into the current stable of Fedora kernels...thanks!
Comment 19 Fedora Update System 2009-03-24 18:55:34 EDT
kernel-2.6.27.21-78.2.41.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/kernel-2.6.27.21-78.2.41.fc9
Comment 20 Fedora Update System 2009-03-25 12:01:56 EDT
kernel-2.6.27.21-78.2.41.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing-newkey update kernel'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2009-2989
Comment 21 Fedora Update System 2009-04-02 13:22:01 EDT
kernel-2.6.27.21-78.2.41.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

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