From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo van Lil Subject: [PATCH] net: phy: fix wrong mask to phy_modify() Date: Mon, 12 Feb 2018 12:02:52 +0100 Message-ID: <20180212110252.27804-1-inguin@gmx.de> Cc: Andrew Lunn , Florian Fainelli , Ingo van Lil To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Russell King Return-path: Received: from mout.gmx.net ([212.227.15.18]:36745 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933581AbeBLLFT (ORCPT ); Mon, 12 Feb 2018 06:05:19 -0500 Sender: netdev-owner@vger.kernel.org List-ID: 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 --- 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