]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 12:41:03 +0000 (14:41 +0200)
commit6c113fec90935f9733e3a5eef6bf7cd315b4d957
tree955fccc495c1ad08605d268f8dae1207ec862c46
parentd8140da06a10bb7155b22d24090e60b3a35dc596
net: stmmac: Fix unset max_speed difference between DT and non-DT platforms

BugLink: https://bugs.launchpad.net/bugs/1969107
[ Upstream commit c21cabb0fd0b54b8b54235fc1ecfe1195a23bcb2 ]

In commit 9cbadf094d9d ("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 eeef2f6b9f6e ("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 92c3807b9ac3 ("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: 9cbadf094d9d ("net: stmmac: support max-speed device tree property")
Fixes: 92c3807b9ac3 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 47fec6139b5e5acce40904609864debef38f20a3)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c