Skip to content

Commit ad53f5f

Browse files
triha2workkuba-moo
authored andcommitted
net: dsa: microchip: fix initial port flush problem
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: b987e98 ("dsa: add DSA switch driver for Microchip KSZ9477") Signed-off-by: Tristram Ha <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d5a7fc5 commit ad53f5f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/net/dsa/microchip/ksz9477.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,8 @@ int ksz9477_reset_switch(struct ksz_device *dev)
355355
SPI_AUTO_EDGE_DETECTION, 0);
356356

357357
/* default configuration */
358-
ksz_read8(dev, REG_SW_LUE_CTRL_1, &data8);
359-
data8 = SW_AGING_ENABLE | SW_LINK_AUTO_AGING |
360-
SW_SRC_ADDR_FILTER | SW_FLUSH_STP_TABLE | SW_FLUSH_MSTP_TABLE;
361-
ksz_write8(dev, REG_SW_LUE_CTRL_1, data8);
358+
ksz_write8(dev, REG_SW_LUE_CTRL_1,
359+
SW_AGING_ENABLE | SW_LINK_AUTO_AGING | SW_SRC_ADDR_FILTER);
362360

363361
/* disable interrupts */
364362
ksz_write32(dev, REG_SW_INT_MASK__4, SWITCH_INT_MASK);

0 commit comments

Comments
 (0)