]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: dsa: microchip: Fix LAN937X set_ageing_time function
authorTristram Ha <tristram.ha@microchip.com>
Wed, 18 Dec 2024 02:02:24 +0000 (18:02 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2025 12:29:58 +0000 (13:29 +0100)
commitba4014276bfc53677aacc195343e5911fe921e14
tree0fbe395b05c043c701d7e91372e2fb5377e1168a
parent9d00ab0e0d50d61cf8724f31c967475321911204
net: dsa: microchip: Fix LAN937X set_ageing_time function

[ Upstream commit bb9869043438af5b94230f94fb4c39206525d758 ]

The aging count is not a simple 20-bit value but comprises a 3-bit
multiplier and a 20-bit second time.  The code tries to use the
original multiplier which is 4 as the second count is still 300 seconds
by default.

As the 20-bit number is now too large for practical use there is an option
to interpret it as microseconds instead of seconds.

Fixes: 2c119d9982b1 ("net: dsa: microchip: add the support for set_ageing_time")
Signed-off-by: Tristram Ha <tristram.ha@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20241218020224.70590-3-Tristram.Ha@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/microchip/lan937x_main.c
drivers/net/dsa/microchip/lan937x_reg.h