All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	irusskikh@marvell.com, dbezrukov@marvell.com
Subject: Re: [PATCH net 1/7] atlantic: Increase delay for fw transactions
Date: Tue, 30 Nov 2021 03:48:10 +0100	[thread overview]
Message-ID: <YaWQ6gib3t5zu8pE@lunn.ch> (raw)
In-Reply-To: <20211129132829.16038-2-skalluru@marvell.com>

On Mon, Nov 29, 2021 at 05:28:23AM -0800, Sudarsana Reddy Kalluru wrote:
> From: Dmitry Bogdanov <dbezrukov@marvell.com>
> 
> The max waiting period (of 1 ms) while reading the data from FW shared
> buffer is too small for certain types of data (e.g., stats). There's a
> chance that FW could be updating buffer at the same time and driver
> would be unsuccessful in reading data. Firmware manual recommends to
> have 1 sec timeout to fix this issue.
> 
> Fixes: 5cfd54d7dc186 ("net: atlantic: minimal A2 fw_ops")
> Signed-off-by: Dmitry Bogdanov <dbezrukov@marvell.com>
> Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
> Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
> ---
>  .../ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c  | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c
> index dd259c8f2f4f..b0e4119b9883 100644
> --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c
> +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c
> @@ -84,7 +84,7 @@ static int hw_atl2_shared_buffer_read_block(struct aq_hw_s *self,
>  			if (cnt > AQ_A2_FW_READ_TRY_MAX)
>  				return -ETIME;
>  			if (tid1.transaction_cnt_a != tid1.transaction_cnt_b)
> -				udelay(1);
> +				mdelay(1);
>  		} while (tid1.transaction_cnt_a != tid1.transaction_cnt_b);

This change is the 1 second timeout.

>  
>  		hw_atl2_mif_shared_buf_read(self, offset, (u32 *)data, dwords);
> @@ -339,8 +339,11 @@ static int aq_a2_fw_update_stats(struct aq_hw_s *self)
>  {
>  	struct hw_atl2_priv *priv = (struct hw_atl2_priv *)self->priv;
>  	struct statistics_s stats;
> +	int err;
>  
> -	hw_atl2_shared_buffer_read_safe(self, stats, &stats);
> +	err = hw_atl2_shared_buffer_read_safe(self, stats, &stats);
> +	if (err)
> +		return err;

This change however does not seem to be explained in the commit
message. Not discarding an error is a good change, but it needs
commenting on.

Also, looking at hw_atl2_shared_buffer_read_block() i notice it
returns -ETIME. It should be -ETIMEDOUT.

	Andrew

  reply	other threads:[~2021-11-30  2:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29 13:28 [PATCH net 0/7] net: atlantic: 11-2021 fixes Sudarsana Reddy Kalluru
2021-11-29 13:28 ` [PATCH net 1/7] atlantic: Increase delay for fw transactions Sudarsana Reddy Kalluru
2021-11-30  2:48   ` Andrew Lunn [this message]
2021-11-30  4:18     ` Sudarsana Reddy Kalluru
2021-11-29 13:28 ` [PATCH net 2/7] atlatnic: enable Nbase-t speeds with base-t Sudarsana Reddy Kalluru
2021-11-29 13:28 ` [PATCH net 3/7] atlantic: Fix to display FW bundle version instead of FW mac version Sudarsana Reddy Kalluru
2021-11-29 13:28 ` [PATCH net 4/7] atlantic: Add missing DIDs and fix 115c Sudarsana Reddy Kalluru
2021-11-29 13:28 ` [PATCH net 5/7] Remove Half duplex mode speed capabilities Sudarsana Reddy Kalluru
2021-11-29 13:28 ` [PATCH net 6/7] atlantic: Fix statistics logic for production hardware Sudarsana Reddy Kalluru
2021-11-29 13:28 ` [PATCH net 7/7] atlantic: Remove warn trace message Sudarsana Reddy Kalluru
2021-11-29 14:30 ` [PATCH net 0/7] net: atlantic: 11-2021 fixes patchwork-bot+netdevbpf

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=YaWQ6gib3t5zu8pE@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dbezrukov@marvell.com \
    --cc=irusskikh@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=skalluru@marvell.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.