* [PATCH] mac80211: quiesce vif before suspending
@ 2011-06-16 8:49 Eliad Peller
2011-06-19 8:11 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Eliad Peller @ 2011-06-16 8:49 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
Cancel all relevant timers/works before suspending (wowlan).
This patch handles the following warning:
WARNING: at net/mac80211/util.c:565 queueing ieee80211 work while going to suspend
Backtrace:
[<bf07b598>] (ieee80211_can_queue_work+0x0/0x4c [mac80211])
[<bf07c28c>] (ieee80211_queue_work+0x0/0x30 [mac80211])
[<bf0690dc>] (ieee80211_sta_timer+0x0/0x3c [mac80211])
[<c00a3008>] (run_timer_softirq+0x0/0x220)
[<c009e530>] (__do_softirq+0x0/0x130)
[<c009e660>] (irq_exit+0x0/0xb4)
[<c004c4a0>] (ipi_timer+0x0/0x4c)
[<c0046350>] (do_local_timer+0x0/0x88)
[<c00488ec>] (cpu_idle+0x0/0xe0)
[<c05294e8>] (rest_init+0x0/0xe0)
[<c0008958>] (start_kernel+0x0/0x314)
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
net/mac80211/pm.c | 43 +++++++++++++++++++++++++++----------------
1 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
index 730778a..67839eb 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -6,6 +6,28 @@
#include "driver-ops.h"
#include "led.h"
+/* return value indicates whether the driver should be further notified */
+static bool ieee80211_quiesce(struct ieee80211_sub_if_data *sdata)
+{
+ switch (sdata->vif.type) {
+ case NL80211_IFTYPE_STATION:
+ ieee80211_sta_quiesce(sdata);
+ return true;
+ case NL80211_IFTYPE_ADHOC:
+ ieee80211_ibss_quiesce(sdata);
+ return true;
+ case NL80211_IFTYPE_MESH_POINT:
+ ieee80211_mesh_quiesce(sdata);
+ return true;
+ case NL80211_IFTYPE_AP_VLAN:
+ case NL80211_IFTYPE_MONITOR:
+ /* don't tell driver about this */
+ return false;
+ default:
+ return true;
+ }
+}
+
int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
{
struct ieee80211_local *local = hw_to_local(hw);
@@ -54,6 +76,10 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
local->quiescing = false;
return err;
}
+ list_for_each_entry(sdata, &local->interfaces, list) {
+ cancel_work_sync(&sdata->work);
+ ieee80211_quiesce(sdata);
+ }
goto suspend;
}
@@ -82,23 +108,8 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
list_for_each_entry(sdata, &local->interfaces, list) {
cancel_work_sync(&sdata->work);
- switch(sdata->vif.type) {
- case NL80211_IFTYPE_STATION:
- ieee80211_sta_quiesce(sdata);
- break;
- case NL80211_IFTYPE_ADHOC:
- ieee80211_ibss_quiesce(sdata);
- break;
- case NL80211_IFTYPE_MESH_POINT:
- ieee80211_mesh_quiesce(sdata);
- break;
- case NL80211_IFTYPE_AP_VLAN:
- case NL80211_IFTYPE_MONITOR:
- /* don't tell driver about this */
+ if (!ieee80211_quiesce(sdata))
continue;
- default:
- break;
- }
if (!ieee80211_sdata_running(sdata))
continue;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mac80211: quiesce vif before suspending
2011-06-16 8:49 [PATCH] mac80211: quiesce vif before suspending Eliad Peller
@ 2011-06-19 8:11 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2011-06-19 8:11 UTC (permalink / raw)
To: Eliad Peller; +Cc: linux-wireless
On Thu, 2011-06-16 at 11:49 +0300, Eliad Peller wrote:
> Cancel all relevant timers/works before suspending (wowlan).
>
> This patch handles the following warning:
> WARNING: at net/mac80211/util.c:565 queueing ieee80211 work while going to suspend
> Backtrace:
> [<bf07b598>] (ieee80211_can_queue_work+0x0/0x4c [mac80211])
> [<bf07c28c>] (ieee80211_queue_work+0x0/0x30 [mac80211])
> [<bf0690dc>] (ieee80211_sta_timer+0x0/0x3c [mac80211])
> [<c00a3008>] (run_timer_softirq+0x0/0x220)
> [<c009e530>] (__do_softirq+0x0/0x130)
> [<c009e660>] (irq_exit+0x0/0xb4)
> [<c004c4a0>] (ipi_timer+0x0/0x4c)
> [<c0046350>] (do_local_timer+0x0/0x88)
> [<c00488ec>] (cpu_idle+0x0/0xe0)
> [<c05294e8>] (rest_init+0x0/0xe0)
> [<c0008958>] (start_kernel+0x0/0x314)
Yeah I think this was the patch you told be about earlier, thanks.
johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-19 8:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-16 8:49 [PATCH] mac80211: quiesce vif before suspending Eliad Peller
2011-06-19 8:11 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).