Linux wireless drivers development
 help / color / mirror / Atom feed
From: Vivek Natarajan <vivek.natraj@gmail.com>
To: Sujith <m.sujith@gmail.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] ath9k: Handle power modes in isr for power save.
Date: Tue, 3 Mar 2009 15:07:51 +0530	[thread overview]
Message-ID: <8e92b4100903030137r4c412ccdu17020c482d6cb1b3@mail.gmail.com> (raw)
In-Reply-To: <18860.6782.4168.588808@gargle.gargle.HOWL>

On Mon, Mar 2, 2009 at 11:12 PM, Sujith <m.sujith@gmail.com> wrote:
> Vivek Natarajan wrote:
>> Restore network sleep mode in isr if power save is enabled.
>>
>> Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
>> ---
>> =A0drivers/net/wireless/ath9k/ath9k.h | =A0 =A03 ++-
>> =A0drivers/net/wireless/ath9k/main.c =A0| =A0 =A02 ++
>> =A02 files changed, 4 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath9k/ath9k.h b/drivers/net/wirele=
ss/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_so=
ftc *sc)
>> =A0static inline void ath9k_ps_restore(struct ath_softc *sc)
>> =A0{
>> =A0 =A0 =A0 if (atomic_dec_and_test(&sc->ps_usecount))
>> - =A0 =A0 =A0 =A0 =A0 =A0 if (sc->hw->conf.flags & IEEE80211_CONF_PS=
)
>> + =A0 =A0 =A0 =A0 =A0 =A0 if ((sc->hw->conf.flags & IEEE80211_CONF_P=
S) &&
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 !(sc->sc_flags & SC_OP_WAIT_FOR_BE=
ACON))
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ath9k_hw_setpower(sc->sc=
_ah,
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 sc->sc_ah->restore_mode);
>> =A0}
>
> 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 prot=
ection(?)

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-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-03-03  9:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-02 14:55 [PATCH] ath9k: Handle power modes in isr for power save Vivek Natarajan
2009-03-02 17:42 ` Sujith
2009-03-03  9:37   ` Vivek Natarajan [this message]
2009-03-03  9:50     ` Sujith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e92b4100903030137r4c412ccdu17020c482d6cb1b3@mail.gmail.com \
    --to=vivek.natraj@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=m.sujith@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox