All of lore.kernel.org
 help / color / mirror / Atom feed
From: wwguy <wey-yi.w.guy@intel.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Intel Linux Wireless <ilw@linux.intel.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 5/5] iwlwifi: avoid too frequent recover from statistics
Date: Tue, 08 Feb 2011 07:45:53 -0800	[thread overview]
Message-ID: <1297179953.20613.38.camel@wwguy-ubuntu> (raw)
In-Reply-To: <1297153919-18766-5-git-send-email-sgruszka@redhat.com>

Hi Stanislaw,

On Tue, 2011-02-08 at 00:31 -0800, Stanislaw Gruszka wrote:
> Usually H/W generate statistics notify once per about 100ms, but
> sometimes we can receive notify in shorter time, even 2 ms.
> 
> This can be problem for plcp health and ack health checking.
> 
> I.e. with 2 plcp errors happens randomly in 2 ms duration, we
> exceed plcp delta threshold equal to 100 (2*100/2).
> 
> Also checking ack's in short time, can results not necessary false
> positive and firmware reset, for example when channel is noised and
> we do not receive ACKs frames or when remote device does not send
> ACKs at the moment.
> 
> Patch change code, to do statistic check and possible recovery only
> if 99ms elapsed from last check. Forced delay should assure we have
> good statistic data to estimate hardware state.
> 
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
>  drivers/net/wireless/iwlwifi/iwl-3945.c     |   24 ++++++++------
>  drivers/net/wireless/iwlwifi/iwl-agn-rx.c   |   46 +++++++++++++++++----------
>  drivers/net/wireless/iwlwifi/iwl-agn.c      |    2 +
>  drivers/net/wireless/iwlwifi/iwl-agn.h      |    2 +-
>  drivers/net/wireless/iwlwifi/iwl-core.h     |    4 +-
>  drivers/net/wireless/iwlwifi/iwl-dev.h      |    4 +-
>  drivers/net/wireless/iwlwifi/iwl-rx.c       |    4 +-
>  drivers/net/wireless/iwlwifi/iwl3945-base.c |    1 +
>  8 files changed, 53 insertions(+), 34 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
> index f371d42..9646cbc 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-3945.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
> @@ -409,11 +409,9 @@ static void iwl3945_accumulative_statistics(struct iwl_priv *priv,
>   * to improve the throughput.
>   */
>  static bool iwl3945_good_plcp_health(struct iwl_priv *priv,
> -				struct iwl_rx_packet *pkt)
> +				struct iwl_rx_packet *pkt, unsigned int msecs)
>  {
>  	__le32 cur_plcp_err, old_plcp_err;
> -	unsigned int msecs;
> -	unsigned long stamp;
>  	int delta;
>  	int threshold = priv->cfg->base_params->plcp_delta_threshold;
>  
> @@ -422,12 +420,7 @@ static bool iwl3945_good_plcp_health(struct iwl_priv *priv,
>  		return true;
>  	}
>  
> -	stamp = jiffies;
> -	msecs = jiffies_to_msecs(stamp - priv->plcp_jiffies);
> -	priv->plcp_jiffies = stamp;
> -
> -	if (msecs == 0)
> -		return true;
> +	BUG_ON(msecs == 0);

why not just return? I understand it should not be "0", but really need
BUG_ON?
 
>  
> -	stamp = jiffies;
> -	msecs = jiffies_to_msecs(stamp - priv->plcp_jiffies);
> -	priv->plcp_jiffies = stamp;
> -
> -	if (msecs == 0)
> -		return true;
> +	BUG_ON(msecs == 0);
Same above


Similar question, we are very close to finish driver split, when is the
best time for this patch?

Thanks
Wey


  reply	other threads:[~2011-02-08 15:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-08  8:31 [PATCH 1/5] iwlwifi: cleanup iwl_recover_from_statistics Stanislaw Gruszka
2011-02-08  8:31 ` [PATCH 2/5] iwlwifi: cleanup {iwl,iwl3945}_good_plcp_health Stanislaw Gruszka
2011-02-08 15:24   ` wwguy
2011-02-09  6:24     ` Stanislaw Gruszka
2011-02-09 17:03       ` wwguy
2011-02-08  8:31 ` [PATCH 3/5] iwlwifi: cleanup iwl_good_ack_health Stanislaw Gruszka
2011-02-08 15:32   ` wwguy
2011-02-08  8:31 ` [PATCH 4/5] iwlwifi: fix ack health for WiFi/BT combo devices Stanislaw Gruszka
2011-02-08 15:36   ` wwguy
2011-02-09  6:26     ` Stanislaw Gruszka
2011-02-09 17:04       ` wwguy
2011-02-08  8:31 ` [PATCH 5/5] iwlwifi: avoid too frequent recover from statistics Stanislaw Gruszka
2011-02-08 15:45   ` wwguy [this message]
2011-02-09  6:28     ` Stanislaw Gruszka
2011-02-09 17:05       ` wwguy
2011-02-08 15:16 ` [PATCH 1/5] iwlwifi: cleanup iwl_recover_from_statistics wwguy

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=1297179953.20613.38.camel@wwguy-ubuntu \
    --to=wey-yi.w.guy@intel.com \
    --cc=ilw@linux.intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sgruszka@redhat.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.