]> git.baikalelectronics.ru Git - kernel.git/commit
net: stmmac: Fix unset max_speed difference between DT and non-DT platforms
authorChen-Yu Tsai <wens@csie.org>
Thu, 31 Mar 2022 18:48:32 +0000 (02:48 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 2 Apr 2022 04:37:31 +0000 (21:37 -0700)
commite13bb53d2694b3d160c43e6405ae61941816a2f0
tree9850933c8678d442c4a83e6f0deebc82d3fd465b
parente7f7714bb944baa05b3ebeaa3d508494050f12ce
net: stmmac: Fix unset max_speed difference between DT and non-DT platforms

In commit 3cc3656dfb9c ("net: stmmac: support max-speed device tree
property"), when DT platforms don't set "max-speed", max_speed is set to
-1; for non-DT platforms, it stays the default 0.

Prior to commit 0357a52f9d1c ("net: stmmac: Start adding phylink support"),
the check for a valid max_speed setting was to check if it was greater
than zero. This commit got it right, but subsequent patches just checked
for non-zero, which is incorrect for DT platforms.

In commit b87fd36b3dc4 ("net: stmmac: convert to phylink_get_linkmodes()")
the conversion switched completely to checking for non-zero value as a
valid value, which caused 1000base-T to stop getting advertised by
default.

Instead of trying to fix all the checks, simply leave max_speed alone if
DT property parsing fails.

Fixes: 3cc3656dfb9c ("net: stmmac: support max-speed device tree property")
Fixes: b87fd36b3dc4 ("net: stmmac: convert to phylink_get_linkmodes()")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220331184832.16316-1-wens@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c