linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: stmmac: dwmac-meson8b: fix the RX delay validation
@ 2021-01-19 20:24 Martin Blumenstingl
  2021-01-21  6:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Blumenstingl @ 2021-01-19 20:24 UTC (permalink / raw)
  To: linux-amlogic, netdev
  Cc: davem, kuba, linux-arm-kernel, linux-kernel, Martin Blumenstingl,
	Martijn van Deventer

When has_prg_eth1_rgmii_rx_delay is true then we support RX delays
between 0ps and 3000ps in 200ps steps. Swap the validation of the RX
delay based on the has_prg_eth1_rgmii_rx_delay flag so the 200ps check
is now applied correctly on G12A SoCs (instead of only allow 0ps or
2000ps on G12A, but 0..3000ps in 200ps steps on older SoCs which don't
support that).

Fixes: de94fc104d58ea ("net: stmmac: dwmac-meson8b: add support for the RGMII RX delay on G12A")
Reported-by: Martijn van Deventer <martijn@martijnvandeventer.nl>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
Many thanks to Martijn for this excellent catch and for reporting this
issue (off-list)!


 drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
index 55152d7ba99a..848e5c37746b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
@@ -443,16 +443,16 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
 	}
 
 	if (dwmac->data->has_prg_eth1_rgmii_rx_delay) {
-		if (dwmac->rx_delay_ps != 0 && dwmac->rx_delay_ps != 2000) {
+		if (dwmac->rx_delay_ps > 3000 || dwmac->rx_delay_ps % 200) {
 			dev_err(dwmac->dev,
-				"The only allowed RGMII RX delays values are: 0ps, 2000ps");
+				"The RGMII RX delay range is 0..3000ps in 200ps steps");
 			ret = -EINVAL;
 			goto err_remove_config_dt;
 		}
 	} else {
-		if (dwmac->rx_delay_ps > 3000 || dwmac->rx_delay_ps % 200) {
+		if (dwmac->rx_delay_ps != 0 && dwmac->rx_delay_ps != 2000) {
 			dev_err(dwmac->dev,
-				"The RGMII RX delay range is 0..3000ps in 200ps steps");
+				"The only allowed RGMII RX delays values are: 0ps, 2000ps");
 			ret = -EINVAL;
 			goto err_remove_config_dt;
 		}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: stmmac: dwmac-meson8b: fix the RX delay validation
  2021-01-19 20:24 [PATCH] net: stmmac: dwmac-meson8b: fix the RX delay validation Martin Blumenstingl
@ 2021-01-21  6:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-01-21  6:20 UTC (permalink / raw)
  To: Martin Blumenstingl
  Cc: linux-amlogic, netdev, davem, kuba, linux-arm-kernel,
	linux-kernel, martijn

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Tue, 19 Jan 2021 21:24:24 +0100 you wrote:
> When has_prg_eth1_rgmii_rx_delay is true then we support RX delays
> between 0ps and 3000ps in 200ps steps. Swap the validation of the RX
> delay based on the has_prg_eth1_rgmii_rx_delay flag so the 200ps check
> is now applied correctly on G12A SoCs (instead of only allow 0ps or
> 2000ps on G12A, but 0..3000ps in 200ps steps on older SoCs which don't
> support that).
> 
> [...]

Here is the summary with links:
  - net: stmmac: dwmac-meson8b: fix the RX delay validation
    https://git.kernel.org/netdev/net-next/c/9e8789c85dee

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-21  6:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19 20:24 [PATCH] net: stmmac: dwmac-meson8b: fix the RX delay validation Martin Blumenstingl
2021-01-21  6:20 ` patchwork-bot+netdevbpf

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).