Skip to content

Commit 9e8789c

Browse files
xdarklightkuba-moo
authored andcommitted
net: stmmac: dwmac-meson8b: fix the RX delay validation
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: de94fc1 ("net: stmmac: dwmac-meson8b: add support for the RGMII RX delay on G12A") Reported-by: Martijn van Deventer <[email protected]> Signed-off-by: Martin Blumenstingl <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 1a23676 commit 9e8789c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,16 +443,16 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
443443
}
444444

445445
if (dwmac->data->has_prg_eth1_rgmii_rx_delay) {
446-
if (dwmac->rx_delay_ps != 0 && dwmac->rx_delay_ps != 2000) {
446+
if (dwmac->rx_delay_ps > 3000 || dwmac->rx_delay_ps % 200) {
447447
dev_err(dwmac->dev,
448-
"The only allowed RGMII RX delays values are: 0ps, 2000ps");
448+
"The RGMII RX delay range is 0..3000ps in 200ps steps");
449449
ret = -EINVAL;
450450
goto err_remove_config_dt;
451451
}
452452
} else {
453-
if (dwmac->rx_delay_ps > 3000 || dwmac->rx_delay_ps % 200) {
453+
if (dwmac->rx_delay_ps != 0 && dwmac->rx_delay_ps != 2000) {
454454
dev_err(dwmac->dev,
455-
"The RGMII RX delay range is 0..3000ps in 200ps steps");
455+
"The only allowed RGMII RX delays values are: 0ps, 2000ps");
456456
ret = -EINVAL;
457457
goto err_remove_config_dt;
458458
}

0 commit comments

Comments
 (0)