diff mbox series

realtek: do not reset SerDes on link change

Message ID d66a5b3e-3a03-7061-d446-db6c19a5f7d8@birger-koblitz.de
State Superseded
Delegated to: Sander Vanheule
Headers show
Series realtek: do not reset SerDes on link change | expand

Commit Message

Birger Koblitz April 24, 2022, 6:16 p.m. UTC
This fixes a bug where frames sent to the switch itself were
flooded to all ports unless the MAC address of the CPU-port
was learned otherwise.

Tested-by: Wenli Looi <wlooi@ucalgary.ca>
Tested-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
---
 .../linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c  | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Bjørn Mork April 24, 2022, 6:30 p.m. UTC | #1
That subject doesn't look quite right?


Bjørn
Birger Koblitz April 24, 2022, 6:31 p.m. UTC | #2
Oops, I was trying to do too many things at the same time....
Please forget that and I shall resend the email properly.

Birger

On 24.04.22 20:30, Bjørn Mork wrote:
> That subject doesn't look quite right?
> 
> 
> Bjørn
>
diff mbox series

Patch

diff --git a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c
index 4780632983..858b692640 100644
--- a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c
+++ b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c
@@ -205,6 +205,12 @@  static int rtl83xx_setup(struct dsa_switch *ds)

 	priv->r->l2_learning_setup();

+	// Make sure all frames sent to the switch's MAC are trapped to the CPU-port
+	if (priv->family_id == RTL8380_FAMILY_ID)
+	    sw_w32(0x2, RTL838X_SPCL_TRAP_SWITCH_MAC_CTRL);  // 0: FWD, 1: DROP, 2: TRAP2CPU
+	else
+	    sw_w32(0x2, RTL839X_SPCL_TRAP_SWITCH_MAC_CTRL);
+
 	/* Enable MAC Polling PHY again */
 	rtl83xx_enable_phy_polling(priv);
 	pr_debug("Please wait until PHY is settled\n");