All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: ath5k-devel@lists.ath5k.org, linux-wireless@vger.kernel.org,
	linville@tuxdriver.com, me@bobcopeland.com, mcgrof@gmail.com,
	nbd@openwrt.org, proski@gnu.org
Subject: Re: [PATCH 4/4] ath5k: Use SWI to trigger calibration
Date: Sat, 01 Aug 2009 10:19:25 +0200	[thread overview]
Message-ID: <4A73FA8D.5030804@gmail.com> (raw)
In-Reply-To: <20090801054649.GA8390@makis>

On 08/01/2009 07:46 AM, Nick Kossifidis wrote:
> --- a/drivers/net/wireless/ath/ath5k/phy.c
> +++ b/drivers/net/wireless/ath/ath5k/phy.c
> @@ -1104,6 +1104,26 @@ int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel)
>    PHY calibration
>  \*****************/
>  
> +void
> +ath5k_hw_calibration_poll(struct ath5k_hw *ah)
> +{
> +	u32 current_time = (jiffies / HZ);

jiffies are long. And they start from negative to catch such issues. You
were lucky and/or tested after 5 minutes of uptime ;).

> +	u32 cal_intval = ah->ah_cal_intval;
> +
> +	if (!ah->ah_cal_tstamp)
> +		ah->ah_cal_tstamp = current_time;
> +
> +	/* For now we always do full calibration
> +	 * Mark software interrupt mask and fire software
> +	 * interrupt (bit gets auto-cleared) */
> +	if ((current_time - ah->ah_cal_tstamp) >= cal_intval) {

Aiee, this should be converted to time_after(). You don't count with a
wrap here. (The same as above.)

> +		ah->ah_cal_tstamp = current_time;
> +		ah->ah_swi_mask = AR5K_SWI_FULL_CALIBRATION;
> +		AR5K_REG_ENABLE_BITS(ah, AR5K_CR, AR5K_CR_SWI);
> +	}
> +
> +}


  reply	other threads:[~2009-08-01  8:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-31 18:10 [PATCH 4/4] ath5k: Use SWI to trigger calibration Nick Kossifidis
2009-07-31 18:15 ` Luis R. Rodriguez
2009-07-31 18:25   ` [ath5k-devel] " Nick Kossifidis
2009-07-31 18:48     ` Luis R. Rodriguez
2009-07-31 19:09     ` Pavel Roskin
2009-07-31 19:35       ` Nick Kossifidis
2009-07-31 19:43         ` Pavel Roskin
2009-07-31 19:11     ` Bob Copeland
2009-07-31 19:52       ` Nick Kossifidis
2009-08-01 13:22         ` Bob Copeland
2009-08-01 13:31           ` Nick Kossifidis
2009-08-02 16:14             ` Bob Copeland
2009-07-31 18:34 ` Nick Kossifidis
2009-08-01  5:46 ` Nick Kossifidis
2009-08-01  8:19   ` Jiri Slaby [this message]
2009-08-01  8:21     ` Johannes Berg
2009-08-01  8:24       ` Jiri Slaby
2009-08-01  8:28         ` Johannes Berg
2009-08-01  8:31           ` [ath5k-devel] " Nick Kossifidis
2009-08-01  8:35             ` Jiri Slaby
2009-08-03 17:54           ` Nick Kossifidis
2009-08-07 14:55             ` John W. Linville
2009-08-07 19:50               ` Nick Kossifidis

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=4A73FA8D.5030804@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=ath5k-devel@lists.ath5k.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mcgrof@gmail.com \
    --cc=me@bobcopeland.com \
    --cc=nbd@openwrt.org \
    --cc=proski@gnu.org \
    /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.