All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Josua Mayer <josua@solid-run.com>
Cc: netdev@vger.kernel.org, Yazan Shhady <yazan.shhady@solid-run.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH] net: phy: dp83869: fix default value for tx-/rx-internal-delay
Date: Thu, 23 Mar 2023 17:30:53 +0100	[thread overview]
Message-ID: <ZBx+vdcrRgRwGdnC@corigine.com> (raw)
In-Reply-To: <20230323102536.31988-1-josua@solid-run.com>

On Thu, Mar 23, 2023 at 12:25:36PM +0200, Josua Mayer wrote:
> dp83869 internally uses a look-up table for mapping supported delays in
> nanoseconds to register values.
> When specific delays are defined in device-tree, phy_get_internal_delay
> does the lookup automatically returning an index.
> 
> The default case wrongly assigns the nanoseconds value from the lookup
> table, resulting in numeric value 2000 applied to delay configuration
> register, rather than the expected index values 0-7 (7 for 2000).
> Ultimately this issue broke RX for 1Gbps links.
> 
> Fix default delay configuration by assigning the intended index value
> directly.
> 
> Co-developed-by: Yazan Shhady <yazan.shhady@solid-run.com>
> Signed-off-by: Yazan Shhady <yazan.shhady@solid-run.com>
> Signed-off-by: Josua Mayer <josua@solid-run.com>

I wonder if this warrants:

Cc: stable@vger.kernel.org
736b25afe284 ("net: dp83869: Add RGMII internal delay configuration")

And being targeted at 'net' ([PATCH net] in subject).

In any case, the fix seems correct to me.

Reviewed-by: Simon Horman <simon.horman@corigine.com>

> ---
>  drivers/net/phy/dp83869.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/phy/dp83869.c b/drivers/net/phy/dp83869.c
> index b4ff9c5073a3c..9ab5eff502b71 100644
> --- a/drivers/net/phy/dp83869.c
> +++ b/drivers/net/phy/dp83869.c
> @@ -588,15 +588,13 @@ static int dp83869_of_init(struct phy_device *phydev)
>  						       &dp83869_internal_delay[0],
>  						       delay_size, true);
>  	if (dp83869->rx_int_delay < 0)
> -		dp83869->rx_int_delay =
> -				dp83869_internal_delay[DP83869_CLK_DELAY_DEF];
> +		dp83869->rx_int_delay = DP83869_CLK_DELAY_DEF;
>  
>  	dp83869->tx_int_delay = phy_get_internal_delay(phydev, dev,
>  						       &dp83869_internal_delay[0],
>  						       delay_size, false);
>  	if (dp83869->tx_int_delay < 0)
> -		dp83869->tx_int_delay =
> -				dp83869_internal_delay[DP83869_CLK_DELAY_DEF];
> +		dp83869->tx_int_delay = DP83869_CLK_DELAY_DEF;
>  
>  	return ret;
>  }
> -- 
> 2.35.3
> 

  reply	other threads:[~2023-03-23 16:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 10:25 [PATCH] net: phy: dp83869: fix default value for tx-/rx-internal-delay Josua Mayer
2023-03-23 16:30 ` Simon Horman [this message]
2023-03-24 22:00 ` 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=ZBx+vdcrRgRwGdnC@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=josua@solid-run.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=yazan.shhady@solid-run.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.