Commit 82942112 authored by Alexandre Belloni's avatar Alexandre Belloni Committed by Marcelo Henrique Cerri

phy: micrel: Ensure interrupts are reenabled on resume

BugLink: https://bugs.launchpad.net/bugs/1881356

[ Upstream commit f5aba91d ]

At least on ksz8081, when getting back from power down, interrupts are
disabled. ensure they are reenabled if they were previously enabled.

This fixes resuming which is failing on the xplained boards from atmel
since 321beec5 (net: phy: Use interrupts when available in NOLINK
state)

Fixes: 321beec5 (net: phy: Use interrupts when available in NOLINK state)
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent 6070916e
...@@ -592,6 +592,21 @@ ksz9021_wr_mmd_phyreg(struct phy_device *phydev, int ptrad, int devnum, ...@@ -592,6 +592,21 @@ ksz9021_wr_mmd_phyreg(struct phy_device *phydev, int ptrad, int devnum,
{ {
} }
static int kszphy_resume(struct phy_device *phydev)
{
int value;
mutex_lock(&phydev->lock);
value = phy_read(phydev, MII_BMCR);
phy_write(phydev, MII_BMCR, value & ~BMCR_PDOWN);
kszphy_config_intr(phydev);
mutex_unlock(&phydev->lock);
return 0;
}
static int kszphy_probe(struct phy_device *phydev) static int kszphy_probe(struct phy_device *phydev)
{ {
const struct kszphy_type *type = phydev->drv->driver_data; const struct kszphy_type *type = phydev->drv->driver_data;
...@@ -783,7 +798,7 @@ static struct phy_driver ksphy_driver[] = { ...@@ -783,7 +798,7 @@ static struct phy_driver ksphy_driver[] = {
.ack_interrupt = kszphy_ack_interrupt, .ack_interrupt = kszphy_ack_interrupt,
.config_intr = kszphy_config_intr, .config_intr = kszphy_config_intr,
.suspend = genphy_suspend, .suspend = genphy_suspend,
.resume = genphy_resume, .resume = kszphy_resume,
.driver = { .owner = THIS_MODULE,}, .driver = { .owner = THIS_MODULE,},
}, { }, {
.phy_id = PHY_ID_KSZ8061, .phy_id = PHY_ID_KSZ8061,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment