Message ID | 27bb134f-eb4e-e43a-5d9d-2c551a22428c@gmail.com |
---|---|
State | Superseded |
Delegated to: | David Miller |
Headers | show |
Series | net: phy: disable aneg in genphy_c45_pma_setup_forced | expand |
Hi, On Sat, 16 Feb 2019 20:10:24 +0100 Heiner Kallweit <hkallweit1@gmail.com> wrote: > When genphy_c45_pma_setup_forced() is called the "aneg enabled" bit may > still be set, therefore clear it. This is also in line with what > genphy_setup_forced() does for Clause 22. > > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> > --- > drivers/net/phy/phy-c45.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c > index bef126344..0374c50b1 100644 > --- a/drivers/net/phy/phy-c45.c > +++ b/drivers/net/phy/phy-c45.c > @@ -71,6 +71,10 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev) > return ret; > > return phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL2, ctrl2); > + if (ret < 0) Perhaps you meant ret = phy_write_mmd(...)? > + return ret; > + > + return genphy_c45_an_disable_aneg(phydev); > } > EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced); >
On 16.02.2019 20:31, Stefano Brivio wrote: > Hi, > > On Sat, 16 Feb 2019 20:10:24 +0100 > Heiner Kallweit <hkallweit1@gmail.com> wrote: > >> When genphy_c45_pma_setup_forced() is called the "aneg enabled" bit may >> still be set, therefore clear it. This is also in line with what >> genphy_setup_forced() does for Clause 22. >> >> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> >> --- >> drivers/net/phy/phy-c45.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c >> index bef126344..0374c50b1 100644 >> --- a/drivers/net/phy/phy-c45.c >> +++ b/drivers/net/phy/phy-c45.c >> @@ -71,6 +71,10 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev) >> return ret; >> >> return phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL2, ctrl2); >> + if (ret < 0) > > Perhaps you meant ret = phy_write_mmd(...)? > Ups, for sure I meant this. Strange that the compiler doesn't complain. >> + return ret; >> + >> + return genphy_c45_an_disable_aneg(phydev); >> } >> EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced); >> > Heiner
On Sat, Feb 16, 2019 at 08:10:24PM +0100, Heiner Kallweit wrote: > When genphy_c45_pma_setup_forced() is called the "aneg enabled" bit may > still be set, therefore clear it. This is also in line with what > genphy_setup_forced() does for Clause 22. > > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> > --- > drivers/net/phy/phy-c45.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c > index bef126344..0374c50b1 100644 > --- a/drivers/net/phy/phy-c45.c > +++ b/drivers/net/phy/phy-c45.c > @@ -71,6 +71,10 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev) > return ret; > > return phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL2, ctrl2); > + if (ret < 0) This patch does not make sense. > + return ret; > + > + return genphy_c45_an_disable_aneg(phydev); > } > EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced); > > -- > 2.20.1 > > >
On 16.02.2019 23:43, Russell King - ARM Linux admin wrote: > On Sat, Feb 16, 2019 at 08:10:24PM +0100, Heiner Kallweit wrote: >> When genphy_c45_pma_setup_forced() is called the "aneg enabled" bit may >> still be set, therefore clear it. This is also in line with what >> genphy_setup_forced() does for Clause 22. >> >> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> >> --- >> drivers/net/phy/phy-c45.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c >> index bef126344..0374c50b1 100644 >> --- a/drivers/net/phy/phy-c45.c >> +++ b/drivers/net/phy/phy-c45.c >> @@ -71,6 +71,10 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev) >> return ret; >> >> return phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL2, ctrl2); >> + if (ret < 0) > > This patch does not make sense. > Right, was a typo. Interestingly the compiler didn't complain. I sent a v2 already. >> + return ret; >> + >> + return genphy_c45_an_disable_aneg(phydev); >> } >> EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced); >> >> -- >> 2.20.1 >> >> >> >
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c index bef126344..0374c50b1 100644 --- a/drivers/net/phy/phy-c45.c +++ b/drivers/net/phy/phy-c45.c @@ -71,6 +71,10 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev) return ret; return phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL2, ctrl2); + if (ret < 0) + return ret; + + return genphy_c45_an_disable_aneg(phydev); } EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced);
When genphy_c45_pma_setup_forced() is called the "aneg enabled" bit may still be set, therefore clear it. This is also in line with what genphy_setup_forced() does for Clause 22. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> --- drivers/net/phy/phy-c45.c | 4 ++++ 1 file changed, 4 insertions(+)