[net,v1] net: phy: micrel: Correct bit assignment for MICREL_KSZ8_P1_ERRATA flag

Message ID 20230831110427.3551432-1-o.rempel@pengutronix.de
State New
Headers
Series [net,v1] net: phy: micrel: Correct bit assignment for MICREL_KSZ8_P1_ERRATA flag |

Commit Message

Oleksij Rempel Aug. 31, 2023, 11:04 a.m. UTC
  The previous assignment of the phy_device quirk for the
MICREL_KSZ8_P1_ERRATA flag was incorrect, working only due to
coincidental conditions. Specifically:

- The flag MICREL_KSZ8_P1_ERRATA, intended for KSZ88xx switches, was
  mistakenly overlapping with the MICREL_PHY_FXEN and
  MICREL_PHY_50MHZ_CLK flags.
- MICREL_PHY_FXEN is used by the KSZ8041 PHY, and its related code path
  wasn't executed for KSZ88xx PHYs and other way around.
- Additionally, the code path associated with the MICREL_PHY_50MHZ_CLK
  flag wasn't executed for KSZ88xx either.

Fixes: 49011e0c1555d ("net: phy: micrel: ksz886x/ksz8081: add cabletest support")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 include/linux/micrel_phy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Oleksij Rempel Aug. 31, 2023, 11:23 a.m. UTC | #1
On Thu, Aug 31, 2023 at 12:20:17PM +0100, Russell King (Oracle) wrote:
> On Thu, Aug 31, 2023 at 01:04:27PM +0200, Oleksij Rempel wrote:
> > The previous assignment of the phy_device quirk for the
> > MICREL_KSZ8_P1_ERRATA flag was incorrect, working only due to
> > coincidental conditions. Specifically:
> > 
> > - The flag MICREL_KSZ8_P1_ERRATA, intended for KSZ88xx switches, was
> >   mistakenly overlapping with the MICREL_PHY_FXEN and
> >   MICREL_PHY_50MHZ_CLK flags.
> > - MICREL_PHY_FXEN is used by the KSZ8041 PHY, and its related code path
> >   wasn't executed for KSZ88xx PHYs and other way around.
> > - Additionally, the code path associated with the MICREL_PHY_50MHZ_CLK
> >   flag wasn't executed for KSZ88xx either.
> > 
> > Fixes: 49011e0c1555d ("net: phy: micrel: ksz886x/ksz8081: add cabletest support")
> > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > ---
> >  include/linux/micrel_phy.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h
> > index 8bef1ab62bba3..0cedbeb9167c3 100644
> > --- a/include/linux/micrel_phy.h
> > +++ b/include/linux/micrel_phy.h
> > @@ -43,7 +43,7 @@
> >  /* struct phy_device dev_flags definitions */
> >  #define MICREL_PHY_50MHZ_CLK	0x00000001
> >  #define MICREL_PHY_FXEN		0x00000002
> > -#define MICREL_KSZ8_P1_ERRATA	0x00000003
> > +#define MICREL_KSZ8_P1_ERRATA	BIT(3)
> 
> Please can you also convert the other two flags to use BIT() as well to
> make the entire thing explicitly bit-orientated? Thanks.

Ack. This patch is for the net. The cleanup will got to the net-next.
Except clean up will be accepted for the net too?

Regards,
Oleksij
  

Patch

diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h
index 8bef1ab62bba3..0cedbeb9167c3 100644
--- a/include/linux/micrel_phy.h
+++ b/include/linux/micrel_phy.h
@@ -43,7 +43,7 @@ 
 /* struct phy_device dev_flags definitions */
 #define MICREL_PHY_50MHZ_CLK	0x00000001
 #define MICREL_PHY_FXEN		0x00000002
-#define MICREL_KSZ8_P1_ERRATA	0x00000003
+#define MICREL_KSZ8_P1_ERRATA	BIT(3)
 
 #define MICREL_KSZ9021_EXTREG_CTRL	0xB
 #define MICREL_KSZ9021_EXTREG_DATA_WRITE	0xC