]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: stmmac: thead: ensure divisor gives proper rate
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 21 Feb 2025 14:15:17 +0000 (14:15 +0000)
committerJakub Kicinski <kuba@kernel.org>
Mon, 24 Feb 2025 22:29:56 +0000 (14:29 -0800)
commit8bfff0481d917ef92bfad607839acb7edb5e0b0d
tree5829b398fe1c92d55b9d802960f93a72b9b1a687
parent171fd7cb153c4614d4132fbb135ef1c0855e330a
net: stmmac: thead: ensure divisor gives proper rate

thead was checking that the stmmac_clk rate was a multiple of the
RGMII rates for 1G and 100M, but didn't check for 10M. Rather than
use this with hard-coded speeds, check that the calculated divisor
gives the required rate by multplying the transmit clock rate back
up to the stmmac clock rate and checking that it agrees.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Drew Fustini <drew@pdp7.com>
Link: https://patch.msgid.link/E1tlToD-004W3g-HB@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c