Bug 466136 - wifi: age scan results on resume from suspend
Summary: wifi: age scan results on resume from suspend
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 9
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: John W. Linville
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-10-08 16:43 UTC by August Schwerdfeger
Modified: 2009-04-02 17:22 UTC (History)
8 users (show)

Fixed In Version: 2.6.27.21-78.2.41.fc9
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-04-02 17:22:07 UTC
Type: ---
Embargoed:


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-26 03:29 UTC, 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-26 03:30 UTC, 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-26 03:31 UTC, 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-26 03:40 UTC, 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 12:19 UTC, 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 12:20 UTC, Dan Williams
no flags Details | Diff

Description August Schwerdfeger 2008-10-08 16:43:14 UTC
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-20 02:37:37 UTC
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 05:14:22 UTC
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 06:54:18 UTC
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 07:44:33 UTC
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 19:59:23 UTC
(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 20:05:18 UTC
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 20:17:26 UTC
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 20:44:58 UTC
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 21:00:48 UTC
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-26 03:29:22 UTC
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-26 03:30:58 UTC
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-26 03:31:40 UTC
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-26 03:33:34 UTC
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-26 03:40:09 UTC
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-26 03:41:05 UTC
If these look OK I'll do the ipw2x00 patches too.

Comment 16 Dan Williams 2009-02-26 12:19:08 UTC
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 12:20:09 UTC
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 20:19:40 UTC
Hey, looks great.  I've pushed them into the current stable of Fedora kernels...thanks!

Comment 19 Fedora Update System 2009-03-24 22:55:34 UTC
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 16:01:56 UTC
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 17:22:01 UTC
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.