[PATCH net v4 3/7] net: dsa: mt7530: fix trapping frames on non-MT7621 SoC MT7530 switch

arinc9.unal@gmail.com posted 7 patches 1 year, 3 months ago
There is a newer version of this series
[PATCH net v4 3/7] net: dsa: mt7530: fix trapping frames on non-MT7621 SoC MT7530 switch
Posted by arinc9.unal@gmail.com 1 year, 3 months ago
From: Arınç ÜNAL <arinc.unal@arinc9.com>

The check for setting the CPU_PORT bits must include the non-MT7621 SoC
MT7530 switch variants to trap frames. Expand the check to include them.

Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
---
 drivers/net/dsa/mt7530.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index ef8879087932..2bde2fdb5fba 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -3073,7 +3073,7 @@ mt753x_master_state_change(struct dsa_switch *ds,
 	 * the numerically smallest CPU port which is affine to the DSA conduit
 	 * interface that is up.
 	 */
-	if (priv->id != ID_MT7621)
+	if (priv->id != ID_MT7530 && priv->id != ID_MT7621)
 		return;
 
 	if (operational)
-- 
2.39.2

Re: [PATCH net v4 3/7] net: dsa: mt7530: fix trapping frames on non-MT7621 SoC MT7530 switch
Posted by Vladimir Oltean 1 year, 3 months ago
On Mon, Jun 12, 2023 at 10:59:41AM +0300, arinc9.unal@gmail.com wrote:
> From: Arınç ÜNAL <arinc.unal@arinc9.com>
> 
> The check for setting the CPU_PORT bits must include the non-MT7621 SoC
> MT7530 switch variants to trap frames. Expand the check to include them.
> 
> Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> ---
>  drivers/net/dsa/mt7530.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
> index ef8879087932..2bde2fdb5fba 100644
> --- a/drivers/net/dsa/mt7530.c
> +++ b/drivers/net/dsa/mt7530.c
> @@ -3073,7 +3073,7 @@ mt753x_master_state_change(struct dsa_switch *ds,
>  	 * the numerically smallest CPU port which is affine to the DSA conduit
>  	 * interface that is up.
>  	 */
> -	if (priv->id != ID_MT7621)
> +	if (priv->id != ID_MT7530 && priv->id != ID_MT7621)
>  		return;

This patch and 2/7 should probably be reversed, since 2/7 is not going to net.

>  
>  	if (operational)
> -- 
> 2.39.2
> 
Re: [PATCH net v4 3/7] net: dsa: mt7530: fix trapping frames on non-MT7621 SoC MT7530 switch
Posted by Arınç ÜNAL 1 year, 3 months ago
On 14.06.2023 23:13, Vladimir Oltean wrote:
> On Mon, Jun 12, 2023 at 10:59:41AM +0300, arinc9.unal@gmail.com wrote:
>> From: Arınç ÜNAL <arinc.unal@arinc9.com>
>>
>> The check for setting the CPU_PORT bits must include the non-MT7621 SoC
>> MT7530 switch variants to trap frames. Expand the check to include them.
>>
>> Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
>> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
>> ---
>>   drivers/net/dsa/mt7530.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
>> index ef8879087932..2bde2fdb5fba 100644
>> --- a/drivers/net/dsa/mt7530.c
>> +++ b/drivers/net/dsa/mt7530.c
>> @@ -3073,7 +3073,7 @@ mt753x_master_state_change(struct dsa_switch *ds,
>>   	 * the numerically smallest CPU port which is affine to the DSA conduit
>>   	 * interface that is up.
>>   	 */
>> -	if (priv->id != ID_MT7621)
>> +	if (priv->id != ID_MT7530 && priv->id != ID_MT7621)
>>   		return;
> 
> This patch and 2/7 should probably be reversed, since 2/7 is not going to net.

This patch is still necessary. It'll just modify the other location 
instead of here.

https://github.com/arinc9/linux/commit/4c8b983f7a95ba637799ccd1b700ee054b030729

Arınç
Re: [PATCH net v4 3/7] net: dsa: mt7530: fix trapping frames on non-MT7621 SoC MT7530 switch
Posted by Vladimir Oltean 1 year, 3 months ago
On Wed, Jun 14, 2023 at 11:59:33PM +0300, Arınç ÜNAL wrote:
> On 14.06.2023 23:13, Vladimir Oltean wrote:
> > On Mon, Jun 12, 2023 at 10:59:41AM +0300, arinc9.unal@gmail.com wrote:
> > > From: Arınç ÜNAL <arinc.unal@arinc9.com>
> > > 
> > > The check for setting the CPU_PORT bits must include the non-MT7621 SoC
> > > MT7530 switch variants to trap frames. Expand the check to include them.
> > > 
> > > Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
> > > Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> > > ---
> > >   drivers/net/dsa/mt7530.c | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
> > > index ef8879087932..2bde2fdb5fba 100644
> > > --- a/drivers/net/dsa/mt7530.c
> > > +++ b/drivers/net/dsa/mt7530.c
> > > @@ -3073,7 +3073,7 @@ mt753x_master_state_change(struct dsa_switch *ds,
> > >   	 * the numerically smallest CPU port which is affine to the DSA conduit
> > >   	 * interface that is up.
> > >   	 */
> > > -	if (priv->id != ID_MT7621)
> > > +	if (priv->id != ID_MT7530 && priv->id != ID_MT7621)
> > >   		return;
> > 
> > This patch and 2/7 should probably be reversed, since 2/7 is not going to net.
> 
> This patch is still necessary. It'll just modify the other location instead
> of here.
> 
> https://github.com/arinc9/linux/commit/4c8b983f7a95ba637799ccd1b700ee054b030729
> 
> Arınç

That's basically what I said, sorry if I wasn't clear.
Re: [PATCH net v4 3/7] net: dsa: mt7530: fix trapping frames on non-MT7621 SoC MT7530 switch
Posted by Russell King (Oracle) 1 year, 3 months ago
On Mon, Jun 12, 2023 at 10:59:41AM +0300, arinc9.unal@gmail.com wrote:
> From: Arınç ÜNAL <arinc.unal@arinc9.com>
> 
> The check for setting the CPU_PORT bits must include the non-MT7621 SoC
> MT7530 switch variants to trap frames. Expand the check to include them.

... and now you add support for this to the MT7530, which is what
alerted me to what seems to be a mistake in the previous patch.

"The setup of CPU_PORT() needs to be done for the MT7530 switch variants
as well as the MT7621."

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Re: [PATCH net v4 3/7] net: dsa: mt7530: fix trapping frames on non-MT7621 SoC MT7530 switch
Posted by Arınç ÜNAL 1 year, 3 months ago
On 13.06.2023 00:14, Russell King (Oracle) wrote:
> On Mon, Jun 12, 2023 at 10:59:41AM +0300, arinc9.unal@gmail.com wrote:
>> From: Arınç ÜNAL <arinc.unal@arinc9.com>
>>
>> The check for setting the CPU_PORT bits must include the non-MT7621 SoC
>> MT7530 switch variants to trap frames. Expand the check to include them.
> 
> ... and now you add support for this to the MT7530, which is what
> alerted me to what seems to be a mistake in the previous patch.
> 
> "The setup of CPU_PORT() needs to be done for the MT7530 switch variants
> as well as the MT7621."

No. ID_MT7621 represents the multi-chip module MT7530 switch in certain 
MT7621 SoCs. So saying "the MT7530 switch variants" already covers the 
switch on the MT7621 SoCs.

Arınç