netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] net: phy: add and use register modifying helpers returning 1 on change
@ 2019-02-10 18:56 Heiner Kallweit
  2019-02-10 18:57 ` [PATCH net-next 1/3] net: phy: add " Heiner Kallweit
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Heiner Kallweit @ 2019-02-10 18:56 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, David Miller; +Cc: netdev

Add and use register modifying helpers returning 1 on change.

Heiner Kallweit (3):
  net: phy: add register modifying helpers returning 1 on change
  net: phy: marvell10g: fix usage of new MMD modifying helpers
  net: phy: use phy_modify_changed in genphy_config_advert

 drivers/net/phy/marvell10g.c |  13 ++--
 drivers/net/phy/phy-core.c   | 127 ++++++++++++++++++++++++++++++++---
 drivers/net/phy/phy_device.c |  43 +++++-------
 include/linux/phy.h          |  12 +++-
 4 files changed, 149 insertions(+), 46 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH net-next 1/3] net: phy: add register modifying helpers returning 1 on change
  2019-02-10 18:56 [PATCH net-next 0/3] net: phy: add and use register modifying helpers returning 1 on change Heiner Kallweit
@ 2019-02-10 18:57 ` Heiner Kallweit
  2019-02-10 19:43   ` Andrew Lunn
  2019-02-10 20:27   ` Florian Fainelli
  2019-02-10 18:58 ` [PATCH net-next 2/3] net: phy: marvell10g: fix usage of new MMD modifying helpers Heiner Kallweit
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 11+ messages in thread
From: Heiner Kallweit @ 2019-02-10 18:57 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, David Miller; +Cc: netdev

When modifying registers there are scenarios where we need to know
whether the register content actually changed. This patch adds
new helpers to not break users of the current ones, phy_modify() etc.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/phy-core.c | 127 ++++++++++++++++++++++++++++++++++---
 include/linux/phy.h        |  12 +++-
 2 files changed, 128 insertions(+), 11 deletions(-)

diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c
index 7d6aad287..cdea028d1 100644
--- a/drivers/net/phy/phy-core.c
+++ b/drivers/net/phy/phy-core.c
@@ -531,7 +531,7 @@ int phy_write_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val)
 EXPORT_SYMBOL(phy_write_mmd);
 
 /**
- * __phy_modify() - Convenience function for modifying a PHY register
+ * __phy_modify_changed() - Convenience function for modifying a PHY register
  * @phydev: a pointer to a &struct phy_device
  * @regnum: register number
  * @mask: bit mask of bits to clear
@@ -539,16 +539,69 @@ EXPORT_SYMBOL(phy_write_mmd);
  *
  * Unlocked helper function which allows a PHY register to be modified as
  * new register value = (old register value & ~mask) | set
+ *
+ * Returns negative errno, 0 if there was no change, and 1 in case of change
  */
-int __phy_modify(struct phy_device *phydev, u32 regnum, u16 mask, u16 set)
+int __phy_modify_changed(struct phy_device *phydev, u32 regnum, u16 mask,
+			 u16 set)
 {
-	int ret;
+	int new, ret;
 
 	ret = __phy_read(phydev, regnum);
 	if (ret < 0)
 		return ret;
 
-	ret = __phy_write(phydev, regnum, (ret & ~mask) | set);
+	new = (ret & ~mask) | set;
+	if (new == ret)
+		return 0;
+
+	ret = __phy_write(phydev, regnum, new);
+
+	return ret < 0 ? ret : 1;
+}
+EXPORT_SYMBOL_GPL(__phy_modify_changed);
+
+/**
+ * phy_modify_changed - Function for modifying a PHY register
+ * @phydev: the phy_device struct
+ * @regnum: register number to modify
+ * @mask: bit mask of bits to clear
+ * @set: new value of bits set in mask to write to @regnum
+ *
+ * NOTE: MUST NOT be called from interrupt context,
+ * because the bus read/write functions may wait for an interrupt
+ * to conclude the operation.
+ *
+ * Returns negative errno, 0 if there was no change, and 1 in case of change
+ */
+int phy_modify_changed(struct phy_device *phydev, u32 regnum, u16 mask, u16 set)
+{
+	int ret;
+
+	mutex_lock(&phydev->mdio.bus->mdio_lock);
+	ret = __phy_modify_changed(phydev, regnum, mask, set);
+	mutex_unlock(&phydev->mdio.bus->mdio_lock);
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(phy_modify_changed);
+
+/**
+ * __phy_modify - Convenience function for modifying a PHY register
+ * @phydev: the phy_device struct
+ * @regnum: register number to modify
+ * @mask: bit mask of bits to clear
+ * @set: new value of bits set in mask to write to @regnum
+ *
+ * NOTE: MUST NOT be called from interrupt context,
+ * because the bus read/write functions may wait for an interrupt
+ * to conclude the operation.
+ */
+int __phy_modify(struct phy_device *phydev, u32 regnum, u16 mask, u16 set)
+{
+	int ret;
+
+	ret = __phy_modify_changed(phydev, regnum, mask, set);
 
 	return ret < 0 ? ret : 0;
 }
@@ -578,7 +631,7 @@ int phy_modify(struct phy_device *phydev, u32 regnum, u16 mask, u16 set)
 EXPORT_SYMBOL_GPL(phy_modify);
 
 /**
- * __phy_modify_mmd - Convenience function for modifying a register on MMD
+ * __phy_modify_mmd_changed - Function for modifying a register on MMD
  * @phydev: the phy_device struct
  * @devad: the MMD containing register to modify
  * @regnum: register number to modify
@@ -587,17 +640,73 @@ EXPORT_SYMBOL_GPL(phy_modify);
  *
  * Unlocked helper function which allows a MMD register to be modified as
  * new register value = (old register value & ~mask) | set
+ *
+ * Returns negative errno, 0 if there was no change, and 1 in case of change
  */
-int __phy_modify_mmd(struct phy_device *phydev, int devad, u32 regnum,
-		     u16 mask, u16 set)
+int __phy_modify_mmd_changed(struct phy_device *phydev, int devad, u32 regnum,
+			     u16 mask, u16 set)
 {
-	int ret;
+	int new, ret;
 
 	ret = __phy_read_mmd(phydev, devad, regnum);
 	if (ret < 0)
 		return ret;
 
-	ret = __phy_write_mmd(phydev, devad, regnum, (ret & ~mask) | set);
+	new = (ret & ~mask) | set;
+	if (new == ret)
+		return 0;
+
+	ret = __phy_write_mmd(phydev, devad, regnum, new);
+
+	return ret < 0 ? ret : 1;
+}
+EXPORT_SYMBOL_GPL(__phy_modify_mmd_changed);
+
+/**
+ * phy_modify_mmd_changed - Function for modifying a register on MMD
+ * @phydev: the phy_device struct
+ * @devad: the MMD containing register to modify
+ * @regnum: register number to modify
+ * @mask: bit mask of bits to clear
+ * @set: new value of bits set in mask to write to @regnum
+ *
+ * NOTE: MUST NOT be called from interrupt context,
+ * because the bus read/write functions may wait for an interrupt
+ * to conclude the operation.
+ *
+ * Returns negative errno, 0 if there was no change, and 1 in case of change
+ */
+int phy_modify_mmd_changed(struct phy_device *phydev, int devad, u32 regnum,
+			   u16 mask, u16 set)
+{
+	int ret;
+
+	mutex_lock(&phydev->mdio.bus->mdio_lock);
+	ret = __phy_modify_mmd_changed(phydev, devad, regnum, mask, set);
+	mutex_unlock(&phydev->mdio.bus->mdio_lock);
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(phy_modify_mmd_changed);
+
+/**
+ * __phy_modify_mmd - Convenience function for modifying a register on MMD
+ * @phydev: the phy_device struct
+ * @devad: the MMD containing register to modify
+ * @regnum: register number to modify
+ * @mask: bit mask of bits to clear
+ * @set: new value of bits set in mask to write to @regnum
+ *
+ * NOTE: MUST NOT be called from interrupt context,
+ * because the bus read/write functions may wait for an interrupt
+ * to conclude the operation.
+ */
+int __phy_modify_mmd(struct phy_device *phydev, int devad, u32 regnum,
+		     u16 mask, u16 set)
+{
+	int ret;
+
+	ret = __phy_modify_mmd_changed(phydev, devad, regnum, mask, set);
 
 	return ret < 0 ? ret : 0;
 }
diff --git a/include/linux/phy.h b/include/linux/phy.h
index d2ffae992..378da9a61 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -799,13 +799,21 @@ int phy_write_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val);
  */
 int __phy_write_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val);
 
+int __phy_modify_changed(struct phy_device *phydev, u32 regnum, u16 mask,
+			 u16 set);
+int phy_modify_changed(struct phy_device *phydev, u32 regnum, u16 mask,
+		       u16 set);
 int __phy_modify(struct phy_device *phydev, u32 regnum, u16 mask, u16 set);
 int phy_modify(struct phy_device *phydev, u32 regnum, u16 mask, u16 set);
 
+int __phy_modify_mmd_changed(struct phy_device *phydev, int devad, u32 regnum,
+			     u16 mask, u16 set);
+int phy_modify_mmd_changed(struct phy_device *phydev, int devad, u32 regnum,
+			   u16 mask, u16 set);
 int __phy_modify_mmd(struct phy_device *phydev, int devad, u32 regnum,
-		u16 mask, u16 set);
+		     u16 mask, u16 set);
 int phy_modify_mmd(struct phy_device *phydev, int devad, u32 regnum,
-		u16 mask, u16 set);
+		   u16 mask, u16 set);
 
 /**
  * __phy_set_bits - Convenience function for setting bits in a PHY register
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH net-next 2/3] net: phy: marvell10g: fix usage of new MMD modifying helpers
  2019-02-10 18:56 [PATCH net-next 0/3] net: phy: add and use register modifying helpers returning 1 on change Heiner Kallweit
  2019-02-10 18:57 ` [PATCH net-next 1/3] net: phy: add " Heiner Kallweit
@ 2019-02-10 18:58 ` Heiner Kallweit
  2019-02-10 19:44   ` Andrew Lunn
  2019-02-10 20:27   ` Florian Fainelli
  2019-02-10 18:59 ` [PATCH net-next 3/3] net: phy: use phy_modify_changed in genphy_config_advert Heiner Kallweit
  2019-02-10 20:53 ` [PATCH net-next 0/3] net: phy: add and use register modifying helpers returning 1 on change David Miller
  3 siblings, 2 replies; 11+ messages in thread
From: Heiner Kallweit @ 2019-02-10 18:58 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, David Miller; +Cc: netdev

When replacing mv3310_modify() with phy_modify_mmd() we missed that
they behave differently, mv3310_modify() returns 1 on a changed
register value whilst phy_modify_mmd() returns 0. Fix this by replacing
phy_modify_mmd() with phy_modify_mmd_changed() where needed.

Fixes: b52c018ddccf ("net: phy: make use of new MMD accessors")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/marvell10g.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 96a79c6c7..08362dc65 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -141,10 +141,9 @@ static int mv3310_hwmon_config(struct phy_device *phydev, bool enable)
 		return ret;
 
 	val = enable ? MV_V2_TEMP_CTRL_SAMPLE : MV_V2_TEMP_CTRL_DISABLE;
-	ret = phy_modify_mmd(phydev, MDIO_MMD_VEND2, MV_V2_TEMP_CTRL,
-			     MV_V2_TEMP_CTRL_MASK, val);
 
-	return ret < 0 ? ret : 0;
+	return phy_modify_mmd(phydev, MDIO_MMD_VEND2, MV_V2_TEMP_CTRL,
+			      MV_V2_TEMP_CTRL_MASK, val);
 }
 
 static void mv3310_hwmon_disable(void *data)
@@ -345,7 +344,7 @@ static int mv3310_config_aneg(struct phy_device *phydev)
 	linkmode_and(phydev->advertising, phydev->advertising,
 		     phydev->supported);
 
-	ret = phy_modify_mmd(phydev, MDIO_MMD_AN, MDIO_AN_ADVERTISE,
+	ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_ADVERTISE,
 			     ADVERTISE_ALL | ADVERTISE_100BASE4 |
 			     ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM,
 			     linkmode_adv_to_mii_adv_t(phydev->advertising));
@@ -355,7 +354,7 @@ static int mv3310_config_aneg(struct phy_device *phydev)
 		changed = true;
 
 	reg = linkmode_adv_to_mii_ctrl1000_t(phydev->advertising);
-	ret = phy_modify_mmd(phydev, MDIO_MMD_AN, MV_AN_CTRL1000,
+	ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MV_AN_CTRL1000,
 			     ADVERTISE_1000FULL | ADVERTISE_1000HALF, reg);
 	if (ret < 0)
 		return ret;
@@ -369,8 +368,8 @@ static int mv3310_config_aneg(struct phy_device *phydev)
 	else
 		reg = 0;
 
-	ret = phy_modify_mmd(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL,
-			     MDIO_AN_10GBT_CTRL_ADV10G, reg);
+	ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL,
+				     MDIO_AN_10GBT_CTRL_ADV10G, reg);
 	if (ret < 0)
 		return ret;
 	if (ret > 0)
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH net-next 3/3] net: phy: use phy_modify_changed in genphy_config_advert
  2019-02-10 18:56 [PATCH net-next 0/3] net: phy: add and use register modifying helpers returning 1 on change Heiner Kallweit
  2019-02-10 18:57 ` [PATCH net-next 1/3] net: phy: add " Heiner Kallweit
  2019-02-10 18:58 ` [PATCH net-next 2/3] net: phy: marvell10g: fix usage of new MMD modifying helpers Heiner Kallweit
@ 2019-02-10 18:59 ` Heiner Kallweit
  2019-02-10 19:46   ` Andrew Lunn
  2019-02-10 20:28   ` Florian Fainelli
  2019-02-10 20:53 ` [PATCH net-next 0/3] net: phy: add and use register modifying helpers returning 1 on change David Miller
  3 siblings, 2 replies; 11+ messages in thread
From: Heiner Kallweit @ 2019-02-10 18:59 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, David Miller; +Cc: netdev

Use phy_modify_changed() to simplify the code.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/phy_device.c | 43 +++++++++++++-----------------------
 1 file changed, 15 insertions(+), 28 deletions(-)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 8573d17ec..3d14e48ae 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1516,7 +1516,7 @@ EXPORT_SYMBOL(phy_reset_after_clk_enable);
 static int genphy_config_advert(struct phy_device *phydev)
 {
 	u32 advertise;
-	int oldadv, adv, bmsr;
+	int bmsr, adv;
 	int err, changed = 0;
 
 	/* Only allow advertising what this PHY supports */
@@ -1529,22 +1529,14 @@ static int genphy_config_advert(struct phy_device *phydev)
 			    phydev->advertising);
 
 	/* Setup standard advertisement */
-	adv = phy_read(phydev, MII_ADVERTISE);
-	if (adv < 0)
-		return adv;
-
-	oldadv = adv;
-	adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4 | ADVERTISE_PAUSE_CAP |
-		 ADVERTISE_PAUSE_ASYM);
-	adv |= ethtool_adv_to_mii_adv_t(advertise);
-
-	if (adv != oldadv) {
-		err = phy_write(phydev, MII_ADVERTISE, adv);
-
-		if (err < 0)
-			return err;
+	err = phy_modify_changed(phydev, MII_ADVERTISE,
+				 ADVERTISE_ALL | ADVERTISE_100BASE4 |
+				 ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM,
+				 ethtool_adv_to_mii_adv_t(advertise));
+	if (err < 0)
+		return err;
+	if (err > 0)
 		changed = 1;
-	}
 
 	bmsr = phy_read(phydev, MII_BMSR);
 	if (bmsr < 0)
@@ -1558,25 +1550,20 @@ static int genphy_config_advert(struct phy_device *phydev)
 		return changed;
 
 	/* Configure gigabit if it's supported */
-	adv = phy_read(phydev, MII_CTRL1000);
-	if (adv < 0)
-		return adv;
-
-	oldadv = adv;
-	adv &= ~(ADVERTISE_1000FULL | ADVERTISE_1000HALF);
-
+	adv = 0;
 	if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT,
 			      phydev->supported) ||
 	    linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
 			      phydev->supported))
-		adv |= ethtool_adv_to_mii_ctrl1000_t(advertise);
+		adv = ethtool_adv_to_mii_ctrl1000_t(advertise);
 
-	if (adv != oldadv)
-		changed = 1;
-
-	err = phy_write(phydev, MII_CTRL1000, adv);
+	err = phy_modify_changed(phydev, MII_CTRL1000,
+				 ADVERTISE_1000FULL | ADVERTISE_1000HALF,
+				 adv);
 	if (err < 0)
 		return err;
+	if (err > 0)
+		changed = 1;
 
 	return changed;
 }
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 1/3] net: phy: add register modifying helpers returning 1 on change
  2019-02-10 18:57 ` [PATCH net-next 1/3] net: phy: add " Heiner Kallweit
@ 2019-02-10 19:43   ` Andrew Lunn
  2019-02-10 20:27   ` Florian Fainelli
  1 sibling, 0 replies; 11+ messages in thread
From: Andrew Lunn @ 2019-02-10 19:43 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: Florian Fainelli, David Miller, netdev

On Sun, Feb 10, 2019 at 07:57:56PM +0100, Heiner Kallweit wrote:
> When modifying registers there are scenarios where we need to know
> whether the register content actually changed. This patch adds
> new helpers to not break users of the current ones, phy_modify() etc.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 2/3] net: phy: marvell10g: fix usage of new MMD modifying helpers
  2019-02-10 18:58 ` [PATCH net-next 2/3] net: phy: marvell10g: fix usage of new MMD modifying helpers Heiner Kallweit
@ 2019-02-10 19:44   ` Andrew Lunn
  2019-02-10 20:27   ` Florian Fainelli
  1 sibling, 0 replies; 11+ messages in thread
From: Andrew Lunn @ 2019-02-10 19:44 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: Florian Fainelli, David Miller, netdev

On Sun, Feb 10, 2019 at 07:58:49PM +0100, Heiner Kallweit wrote:
> When replacing mv3310_modify() with phy_modify_mmd() we missed that
> they behave differently, mv3310_modify() returns 1 on a changed
> register value whilst phy_modify_mmd() returns 0. Fix this by replacing
> phy_modify_mmd() with phy_modify_mmd_changed() where needed.
> 
> Fixes: b52c018ddccf ("net: phy: make use of new MMD accessors")
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Sorry, my bad.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 3/3] net: phy: use phy_modify_changed in genphy_config_advert
  2019-02-10 18:59 ` [PATCH net-next 3/3] net: phy: use phy_modify_changed in genphy_config_advert Heiner Kallweit
@ 2019-02-10 19:46   ` Andrew Lunn
  2019-02-10 20:28   ` Florian Fainelli
  1 sibling, 0 replies; 11+ messages in thread
From: Andrew Lunn @ 2019-02-10 19:46 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: Florian Fainelli, David Miller, netdev

On Sun, Feb 10, 2019 at 07:59:57PM +0100, Heiner Kallweit wrote:
> Use phy_modify_changed() to simplify the code.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 1/3] net: phy: add register modifying helpers returning 1 on change
  2019-02-10 18:57 ` [PATCH net-next 1/3] net: phy: add " Heiner Kallweit
  2019-02-10 19:43   ` Andrew Lunn
@ 2019-02-10 20:27   ` Florian Fainelli
  1 sibling, 0 replies; 11+ messages in thread
From: Florian Fainelli @ 2019-02-10 20:27 UTC (permalink / raw)
  To: Heiner Kallweit, Andrew Lunn, David Miller; +Cc: netdev

Le 2/10/19 à 10:57 AM, Heiner Kallweit a écrit :
> When modifying registers there are scenarios where we need to know
> whether the register content actually changed. This patch adds
> new helpers to not break users of the current ones, phy_modify() etc.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 2/3] net: phy: marvell10g: fix usage of new MMD modifying helpers
  2019-02-10 18:58 ` [PATCH net-next 2/3] net: phy: marvell10g: fix usage of new MMD modifying helpers Heiner Kallweit
  2019-02-10 19:44   ` Andrew Lunn
@ 2019-02-10 20:27   ` Florian Fainelli
  1 sibling, 0 replies; 11+ messages in thread
From: Florian Fainelli @ 2019-02-10 20:27 UTC (permalink / raw)
  To: Heiner Kallweit, Andrew Lunn, David Miller; +Cc: netdev

Le 2/10/19 à 10:58 AM, Heiner Kallweit a écrit :
> When replacing mv3310_modify() with phy_modify_mmd() we missed that
> they behave differently, mv3310_modify() returns 1 on a changed
> register value whilst phy_modify_mmd() returns 0. Fix this by replacing
> phy_modify_mmd() with phy_modify_mmd_changed() where needed.
> 
> Fixes: b52c018ddccf ("net: phy: make use of new MMD accessors")
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 3/3] net: phy: use phy_modify_changed in genphy_config_advert
  2019-02-10 18:59 ` [PATCH net-next 3/3] net: phy: use phy_modify_changed in genphy_config_advert Heiner Kallweit
  2019-02-10 19:46   ` Andrew Lunn
@ 2019-02-10 20:28   ` Florian Fainelli
  1 sibling, 0 replies; 11+ messages in thread
From: Florian Fainelli @ 2019-02-10 20:28 UTC (permalink / raw)
  To: Heiner Kallweit, Andrew Lunn, David Miller; +Cc: netdev

Le 2/10/19 à 10:59 AM, Heiner Kallweit a écrit :
> Use phy_modify_changed() to simplify the code.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 0/3] net: phy: add and use register modifying helpers returning 1 on change
  2019-02-10 18:56 [PATCH net-next 0/3] net: phy: add and use register modifying helpers returning 1 on change Heiner Kallweit
                   ` (2 preceding siblings ...)
  2019-02-10 18:59 ` [PATCH net-next 3/3] net: phy: use phy_modify_changed in genphy_config_advert Heiner Kallweit
@ 2019-02-10 20:53 ` David Miller
  3 siblings, 0 replies; 11+ messages in thread
From: David Miller @ 2019-02-10 20:53 UTC (permalink / raw)
  To: hkallweit1; +Cc: andrew, f.fainelli, netdev

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Sun, 10 Feb 2019 19:56:47 +0100

> Add and use register modifying helpers returning 1 on change.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-02-10 20:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-10 18:56 [PATCH net-next 0/3] net: phy: add and use register modifying helpers returning 1 on change Heiner Kallweit
2019-02-10 18:57 ` [PATCH net-next 1/3] net: phy: add " Heiner Kallweit
2019-02-10 19:43   ` Andrew Lunn
2019-02-10 20:27   ` Florian Fainelli
2019-02-10 18:58 ` [PATCH net-next 2/3] net: phy: marvell10g: fix usage of new MMD modifying helpers Heiner Kallweit
2019-02-10 19:44   ` Andrew Lunn
2019-02-10 20:27   ` Florian Fainelli
2019-02-10 18:59 ` [PATCH net-next 3/3] net: phy: use phy_modify_changed in genphy_config_advert Heiner Kallweit
2019-02-10 19:46   ` Andrew Lunn
2019-02-10 20:28   ` Florian Fainelli
2019-02-10 20:53 ` [PATCH net-next 0/3] net: phy: add and use register modifying helpers returning 1 on change David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).