ath9k: move mac80211 workqueue cancelations
cover ath9k: move mac80211 workqueue cancelations
This corrects the ath9k cancelations of work for the mac80211 workqueue on the stop callback.
Luis R. Rodriguez (3):
ath9k: re-order cancelling of work on mac80211 workqueue
ath9k: move cancel_delayed_work_sync() out of ath_deinit_leds()
ath9k: move workqueue cancels to stop callback
drivers/net/wireless/ath/ath9k/main.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-)
PATCH 1/3 ath9k: re-order cancelling of work on mac80211 workqueue
ath9k uses the mac80211 workqueue for 4 different types of work:
* Led blink work
* TX hang monitoring work
* internal wiphy schedular work
* channel change work done for internal wiphy schedular
Since the internal wiphy schedular can end up kicking off some channel channel change work we should first cancel the wiphy schedular work and then the channel change work.
The TX hang work can be cancelled second since we're going down anyway.
--- drivers/net/wireless/ath/ath9k/main.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +2 -2
@@ -1253,9 +1253,9 @@ void ath_detach(struct ath_softc *sc)DPRINTF (sc,ATH_DBG_CONFIG ,"Detach ATH hw\n" );ath_deinit_leds (sc); -cancel_work_sync (&sc->chan_work); -cancel_delayed_work_sync (&sc->wiphy_work);cancel_delayed_work_sync (&sc->tx_complete_work); +cancel_delayed_work_sync (&sc->wiphy_work); +cancel_work_sync (&sc->chan_work);for (i =0 ; i < sc->num_sec_wiphy; i++) {struct ath_wiphy *aphy = sc->sec_wiphy[i];
Signature · 1 line
1.6.0.4
PATCH 2/3 ath9k: move cancel_delayed_work_sync() out of ath_deinit_leds()
In reply to Luis R. RodriguezWe do this as we'll be moving the cancel elsewhere later.
--- drivers/net/wireless/ath/ath9k/main.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +4 -2
@@ -1057,7 +1057,6 @@ static void ath_unregister_led(struct ath_led *led)static void ath_deinit_leds (struct ath_softc *sc) { -cancel_delayed_work_sync (&sc->ath_led_blink_work);ath_unregister_led (&sc->assoc_led); sc->sc_flags &= ~SC_OP_LED_ASSOCIATED ;ath_unregister_led (&sc->tx_led);
@@ -1114,6 +1113,7 @@ static void ath_init_leds(struct ath_softc *sc)return ; fail: +cancel_delayed_work_sync (&sc->ath_led_blink_work);ath_deinit_leds (sc); }
@@ -1252,11 +1252,13 @@ void ath_detach(struct ath_softc *sc)DPRINTF (sc,ATH_DBG_CONFIG ,"Detach ATH hw\n" ); -ath_deinit_leds (sc); +cancel_delayed_work_sync (&sc->ath_led_blink_work);cancel_delayed_work_sync (&sc->tx_complete_work);cancel_delayed_work_sync (&sc->wiphy_work);cancel_work_sync (&sc->chan_work); +ath_deinit_leds (sc); +for (i =0 ; i < sc->num_sec_wiphy; i++) {struct ath_wiphy *aphy = sc->sec_wiphy[i];if (aphy ==NULL )
Signature · 1 line
1.6.0.4
PATCH 3/3 ath9k: move workqueue cancels to stop callback
In reply to Luis R. RodriguezWe should be cancelling our work at the stop callback since we are borrowing the mac80211 workqueue for our work. As it stands mac80211 expects this for suspend purposes.
The ath9k specific virtual wiphy stuff need only be cancelled only when the we have no secondary virtual wiphys.
--- drivers/net/wireless/ath/ath9k/main.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +8 -5
@@ -1252,11 +1252,6 @@ void ath_detach(struct ath_softc *sc)DPRINTF (sc,ATH_DBG_CONFIG ,"Detach ATH hw\n" ); -cancel_delayed_work_sync (&sc->ath_led_blink_work); -cancel_delayed_work_sync (&sc->tx_complete_work); -cancel_delayed_work_sync (&sc->wiphy_work); -cancel_work_sync (&sc->chan_work); -ath_deinit_leds (sc);for (i =0 ; i < sc->num_sec_wiphy; i++) {
@@ -2092,6 +2087,14 @@ static void ath9k_stop(struct ieee80211_hw *hw) aphy->state =ATH_WIPHY_INACTIVE ; +cancel_delayed_work_sync (&sc->ath_led_blink_work); +cancel_delayed_work_sync (&sc->tx_complete_work); + +if (!sc->num_sec_wiphy) { +cancel_delayed_work_sync (&sc->wiphy_work); +cancel_work_sync (&sc->chan_work); + } +if (sc->sc_flags &SC_OP_INVALID ) {DPRINTF (sc,ATH_DBG_ANY ,"Device not present\n" );return ;
Signature · 1 line
1.6.0.4
PATCH 3/3 ath9k: move workqueue cancels to stop callback
Quoted 6 lines · Luis R. Rodriguez
We should be cancelling our work at the stop callback since we are borrowing the mac80211 workqueue for our work. As it stands mac80211 expects this for suspend purposes.
The ath9k specific virtual wiphy stuff need only be cancelled only when the we have no secondary virtual wiphys.
inverted logic here?
johannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20090727/28e556c2/attachment-0001.pgp
PATCH 3/3 ath9k: move workqueue cancels to stop callback
Quoted 9 lines · Johannes Berg
Quoted 6 lines · Luis R. Rodriguez
We should be cancelling our work at the stop callback since we are borrowing the mac80211 workqueue for our work. As it stands mac80211 expects this for suspend purposes.
The ath9k specific virtual wiphy stuff need only be cancelled only when the we have no secondary virtual wiphys.
inverted logic here?
Nope, ie the sc->num_sec_wiphy wil be decremented on device removal. As long as there is some secondary wiphy it means we need our internal scheduler working and work is being queued. So upon suspend we'll iterate over all interfaces and remove them unless you have WoW enabled (eventually), the last interface drv_stop() then would ensure to clear the virtual scheduler work.
Luis