Bug 17942 - Laptop goes to s2ram twice, wireless don't work after resume
Summary: Laptop goes to s2ram twice, wireless don't work after resume
Status: RESOLVED OBSOLETE
Alias: None
Product: Networking
Classification: Unclassified
Component: Wireless (show other bugs)
Hardware: All Linux
: P1 high
Assignee: networking_wireless@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-06 16:02 UTC by Nikolay Rysev
Modified: 2012-09-10 11:38 UTC (History)
9 users (show)

See Also:
Kernel Version: 3.0
Subsystem:
Regression: No
Bisected commit-id:


Attachments
config of a kernel from /proc/config.gz (110.22 KB, text/plain)
2010-09-06 16:02 UTC, Nikolay Rysev
Details
dmesg output (137.01 KB, text/plain)
2010-12-27 09:20 UTC, Oldřich Jedlička
Details
kernel's .config (78.84 KB, text/plain)
2010-12-27 09:21 UTC, Oldřich Jedlička
Details
dmesg output (2.6.38-rc4) (80.79 KB, text/plain)
2011-02-15 18:31 UTC, Oldřich Jedlička
Details
dmesg output (3.0.0 from git) (84.45 KB, text/plain)
2011-08-01 19:26 UTC, Oldřich Jedlička
Details
`rfkill list` output (245 bytes, text/plain)
2011-08-17 18:15 UTC, Oldřich Jedlička
Details
`rfkill event` output (612 bytes, text/plain)
2011-08-17 18:16 UTC, Oldřich Jedlička
Details
`dmesg` output (83.60 KB, text/plain)
2011-08-17 18:17 UTC, Oldřich Jedlička
Details
`rfkill list` output (301 bytes, text/plain)
2012-08-12 07:06 UTC, Oldřich Jedlička
Details
`dmesg` output (152.56 KB, text/plain)
2012-08-12 07:09 UTC, Oldřich Jedlička
Details
`rfkill event` output (1020 bytes, text/plain)
2012-08-12 07:12 UTC, Oldřich Jedlička
Details

Description Nikolay Rysev 2010-09-06 16:02:50 UTC
Created attachment 29142 [details]
config of a kernel from /proc/config.gz

After going to suspend and resume laptop goes to suspend again itself. After second resume wireless (ath9k) don't working.

Looks like it's a mac80211 bug. 

dmesg says:
WARNING: at net/mac80211/work.c:845 ieee80211_work_work+0x2c5/0x11c0 [mac80211]()
Hardware name: F3Ka               
work scheduled while going to suspend
Modules linked in: ipv6 ext2 btusb bluetooth uvcvideo videodev snd_seq_dummy arc4 v4l1_compat v4l2_compat_ioctl32 snd_seq_oss snd_seq_midi_event ecb joydev snd_seq snd_seq_device snd_pcm_oss snd_hda_codec_si3054 snd_mixer_oss cpufreq_conservative cpufreq_powersave snd_hda_codec_realtek ath9k cpufreq_ondemand ath9k_common powernow_k8 snd_hda_intel ohci_hcd ath9k_hw freq_table snd_hda_codec ehci_hcd button asus_laptop sdhci_pci video usbcore processor battery ac psmouse thermal firewire_ohci serio_raw pcspkr output sparse_keymap evdev ath firewire_core edac_core snd_hwdep sdhci mac80211 sg k8temp i2c_piix4 mmc_core snd_pcm crc_itu_t cfg80211 edac_mce_amd snd_timer rfkill r8169 led_class mii snd soundcore snd_page_alloc mperf rtc_cmos rtc_core rtc_lib ext4 mbcache jbd2 crc16 sd_mod sr_mod cdrom pata_acpi ahci pata_atiixp libahci radeon libata ttm drm_kms_helper scsi_mod drm i2c_algo_bit i2c_core
Pid: 1370, comm: phy0 Tainted: G        W   2.6.35-ARCH #2
Call Trace:
 [<ffffffff8105284a>] warn_slowpath_common+0x7a/0xb0
 [<ffffffffa0433000>] ? ieee80211_work_work+0x0/0x11c0 [mac80211]
 [<ffffffff81052921>] warn_slowpath_fmt+0x41/0x50
 [<ffffffffa0430e00>] ? ieee80211_sta_work+0x0/0x6d0 [mac80211]
 [<ffffffffa04332c5>] ieee80211_work_work+0x2c5/0x11c0 [mac80211]
 [<ffffffff8137171d>] ? __mutex_lock_slowpath+0x22d/0x310
 [<ffffffffa0430f77>] ? ieee80211_sta_work+0x177/0x6d0 [mac80211]
 [<ffffffffa0433000>] ? ieee80211_work_work+0x0/0x11c0 [mac80211]
 [<ffffffff8106cc23>] worker_thread+0x173/0x310
 [<ffffffff810717c0>] ? autoremove_wake_function+0x0/0x40
 [<ffffffff81372c22>] ? _raw_spin_unlock_irqrestore+0x32/0x40
 [<ffffffff8106cab0>] ? worker_thread+0x0/0x310
 [<ffffffff8107122e>] kthread+0x8e/0xa0
 [<ffffffff8100aca4>] kernel_thread_helper+0x4/0x10
 [<ffffffff810711a0>] ? kthread+0x0/0xa0
 [<ffffffff8100aca0>] ? kernel_thread_helper+0x0/0x10
---[ end trace 50b48be5196d7c06 ]---

Hardware info:
Asus F3Ka laptop

$ lspci | grep -i atheros
07:00.0 Network controller: Atheros Communications Inc. AR5008 Wireless Network Adapter (rev 01)

$ lsmod | grep ath
ath9k                  77563  0 
ath9k_common            4902  1 ath9k
ath9k_hw              286570  2 ath9k,ath9k_common
ath                     8822  2 ath9k,ath9k_hw
mac80211              189270  2 ath9k,ath9k_common
cfg80211              144231  4 ath9k,ath9k_common,ath,mac80211
led_class               2363  3 ath9k,sdhci,asus_laptop
Comment 1 John W. Linville 2010-09-13 17:26:04 UTC
Here is the apparent warning:

        /*
         * ieee80211_queue_work() should have picked up most cases,
         * here we'll pick the the rest.
         */
        if (WARN(local->suspended, "work scheduled while going to suspend\n"))
                return;

ath9k guys, any idea how to figure-out what is being scheduled here?
Comment 2 Oldřich Jedlička 2010-12-27 09:19:31 UTC
Same problem here, Acer TravelMate 5730G. First and second suspend was OK, third one showed the warning and my Wifi (Intel's 5100 AGN, iwlagn driver) didn't start to work. I'm using kernel from airlied/drm-2.6.git, branch drm-fixes, commit 0f16830e9f6de0a44cf1e473ffa80cbe612d5beb - 2.6.37 rc5). I will attach full dmesg and kernel config.

To me it looks like the local->suspended should had been set to "false" already, because the system was going online at the time the log message appeared.
Comment 3 Oldřich Jedlička 2010-12-27 09:20:26 UTC
Created attachment 41682 [details]
dmesg output
Comment 4 Oldřich Jedlička 2010-12-27 09:21:33 UTC
Created attachment 41692 [details]
kernel's .config
Comment 5 shafi 2010-12-27 13:04:43 UTC
(In reply to comment #1)
> Here is the apparent warning:
> 
>         /*
>          * ieee80211_queue_work() should have picked up most cases,
>          * here we'll pick the the rest.
>          */
>         if (WARN(local->suspended, "work scheduled while going to
>         suspend\n"))
>                 return;
> 
> ath9k guys, any idea how to figure-out what is being scheduled here?

No idea John, the warning message is also there in iface.c of mac80211.
Comment 6 shafi 2010-12-27 13:07:59 UTC
(In reply to comment #0)
> Created an attachment (id=29142) [details]
> config of a kernel from /proc/config.gz
> 
> After going to suspend and resume laptop goes to suspend again itself. After
> second resume wireless (ath9k) don't working.
> 
> Looks like it's a mac80211 bug. 
> 
> dmesg says:
> WARNING: at net/mac80211/work.c:845 ieee80211_work_work+0x2c5/0x11c0
> [mac80211]()
> Hardware name: F3Ka               
> work scheduled while going to suspend
> Modules linked in: ipv6 ext2 btusb bluetooth uvcvideo videodev snd_seq_dummy
> arc4 v4l1_compat v4l2_compat_ioctl32 snd_seq_oss snd_seq_midi_event ecb
> joydev
> snd_seq snd_seq_device snd_pcm_oss snd_hda_codec_si3054 snd_mixer_oss
> cpufreq_conservative cpufreq_powersave snd_hda_codec_realtek ath9k
> cpufreq_ondemand ath9k_common powernow_k8 snd_hda_intel ohci_hcd ath9k_hw
> freq_table snd_hda_codec ehci_hcd button asus_laptop sdhci_pci video usbcore
> processor battery ac psmouse thermal firewire_ohci serio_raw pcspkr output
> sparse_keymap evdev ath firewire_core edac_core snd_hwdep sdhci mac80211 sg
> k8temp i2c_piix4 mmc_core snd_pcm crc_itu_t cfg80211 edac_mce_amd snd_timer
> rfkill r8169 led_class mii snd soundcore snd_page_alloc mperf rtc_cmos
> rtc_core
> rtc_lib ext4 mbcache jbd2 crc16 sd_mod sr_mod cdrom pata_acpi ahci
> pata_atiixp
> libahci radeon libata ttm drm_kms_helper scsi_mod drm i2c_algo_bit i2c_core
> Pid: 1370, comm: phy0 Tainted: G        W   2.6.35-ARCH #2
> Call Trace:
>  [<ffffffff8105284a>] warn_slowpath_common+0x7a/0xb0
>  [<ffffffffa0433000>] ? ieee80211_work_work+0x0/0x11c0 [mac80211]
>  [<ffffffff81052921>] warn_slowpath_fmt+0x41/0x50
>  [<ffffffffa0430e00>] ? ieee80211_sta_work+0x0/0x6d0 [mac80211]
>  [<ffffffffa04332c5>] ieee80211_work_work+0x2c5/0x11c0 [mac80211]
>  [<ffffffff8137171d>] ? __mutex_lock_slowpath+0x22d/0x310
>  [<ffffffffa0430f77>] ? ieee80211_sta_work+0x177/0x6d0 [mac80211]
>  [<ffffffffa0433000>] ? ieee80211_work_work+0x0/0x11c0 [mac80211]
>  [<ffffffff8106cc23>] worker_thread+0x173/0x310
>  [<ffffffff810717c0>] ? autoremove_wake_function+0x0/0x40
>  [<ffffffff81372c22>] ? _raw_spin_unlock_irqrestore+0x32/0x40
>  [<ffffffff8106cab0>] ? worker_thread+0x0/0x310
>  [<ffffffff8107122e>] kthread+0x8e/0xa0
>  [<ffffffff8100aca4>] kernel_thread_helper+0x4/0x10
>  [<ffffffff810711a0>] ? kthread+0x0/0xa0
>  [<ffffffff8100aca0>] ? kernel_thread_helper+0x0/0x10
> ---[ end trace 50b48be5196d7c06 ]---
> 
> Hardware info:
> Asus F3Ka laptop
> 
> $ lspci | grep -i atheros
> 07:00.0 Network controller: Atheros Communications Inc. AR5008 Wireless
> Network
> Adapter (rev 01)
> 
> $ lsmod | grep ath
> ath9k                  77563  0 
> ath9k_common            4902  1 ath9k
> ath9k_hw              286570  2 ath9k,ath9k_common
> ath                     8822  2 ath9k,ath9k_hw
> mac80211              189270  2 ath9k,ath9k_common
> cfg80211              144231  4 ath9k,ath9k_common,ath,mac80211
> led_class               2363  3 ath9k,sdhci,asus_laptop

Hi are you able to get this warning with the latest wireless-testing/compat-wireless with ath9k driver?(though it is there 2.6.37 rc5 as Oldrich had told with iwlagn)
Comment 7 Oldřich Jedlička 2011-02-15 18:07:34 UTC
I don't see the warning in 2.6.38-rc4 any more, but there is still the second one as seen in my previous dmesg:

[ 6196.236065] WARNING: at drivers/net/wireless/iwlwifi/iwl-core.c:1502 iwl_mac_remove_interface+0x120/0x130 [iwlcore]()
[ 6196.236069] Hardware name: TravelMate 5730                
[ 6196.236073] Modules linked in: ext2 uvcvideo videodev iwlagn iwlcore
[ 6196.236084] Pid: 10708, comm: kworker/1:0 Tainted: G        W   2.6.38-rc4+ #11
[ 6196.236088] Call Trace:
[ 6196.236098]  [<c0269d0d>] ? warn_slowpath_common+0x6d/0xa0
[ 6196.236106]  [<f83054c0>] ? iwl_mac_remove_interface+0x120/0x130 [iwlcore]
[ 6196.236114]  [<f83054c0>] ? iwl_mac_remove_interface+0x120/0x130 [iwlcore]
[ 6196.236120]  [<c0269d5d>] ? warn_slowpath_null+0x1d/0x20
[ 6196.236127]  [<f83054c0>] ? iwl_mac_remove_interface+0x120/0x130 [iwlcore]
[ 6196.236135]  [<c08c12d1>] ? _raw_spin_unlock_irqrestore+0x11/0x30
[ 6196.236141]  [<c088fc6b>] ? ieee80211_do_stop+0x49b/0x4f0
[ 6196.236147]  [<c026f74e>] ? local_bh_enable_ip+0x3e/0x90
[ 6196.236152]  [<c08c1137>] ? _raw_spin_unlock_bh+0x17/0x20
[ 6196.236158]  [<c088fcd2>] ? ieee80211_stop+0x12/0x20
[ 6196.236164]  [<c0749671>] ? __dev_close_many+0x61/0xb0
[ 6196.236170]  [<c04279e0>] ? kobj_bcast_filter+0x0/0x50
[ 6196.236176]  [<c074975c>] ? dev_close_many+0x6c/0xc0
[ 6196.236182]  [<c07497cf>] ? dev_close+0x1f/0x30
[ 6196.236189]  [<c0868258>] ? cfg80211_rfkill_set_block+0x48/0x70
[ 6196.236195]  [<c0868299>] ? cfg80211_rfkill_sync_work+0x19/0x20
[ 6196.236202]  [<c027e7e1>] ? process_one_work+0x121/0x370
[ 6196.236208]  [<c026398b>] ? get_parent_ip+0xb/0x40
[ 6196.236213]  [<c0868280>] ? cfg80211_rfkill_sync_work+0x0/0x20
[ 6196.236219]  [<c027ed6c>] ? worker_thread+0x11c/0x3b0
[ 6196.236226]  [<c027ec50>] ? worker_thread+0x0/0x3b0
[ 6196.236231]  [<c0282084>] ? kthread+0x74/0x80
[ 6196.236236]  [<c0282010>] ? kthread+0x0/0x80
[ 6196.236248]  [<c022f1f6>] ? kernel_thread_helper+0x6/0x10

The network doesn't come up, I have to restart the network service manually. I will attach the fresh dmesg.
Comment 8 Oldřich Jedlička 2011-02-15 18:31:11 UTC
Created attachment 47912 [details]
dmesg output (2.6.38-rc4)
Comment 9 Oldřich Jedlička 2011-02-15 18:33:45 UTC
Should I create another bug with the "second" warning? This one is marked as "NEEDINFO" and I can provide as much information as you wish :-)
Comment 10 Oldřich Jedlička 2011-03-08 17:32:57 UTC
Ping? Is there anything I can do to help with this?
Comment 11 Nikolay Rysev 2011-03-09 15:15:07 UTC
I can't test it now, because my laptop is broken.

I'll try to test it next week. Thanks.
Comment 12 John W. Linville 2011-04-27 19:22:46 UTC
Nikolay, is it working?
Comment 13 Nikolay Rysev 2011-04-28 08:31:23 UTC
Big sorry for delay.

Unfortunately, this laptop is totally dead, so I can't test it.
Comment 14 Oldřich Jedlička 2011-04-28 19:19:18 UTC
Oh, that is bad.

I've tested 2.6.39-rc2 with the same result as in comment #7 (same stack trace, only a different line of iwl-core.c) - if it helps.

[ 2142.666019] ------------[ cut here ]------------
[ 2142.666029] WARNING: at drivers/net/wireless/iwlwifi/iwl-core.c:1428 iwl_mac_remove_interface+0x120/0x130 [iwlagn]()
[ 2142.666031] Hardware name: TravelMate 5730                
[ 2142.666033] Modules linked in: ext2 uvcvideo videodev iwlagn
[ 2142.666040] Pid: 5223, comm: kworker/0:0 Tainted: G        W   2.6.39-drm+ #121
[ 2142.666042] Call Trace:
[ 2142.666049]  [<c026a45d>] warn_slowpath_common+0x6d/0xa0
[ 2142.666056]  [<f8904600>] ? iwl_mac_remove_interface+0x120/0x130 [iwlagn]
[ 2142.666062]  [<f8904600>] ? iwl_mac_remove_interface+0x120/0x130 [iwlagn]
...
Comment 15 wey-yi.w.guy 2011-04-28 21:34:20 UTC
the "warning" just indicate the interface going down not match the interface in the context.

How you cause this to happen? I am not sure how to reproduce the problem here.

Thanks
Wey
Comment 16 Oldřich Jedlička 2011-04-29 18:46:05 UTC
This is easy - just suspend to RAM and resume. It is 100% reproducible on my system - it happens every time. I suspect that this is the reason why my wifi doesn't come-up and I have to restart the wifi services (Gentoo, `/etc/init.d/net.wifi restart` - it reconfigures wifi and restarts wpa_supplicant).
Comment 17 John W. Linville 2011-07-29 16:33:22 UTC
Does this problem persist with current kernels (3.0 or later)?
Comment 18 Oldřich Jedlička 2011-07-31 18:18:50 UTC
(In reply to comment #17)
> Does this problem persist with current kernels (3.0 or later)?

For me - yes. Just suspend and resume, the warning is still there and the wireless doesn't come-up, I have to restart wpa_supplicant (this suffices). Tested with latest drm-radeon-testing branch of drm-2.6.git tree (3.0.0-rc7).

I will try it with latest 3.0 vanilla kernel too and attach dmesg output.
Comment 19 wey-yi.w.guy 2011-08-01 15:33:41 UTC
what if apply the following patch?

commit 94f9b97be5b3bf67392e43fb7f567721b09142c2
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Thu Jul 14 16:48:54 2011 +0200

    mac80211: be more careful in suspend/resume
Comment 20 Oldřich Jedlička 2011-08-01 19:20:39 UTC
No, it doesn't work. The patch is part of the current vanilla git tree and it doesn't make any difference.
Comment 21 wey-yi.w.guy 2011-08-01 19:23:01 UTC
ok, thanks, just thought it might related,so the bug still there.

Wey
Comment 22 Oldřich Jedlička 2011-08-01 19:26:41 UTC
Created attachment 67312 [details]
dmesg output (3.0.0 from git)
Comment 23 Oldřich Jedlička 2011-08-01 19:48:27 UTC
The warning is something about the rfkill. Couldn't this be connected to acer-wmi (Acer TravelMate 5730G notebook) and its handling of rfkill too? And why the rfkill handling (cfg80211_rfkill_sync_work) is trying to stop the wifi?
Comment 24 Johannes Berg 2011-08-09 12:05:09 UTC
This bug report is getting confusing ... I'll just read from comment #22 onwards.

Yes, the question is -- why is it trying to stop wifi?

The reason we get the warning is that it's removing an interface that hasn't been reconfigured yet. That's not so bad really.

After you wake up on this system, what's the rfkill status? Can you suspend/resume while running "rfkill event" and also give us the output of "rfkill list" before suspend?
Comment 25 Oldřich Jedlička 2011-08-17 18:15:01 UTC
Created attachment 69072 [details]
`rfkill list` output
Comment 26 Oldřich Jedlička 2011-08-17 18:16:23 UTC
Created attachment 69082 [details]
`rfkill event` output
Comment 27 Oldřich Jedlička 2011-08-17 18:17:22 UTC
Created attachment 69092 [details]
`dmesg` output
Comment 28 Oldřich Jedlička 2012-08-12 07:05:52 UTC
Latest kernel status (3.6.0-rc1 with latest drm from David Airlie) is that the wifi goes up, but the log contains much more warn_slowpath_common.
Comment 29 Oldřich Jedlička 2012-08-12 07:06:40 UTC
Created attachment 77401 [details]
`rfkill list` output
Comment 30 Oldřich Jedlička 2012-08-12 07:09:41 UTC
Created attachment 77411 [details]
`dmesg` output

I've made suspend twice, first one is around time stamp 560.8, second one around 600.5. Strange is that sometimes the cfg80211 has sometimes log line "Calling CRDA for country: DE" and sometimes not.
Comment 31 Oldřich Jedlička 2012-08-12 07:12:16 UTC
Created attachment 77421 [details]
`rfkill event` output

events from rfkill - the first wake-up is at 1344754639.058319, second one at 1344754685.862973. The log contains line that the rfkill bit was toggled to disable the radio and few moments later to enable the radio.
Comment 32 Oldřich Jedlička 2012-08-12 07:13:45 UTC
If you wish, I can create a new bug report not to confuse with the original one, because this one looks like rfkill+wifi startup sequencing problem.
Comment 33 Johannes Berg 2012-09-05 14:00:49 UTC
Totally confused about this bug, what's the status? Which bug(s) are you still observing?
Comment 34 Oldřich Jedlička 2012-09-05 20:36:00 UTC
I wrote it in comment #28 - the resuming works, the wifi always comes up. There is only a lot of warn_slowpath_common messages in logs. So I don't see the original problem, but it looks like it works by accident.

I offered to create a new bug report in comment #32, so that this one could be closed. There is no user visible problem any more.
Comment 35 Johannes Berg 2012-09-10 11:29:25 UTC
Ok let's do that then, because that bug is likely somewhere else entirely (platform rfkill?)
Comment 36 Johannes Berg 2012-09-10 11:29:50 UTC
(looks like I can't close the bug)

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