linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: Bruno Randolf <br1@einfach.org>
Cc: "Luis R. Rodriguez" <mcgrof@gmail.com>,
	Vasanth Thiagarajan <Vasanth.Thiagarajan@Atheros.com>,
	"ath5k-devel@lists.ath5k.org" <ath5k-devel@lists.ath5k.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"linville@tuxdriver.com" <linville@tuxdriver.com>
Subject: Re: [ath5k-devel] [PATCH 3/5] ath9k: Use common cycle counters
Date: Tue, 5 Oct 2010 19:15:58 -0700	[thread overview]
Message-ID: <20101006021558.GB2255@tux> (raw)
In-Reply-To: <201010061100.01949.br1@einfach.org>

On Tue, Oct 05, 2010 at 07:00:01PM -0700, Bruno Randolf wrote:
> On Wed October 6 2010 10:18:07 Luis R. Rodriguez wrote:
> > On Tue, Oct 5, 2010 at 2:55 AM, Bruno Randolf <br1@einfach.org> wrote:
> > > Update ath9k to use the common cycle counters.
> > > 
> > > This also includes other changes from Felix Fietkaus "[PATCH 2/4]
> > > ath9k_hw: merge codepaths that access the cycle counter registers".
> > > 
> > > Compile tested only. ath9k team please review...
> > > 
> > > Signed-off-by: Felix Fietkau <nbd@openwrt.org>
> > > Signed-off-by: Bruno Randolf <br1@einfach.org>
> > > ---
> > >  drivers/net/wireless/ath/ath9k/ani.c        |   87
> > > +++------------------------ drivers/net/wireless/ath/ath9k/ani.h      
> > >  |    6 --
> > >  drivers/net/wireless/ath/ath9k/ar5008_phy.c |    9 +--
> > >  drivers/net/wireless/ath/ath9k/ar9003_phy.c |   18 +++---
> > >  4 files changed, 22 insertions(+), 98 deletions(-)
> > > 
> > > diff --git a/drivers/net/wireless/ath/ath9k/ani.c
> > > b/drivers/net/wireless/ath/ath9k/ani.c index 0496f96..0c0d01d 100644
> > > --- a/drivers/net/wireless/ath/ath9k/ani.c
> > > +++ b/drivers/net/wireless/ath/ath9k/ani.c
> > > @@ -549,47 +549,21 @@ static u8 ath9k_hw_chan_2_clockrate_mhz(struct
> > > ath_hw *ah)
> > > 
> > >  static int32_t ath9k_hw_ani_get_listen_time(struct ath_hw *ah)
> > >  {
> > > -       struct ar5416AniState *aniState;
> > >        struct ath_common *common = ath9k_hw_common(ah);
> > > -       u32 txFrameCount, rxFrameCount, cycleCount;
> > > -       int32_t listenTime;
> > > +       int32_t listen_time;
> > > +       int32_t clock_rate;
> > > 
> > > -       txFrameCount = REG_READ(ah, AR_TFCNT);
> > > -       rxFrameCount = REG_READ(ah, AR_RFCNT);
> > > -       cycleCount = REG_READ(ah, AR_CCCNT);
> > > +       ath_hw_cycle_counters_lock(common);
> > 
> > Note the lock call here. This is what I'd like to see avoided. Can you
> > perhaps have the lock called within the core driver instead, that is,
> > add the lock call for the caller of ath9k_hw_ani_get_listen_time(). In
> > this case I see ath9k_hw_ani_get_listen_time() is static though and so
> > is its caller but ultimately we get to ath9k_hw_ani_monitor(). What
> > I'm saying is how about calling the
> > ath_hw_cycle_counters_lock(common); right before
> > ath9k_hw_ani_monitor().
> 
> that would hold the lock for an unnecessarily long amount of time.

I see..

> i'm not working with ath9k, so can i leave it to you to deal with this in 
> subsequent patches? in the mean time, if you prefer, i can omit the lock.

I can't think of a good alternative, so just ahead with it, if it creates a
problem we can remove it.

  Luis

  reply	other threads:[~2010-10-06  2:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-05  9:55 [PATCH 1/5] ath: Add common function for reading cycle counters Bruno Randolf
2010-10-05  9:55 ` [PATCH 2/5] ath5k: Use common cycle counters for ANI Bruno Randolf
2010-10-05  9:55 ` [PATCH 3/5] ath9k: Use common cycle counters Bruno Randolf
2010-10-05 20:14   ` [ath5k-devel] " Luis R. Rodriguez
2010-10-06  1:10     ` Bruno Randolf
2010-10-06  1:13       ` Luis R. Rodriguez
2010-10-06  1:18   ` Luis R. Rodriguez
2010-10-06  2:00     ` Bruno Randolf
2010-10-06  2:15       ` Luis R. Rodriguez [this message]
2010-10-05  9:55 ` [PATCH 4/5] nl80211/mac80211: Add channel utilization to survey Bruno Randolf
2010-10-05 22:36   ` Luis R. Rodriguez
2010-10-06  2:35     ` Bruno Randolf
2010-10-06  9:54   ` Helmut Schaa
2010-10-07  1:03     ` Bruno Randolf
2010-10-07  3:02       ` [ath5k-devel] " Luis R. Rodriguez
2010-10-07  6:51       ` Helmut Schaa
2010-10-07  7:06         ` Bruno Randolf
2010-10-07  7:35           ` Jonathan Guerin
2010-10-07  7:44           ` Helmut Schaa
2010-10-07  7:52             ` Johannes Berg
2010-10-08 17:41               ` Helmut Schaa
2010-10-05  9:55 ` [PATCH 5/5] ath5k: Add busy ratios to survey data Bruno Randolf
2010-10-05 22:38   ` Luis R. Rodriguez
2010-10-06  2:25     ` Bruno Randolf
2010-10-06  2:45       ` Felix Fietkau
2010-10-06  2:50         ` Bruno Randolf
2010-10-06 14:13           ` Luis R. Rodriguez

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=20101006021558.GB2255@tux \
    --to=lrodriguez@atheros.com \
    --cc=Vasanth.Thiagarajan@Atheros.com \
    --cc=ath5k-devel@lists.ath5k.org \
    --cc=br1@einfach.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mcgrof@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;
as well as URLs for NNTP newsgroup(s).