All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: phy: fix wrong mask to phy_modify()
@ 2018-02-12 11:02 Ingo van Lil
  2018-02-12 13:39 ` Andrew Lunn
  2018-02-12 16:47 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Ingo van Lil @ 2018-02-12 11:02 UTC (permalink / raw)
  To: linux-kernel, netdev, Russell King
  Cc: Andrew Lunn, Florian Fainelli, Ingo van Lil

When forcing a specific link mode, the PHY driver must clear the
existing speed and duplex bits in BMCR while preserving some other
control bits. This logic was accidentally inverted with the introduction
of phy_modify().

Signed-off-by: Ingo van Lil <inguin@gmx.de>
---
 drivers/net/phy/phy_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index b13eed21c87d..d39ae77707ef 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1382,7 +1382,7 @@ int genphy_setup_forced(struct phy_device *phydev)
 		ctl |= BMCR_FULLDPLX;
 
 	return phy_modify(phydev, MII_BMCR,
-			  BMCR_LOOPBACK | BMCR_ISOLATE | BMCR_PDOWN, ctl);
+			  ~(BMCR_LOOPBACK | BMCR_ISOLATE | BMCR_PDOWN), ctl);
 }
 EXPORT_SYMBOL(genphy_setup_forced);
 
-- 
2.14.3

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

* Re: [PATCH] net: phy: fix wrong mask to phy_modify()
  2018-02-12 11:02 [PATCH] net: phy: fix wrong mask to phy_modify() Ingo van Lil
@ 2018-02-12 13:39 ` Andrew Lunn
  2018-02-12 16:47 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2018-02-12 13:39 UTC (permalink / raw)
  To: Ingo van Lil; +Cc: linux-kernel, netdev, Russell King, Florian Fainelli

On Mon, Feb 12, 2018 at 12:02:52PM +0100, Ingo van Lil wrote:
> When forcing a specific link mode, the PHY driver must clear the
> existing speed and duplex bits in BMCR while preserving some other
> control bits. This logic was accidentally inverted with the introduction
> of phy_modify().
> 
> Signed-off-by: Ingo van Lil <inguin@gmx.de>

Fixes: fea23fb591cc ("net: phy: convert read-modify-write to phy_modify()")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH] net: phy: fix wrong mask to phy_modify()
  2018-02-12 11:02 [PATCH] net: phy: fix wrong mask to phy_modify() Ingo van Lil
  2018-02-12 13:39 ` Andrew Lunn
@ 2018-02-12 16:47 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-02-12 16:47 UTC (permalink / raw)
  To: inguin; +Cc: linux-kernel, netdev, rmk+kernel, andrew, f.fainelli

From: Ingo van Lil <inguin@gmx.de>
Date: Mon, 12 Feb 2018 12:02:52 +0100

> When forcing a specific link mode, the PHY driver must clear the
> existing speed and duplex bits in BMCR while preserving some other
> control bits. This logic was accidentally inverted with the introduction
> of phy_modify().
> 
> Signed-off-by: Ingo van Lil <inguin@gmx.de>

Applied and queued up for -stable.

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

end of thread, other threads:[~2018-02-12 16:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-12 11:02 [PATCH] net: phy: fix wrong mask to phy_modify() Ingo van Lil
2018-02-12 13:39 ` Andrew Lunn
2018-02-12 16:47 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.