diff mbox series

[RFC,net-next,v2,01/10] net: dsa: mt7530: fix incorrect test in mt753x_phylink_validate()

Message ID E1nMpuT-00AJoW-Dq@rmk-PC.armlinux.org.uk (mailing list archive)
State New, archived
Headers show
Series net: dsa: mt7530: updates for phylink changes | expand

Commit Message

Russell King (Oracle) Feb. 23, 2022, 11:34 a.m. UTC
Discussing one of the tests in mt753x_phylink_validate() with Landen
Chao confirms that the "||" should be "&&". Fix this.

Fixes: c288575f7810 ("net: dsa: mt7530: Add the support of MT7531 switch")
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/dsa/mt7530.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vladimir Oltean Feb. 23, 2022, 1:12 p.m. UTC | #1
Hello,

On Wed, Feb 23, 2022 at 11:34:17AM +0000, Russell King (Oracle) wrote:
> Discussing one of the tests in mt753x_phylink_validate() with Landen
> Chao confirms that the "||" should be "&&". Fix this.
> 
> Fixes: c288575f7810 ("net: dsa: mt7530: Add the support of MT7531 switch")
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
>  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 f74f25f479ed..69abca77ea1a 100644
> --- a/drivers/net/dsa/mt7530.c
> +++ b/drivers/net/dsa/mt7530.c
> @@ -2936,7 +2936,7 @@ mt753x_phylink_validate(struct dsa_switch *ds, int port,
>  
>  	phylink_set_port_modes(mask);
>  
> -	if (state->interface != PHY_INTERFACE_MODE_TRGMII ||
> +	if (state->interface != PHY_INTERFACE_MODE_TRGMII &&
>  	    !phy_interface_mode_is_8023z(state->interface)) {
>  		phylink_set(mask, 10baseT_Half);
>  		phylink_set(mask, 10baseT_Full);
> -- 
> 2.30.2
> 

Since the "net" pull request for this week is scheduled to happen rather
soon, I think you should split this and send it to "net", so that you
won't have to wait when you resend as non-RFC.
Russell King (Oracle) Feb. 23, 2022, 1:21 p.m. UTC | #2
On Wed, Feb 23, 2022 at 03:12:00PM +0200, Vladimir Oltean wrote:
> Hello,
> 
> On Wed, Feb 23, 2022 at 11:34:17AM +0000, Russell King (Oracle) wrote:
> > Discussing one of the tests in mt753x_phylink_validate() with Landen
> > Chao confirms that the "||" should be "&&". Fix this.
> > 
> > Fixes: c288575f7810 ("net: dsa: mt7530: Add the support of MT7531 switch")
> > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> > ---
> >  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 f74f25f479ed..69abca77ea1a 100644
> > --- a/drivers/net/dsa/mt7530.c
> > +++ b/drivers/net/dsa/mt7530.c
> > @@ -2936,7 +2936,7 @@ mt753x_phylink_validate(struct dsa_switch *ds, int port,
> >  
> >  	phylink_set_port_modes(mask);
> >  
> > -	if (state->interface != PHY_INTERFACE_MODE_TRGMII ||
> > +	if (state->interface != PHY_INTERFACE_MODE_TRGMII &&
> >  	    !phy_interface_mode_is_8023z(state->interface)) {
> >  		phylink_set(mask, 10baseT_Half);
> >  		phylink_set(mask, 10baseT_Full);
> > -- 
> > 2.30.2
> > 
> 
> Since the "net" pull request for this week is scheduled to happen rather
> soon, I think you should split this and send it to "net", so that you
> won't have to wait when you resend as non-RFC.

I don't believe this is an urgent issue. The issue has existed since
MT7531 support was added in September 2020, and no one has raised it
as a problem until I identified the clearly incorrect expression.

What if fixing this unmasks a problem elsewhere?

Therefore, I see no reason to rush getting this fix into the -rc
kernel, especially without a review and preferably testing by the
driver authors.
diff mbox series

Patch

diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index f74f25f479ed..69abca77ea1a 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2936,7 +2936,7 @@  mt753x_phylink_validate(struct dsa_switch *ds, int port,
 
 	phylink_set_port_modes(mask);
 
-	if (state->interface != PHY_INTERFACE_MODE_TRGMII ||
+	if (state->interface != PHY_INTERFACE_MODE_TRGMII &&
 	    !phy_interface_mode_is_8023z(state->interface)) {
 		phylink_set(mask, 10baseT_Half);
 		phylink_set(mask, 10baseT_Full);