mac80211: avoid calling ieee80211_work_work unconditionally
authorHerton Ronaldo Krzesinski <herton@mandriva.com.br>
Mon, 13 Dec 2010 13:43:51 +0000 (11:43 -0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 13 Dec 2010 19:55:08 +0000 (14:55 -0500)
commit8808f64171deec62346888e156e3adb636e2a31a
tree7f34fd8c560b0fdb4426fe4dfcf16029a8ccb3c6
parent16cad7fba037b34ca32cc0adac65bc089d969fb8
mac80211: avoid calling ieee80211_work_work unconditionally

On suspend, there might be usb wireless drivers which wrongly trigger
the warning in ieee80211_work_work. If an usb driver doesn't have a
suspend hook, the usb stack will disconnect the device. On disconnect,
a mac80211 driver calls ieee80211_unregister_hw, which calls dev_close,
which calls ieee80211_stop, and in the end calls ieee80211_work_purge->
ieee80211_work_work.

The problem is that this call to ieee80211_work_purge comes after
mac80211 is suspended, triggering the warning even when we don't have
work queued in work_list (the expected case when already suspended),
because it always calls ieee80211_work_work.

So, just call ieee80211_work_work in ieee80211_work_purge if we really
have to abort work. This addresses the warning reported at
https://bugzilla.kernel.org/show_bug.cgi?id=24402

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/work.c