Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d5cf9e3 authored by Suraj Jaiswal's avatar Suraj Jaiswal
Browse files

net: phy: Fix WOL in Micrel phy



Generic Phy Resume/Suspend API's already hold the mutex and
holding the mutex in Micrel will cause a deadlock.
Make a change to remove the  mutex locks in Micrel code.

Change-Id: Ib3bd976dc70f7669ee1e34658b565921d6704e25
Signed-off-by: default avatarSuraj Jaiswal <jsuraj@codeaurora.org>
parent 4c16f4bd
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -926,8 +926,6 @@ static int ksz9031_suspend(struct phy_device *phydev)
	int wol_enabled;
	u32 reg_value;

	mutex_lock(&phydev->lock);

	reg_value = ksz9031_extended_read(
	   phydev, OP_DATA, 0x2, MII_KSZPHY_OMSO_REG);
	wol_enabled = reg_value & MII_KSZPHY_OMSO_PME_N2;
@@ -939,7 +937,6 @@ static int ksz9031_suspend(struct phy_device *phydev)
		value |= BMCR_PDOWN;

	phy_write(phydev, MII_BMCR, value);
	mutex_unlock(&phydev->lock);

	return 0;
}
@@ -948,14 +945,10 @@ static int ksz9031_resume(struct phy_device *phydev)
{
	int value;

	mutex_lock(&phydev->lock);

	value = phy_read(phydev, MII_BMCR);
	value &= ~(BMCR_PDOWN | BMCR_ISOLATE);
	phy_write(phydev, MII_BMCR, value);

	mutex_unlock(&phydev->lock);

	return 0;
}