]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: dsa: microchip: fix initial port flush problem
authorTristram Ha <tristram.ha@microchip.com>
Wed, 19 Jun 2024 00:16:42 +0000 (17:16 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jul 2024 07:12:48 +0000 (09:12 +0200)
commit65a9383389db7bea170eacd9e619805e79660c2f
tree58dbc89c41a74b5052b990ebc5684330f8ad1641
parent3662eb2170e59b58ad479982dc1084889ba757b9
net: dsa: microchip: fix initial port flush problem

[ Upstream commit ad53f5f54f351e967128edbc431f0f26427172cf ]

The very first flush in any port will flush all learned addresses in all
ports.  This can be observed by unplugging the cable from one port while
additional ports are connected and dumping the fdb entries.

This problem is caused by the initially wrong value programmed to the
REG_SW_LUE_CTRL_1 register.  Setting SW_FLUSH_STP_TABLE and
SW_FLUSH_MSTP_TABLE bits does not have an immediate effect.  It is when
ksz9477_flush_dyn_mac_table() is called then the SW_FLUSH_STP_TABLE bit
takes effect and flushes all learned entries.  After that call both bits
are reset and so the next port flush will not cause such problem again.

Fixes: b987e98e50ab ("dsa: add DSA switch driver for Microchip KSZ9477")
Signed-off-by: Tristram Ha <tristram.ha@microchip.com>
Link: https://patch.msgid.link/1718756202-2731-1-git-send-email-Tristram.Ha@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/microchip/ksz9477.c