summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard Crestez <leonard.crestez@nxp.com>2018-04-19 20:17:35 +0300
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:31:17 +0800
commit610d1454e060be3b65cc2383b80b09a4255fdbfd (patch)
treec712ed0aec0cb238d4861935a6a1118e13ea64de
parent5a80b116468e024ac4f2a2112dbbbae71460bf7c (diff)
Revert "MLK-10919 net: phy: micrel: add ksz8081 resume function"
This reverts commit c961b277abd69175e1b1ad733ed6b2b911a61211. This patched worked on 4.14.18 but on 4.14.34 it now causes a deadlock because upstream changed phy locking: commit 6bccf8962b78 ("net: phy: Restore phy_resume() locking assumption"): https://bitbucket.sw.nxp.com/projects/IMX/repos/linux-imx/commits/6bccf8962b7874a2e66c2f78c9e48e0a7012c541 Instead of fixing locking just revert this patch, a different fix was already upsteamed for ksz8081 suspend/resume on 6ul-14x14-evk: commit e6f4292ae0a1 ("ARM: dts: imx6ul-14x14-evk: Add ksz8081 phy properties"): https://bitbucket.sw.nxp.com/projects/IMX/repos/linux-imx/commits/e6f4292ae0a1e73fae26ced57de13a48f71ad1fa commit 79e498a9c7da ("net: phy: micrel: Restore led_mode and clk_sel on resume"): https://bitbucket.sw.nxp.com/projects/IMX/repos/linux-imx/commits/79e498a9c7da0737829ff864aae44df434105676 After reverting this patch suspend/resume still works on imx6ul and imx6ull evk boards. Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Acked-by: Fugang Duan <fugang.duan@nxp.com>
-rw-r--r--drivers/net/phy/micrel.c18
-rw-r--r--drivers/net/phy/phy_device.c3
-rw-r--r--include/linux/phy.h1
3 files changed, 2 insertions, 20 deletions
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index c94cff1a2133..6c45ff650ec7 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -791,22 +791,6 @@ static int kszphy_probe(struct phy_device *phydev)
return 0;
}
-static int ksz8081_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);
-
- value = phy_scan_fixups(phydev);
- if (value < 0)
- return value;
- mutex_unlock(&phydev->lock);
-
- return 0;
-}
-
static struct phy_driver ksphy_driver[] = {
{
.phy_id = PHY_ID_KS8737,
@@ -947,7 +931,7 @@ static struct phy_driver ksphy_driver[] = {
.get_strings = kszphy_get_strings,
.get_stats = kszphy_get_stats,
.suspend = kszphy_suspend,
- .resume = ksz8081_resume,
+ .resume = kszphy_resume,
}, {
.phy_id = PHY_ID_KSZ8061,
.name = "Micrel KSZ8061",
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 404cd1e17be3..d09b652bb9fe 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -302,7 +302,7 @@ static int phy_needs_fixup(struct phy_device *phydev, struct phy_fixup *fixup)
}
/* Runs any matching fixups for this phydev */
-int phy_scan_fixups(struct phy_device *phydev)
+static int phy_scan_fixups(struct phy_device *phydev)
{
struct phy_fixup *fixup;
@@ -322,7 +322,6 @@ int phy_scan_fixups(struct phy_device *phydev)
return 0;
}
-EXPORT_SYMBOL(phy_scan_fixups);
static int phy_bus_match(struct device *dev, struct device_driver *drv)
{
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 1c77a008dddb..16caed3a7f8a 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -915,7 +915,6 @@ int phy_start_interrupts(struct phy_device *phydev);
void phy_print_status(struct phy_device *phydev);
int phy_set_max_speed(struct phy_device *phydev, u32 max_speed);
-int phy_scan_fixups(struct phy_device *phydev);
int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
int (*run)(struct phy_device *));
int phy_register_fixup_for_id(const char *bus_id,