On Mon, Mar 2, 2009 at 11:12 PM, Sujith <m.sujith@xxxxxxxxx> wrote: > Vivek Natarajan wrote: >> Restore network sleep mode in isr if power save is enabled. >> >> Signed-off-by: Vivek Natarajan <vnatarajan@xxxxxxxxxxx> >> --- >> drivers/net/wireless/ath9k/ath9k.h | 3 ++- >> drivers/net/wireless/ath9k/main.c | 2 ++ >> 2 files changed, 4 insertions(+), 1 deletions(-) >> >> diff --git a/drivers/net/wireless/ath9k/ath9k.h b/drivers/net/wireless/ath9k/ath9k.h >> index 6481ea4..69292f3 100644 >> --- a/drivers/net/wireless/ath9k/ath9k.h >> +++ b/drivers/net/wireless/ath9k/ath9k.h >> @@ -677,7 +677,8 @@ static inline void ath9k_ps_wakeup(struct ath_softc *sc) >> static inline void ath9k_ps_restore(struct ath_softc *sc) >> { >> if (atomic_dec_and_test(&sc->ps_usecount)) >> - if (sc->hw->conf.flags & IEEE80211_CONF_PS) >> + if ((sc->hw->conf.flags & IEEE80211_CONF_PS) && >> + !(sc->sc_flags & SC_OP_WAIT_FOR_BEACON)) >> ath9k_hw_setpower(sc->sc_ah, >> sc->sc_ah->restore_mode); >> } > > This needs proper locking. SC_OP_WAIT_FOR_BEACON is being changed in rx_tasklet and in isr which are mutually exclusive. Even though it might be changed in these two regions, it won't affect the ps_wake/ps_restore cycle. IEEE80211_CONF_PS is changed in siwpower() and also in dynamic_ps_work. Even if it is changed while we are executing this ps_restore, there won't be any race condition on ps_wake/ps_restore cycle and it will work fine. hw_setpower is just a register write function which may not need a protection(?) And for the protection of ps_wake/ps_restore itself, there is ps_count(atomic) which takes care of properly restoring power save state. Overall, from my perspective there is no need for any more lock. Thanks, Vivek. -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html