diff mbox

net: phy: reset only targeted phy

Message ID 1449133355-7668-1-git-send-email-jezz@sysmic.org
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Jérôme Pouiller Dec. 3, 2015, 9:02 a.m. UTC
It is possible to address another chip on same MDIO bus. The case is
correctly handled for media advertising. It is taken into account
only if mii_data->phy_id == phydev->addr. However, this condition
was missing for reset case.

Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
---
 drivers/net/phy/phy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

David Miller Dec. 3, 2015, 8:27 p.m. UTC | #1
From: Jérôme Pouiller <jezz@sysmic.org>
Date: Thu,  3 Dec 2015 10:02:35 +0100

> It is possible to address another chip on same MDIO bus. The case is
> correctly handled for media advertising. It is taken into account
> only if mii_data->phy_id == phydev->addr. However, this condition
> was missing for reset case.
> 
> Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 48ce6ef..47cd306 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -448,7 +448,8 @@  int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd)
 		mdiobus_write(phydev->bus, mii_data->phy_id,
 			      mii_data->reg_num, val);
 
-		if (mii_data->reg_num == MII_BMCR &&
+		if (mii_data->phy_id == phydev->addr &&
+		    mii_data->reg_num == MII_BMCR &&
 		    val & BMCR_RESET)
 			return phy_init_hw(phydev);