]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: stmmac: eswin: validate RGMII delay values
authorZhi Li <lizhi2@eswincomputing.com>
Mon, 18 May 2026 02:22:13 +0000 (10:22 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 21 May 2026 09:58:17 +0000 (11:58 +0200)
commitc2e152f7ce3208b9333d212d41a87637ec1dd170
tree8e6b6a19f0888282cd15dfe17bae7d27600c08e8
parent6ffcef9bc1fc2ad8110777decd6d026e3cb468ce
net: stmmac: eswin: validate RGMII delay values

Validate rx-internal-delay-ps and tx-internal-delay-ps against the
hardware capabilities of the EIC7700 MAC.

The programmable RGMII delay supports 20 ps steps and a maximum value of
2540 ps. The driver previously accepted arbitrary values and silently
truncated unsupported settings when converting them to hardware units.

As a result, invalid device tree values could lead to unexpected delay
programming and incorrect RGMII timing.

Reject delay values that are not multiples of 20 ps or exceed the
supported hardware range.

Fixes: ea77dbbdbc4e ("net: stmmac: add Eswin EIC7700 glue driver")
Signed-off-by: Zhi Li <lizhi2@eswincomputing.com>
Link: https://patch.msgid.link/20260518022214.507-1-lizhi2@eswincomputing.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c