All of lore.kernel.org
 help / color / mirror / Atom feed
From: "John W. Linville" <linville@tuxdriver.com>
To: Vivek Natarajan <vivek.natraj@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH] ath9k: Enable dynamic power save in ath9k.
Date: Fri, 9 Jan 2009 14:51:20 -0500	[thread overview]
Message-ID: <20090109195119.GC3371@tuxdriver.com> (raw)
In-Reply-To: <8e92b4100812290537q7605b39dg382fe5d42963c65a@mail.gmail.com>

On Mon, Dec 29, 2008 at 07:07:41PM +0530, Vivek Natarajan wrote:
> On Mon, Dec 29, 2008 at 5:41 PM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > On Mon, 2008-12-29 at 15:53 -0800, Vivek Natarajan wrote:
> >
> >> +#define ATH9K_PS_WAKEUP(sc)                                                \
> >> +     do {                                                                  \
> >> +             if (!atomic_read(&sc->ps_usecount) &&                         \
> >> +                (ah->ah_powerMode !=  ATH9K_PM_AWAKE)) {                   \
> >> +                     ah->ah_restoreMode = ah->ah_powerMode;                \
> >> +                     ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE);         \
> >> +             }                                                             \
> >> +             atomic_inc(&sc->ps_usecount);                                 \
> >> +     } while (0);
> >> +
> >> +#define ATH9K_PS_RESTORE(sc)                                               \
> >> +     do {                                                                  \
> >> +             if (atomic_dec_and_test(&sc->ps_usecount) &&                  \
> >> +                (sc->hw->conf.flags & IEEE80211_CONF_PS))                  \
> >> +                     ath9k_hw_setpower(sc->sc_ah, ah->ah_restoreMode);     \
> >> +     } while (0);
> >
> > I think those would be better as static inlines rather than macros.
> >
> > johannes
> 
> Thanks Johannes. I'll change them.
> 
> > Also, this seems racy, shouldn't it use something like if
> > (atomic_inc_return() == 1) ?
> 
> Thanks.This seems much better.

Did you repost this?  I don't see it.  Please (re?)send it to the
list w/ the requested changes.

John
-- 
John W. Linville		Linux should be at the core
linville@tuxdriver.com			of your literate lifestyle.

      reply	other threads:[~2009-01-09 20:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-29 23:53 [PATCH] ath9k: Enable dynamic power save in ath9k Vivek Natarajan
2008-12-29 12:11 ` Johannes Berg
2008-12-29 12:14   ` Johannes Berg
2008-12-29 12:23   ` Michael Buesch
2008-12-29 13:37   ` Vivek Natarajan
2009-01-09 19:51     ` John W. Linville [this message]

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=20090109195119.GC3371@tuxdriver.com \
    --to=linville@tuxdriver.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=vivek.natraj@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.