Patch "net: dsa: mt7530: fix network connectivity with multiple CPU ports" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: dsa: mt7530: fix network connectivity with multiple CPU ports

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-dsa-mt7530-fix-network-connectivity-with-multipl.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit aa17947fb45c977368cab9e0e6b2e1c953ee4dbf
Author: Arınç ÜNAL <arinc.unal@xxxxxxxxxx>
Date:   Wed May 3 00:09:47 2023 +0300

    net: dsa: mt7530: fix network connectivity with multiple CPU ports
    
    [ Upstream commit 120a56b01beed51ab5956a734adcfd2760307107 ]
    
    On mt753x_cpu_port_enable() there's code that enables flooding for the CPU
    port only. Since mt753x_cpu_port_enable() runs twice when both CPU ports
    are enabled, port 6 becomes the only port to forward the frames to. But
    port 5 is the active port, so no frames received from the user ports will
    be forwarded to port 5 which breaks network connectivity.
    
    Every bit of the BC_FFP, UNM_FFP, and UNU_FFP bits represents a port. Fix
    this issue by setting the bit that corresponds to the CPU port without
    overwriting the other bits.
    
    Clear the bits beforehand only for the MT7531 switch. According to the
    documents MT7621 Giga Switch Programming Guide v0.3 and MT7531 Reference
    Manual for Development Board v1.0, after reset, the BC_FFP, UNM_FFP, and
    UNU_FFP bits are set to 1 for MT7531, 0 for MT7530.
    
    The commit 5e5502e012b8 ("net: dsa: mt7530: fix roaming from DSA user
    ports") silently changed the method to set the bits on the MT7530_MFC.
    Instead of clearing the relevant bits before mt7530_cpu_port_enable()
    which runs under a for loop, the commit started doing it on
    mt7530_cpu_port_enable().
    
    Back then, this didn't really matter as only a single CPU port could be
    used since the CPU port number was hardcoded. The driver was later changed
    with commit 1f9a6abecf53 ("net: dsa: mt7530: get cpu-port via dp->cpu_dp
    instead of constant") to retrieve the CPU port via dp->cpu_dp. With that,
    this silent change became an issue for when using multiple CPU ports.
    
    Fixes: 5e5502e012b8 ("net: dsa: mt7530: fix roaming from DSA user ports")
    Signed-off-by: Arınç ÜNAL <arinc.unal@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index ae156b14b57d5..4ec598efc3332 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -1010,9 +1010,9 @@ mt753x_cpu_port_enable(struct dsa_switch *ds, int port)
 	mt7530_write(priv, MT7530_PVC_P(port),
 		     PORT_SPEC_TAG);
 
-	/* Disable flooding by default */
-	mt7530_rmw(priv, MT7530_MFC, BC_FFP_MASK | UNM_FFP_MASK | UNU_FFP_MASK,
-		   BC_FFP(BIT(port)) | UNM_FFP(BIT(port)) | UNU_FFP(BIT(port)));
+	/* Enable flooding on the CPU port */
+	mt7530_set(priv, MT7530_MFC, BC_FFP(BIT(port)) | UNM_FFP(BIT(port)) |
+		   UNU_FFP(BIT(port)));
 
 	/* Set CPU port number */
 	if (priv->id == ID_MT7621)
@@ -2306,6 +2306,10 @@ mt7531_setup_common(struct dsa_switch *ds)
 	/* Enable and reset MIB counters */
 	mt7530_mib_reset(ds);
 
+	/* Disable flooding on all ports */
+	mt7530_clear(priv, MT7530_MFC, BC_FFP_MASK | UNM_FFP_MASK |
+		     UNU_FFP_MASK);
+
 	for (i = 0; i < MT7530_NUM_PORTS; i++) {
 		/* Disable forwarding by default on all ports */
 		mt7530_rmw(priv, MT7530_PCR_P(i), PCR_MATRIX_MASK,



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux