[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210706090209.1897027-1-pei.lee.ling@intel.com>
Date: Tue, 6 Jul 2021 17:02:09 +0800
From: Ling Pei Lee <pei.lee.ling@...el.com>
To: Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>, davem@...emloft.net,
Jakub Kicinski <kuba@...nel.org>,
Ioana Ciornei <ioana.ciornei@....com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: pei.lee.ling@...el.com, weifeng.voon@...el.com,
vee.khee.wong@...ux.intel.com, vee.khee.wong@...el.com,
mohammad.athari.ismail@...el.com
Subject: [PATCH net] net: phy: skip disabling interrupt when WOL is enabled in shutdown
From: Mohammad Athari Bin Ismail <mohammad.athari.ismail@...el.com>
PHY WOL requires WOL interrupt event to trigger the WOL signal
in order to wake up the system. Hence, the PHY driver should not
disable the interrupt during shutdown if PHY WOL is enabled.
Fixes: e2f016cf7751 ("net: phy: add a shutdown procedure")
Signed-off-by: Mohammad Athari Bin Ismail <mohammad.athari.ismail@...el.com>
Signed-off-by: Ling PeiLee <pei.lee.ling@...el.com>
---
drivers/net/phy/phy_device.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 1539ea021ac0..f4b88f613dc1 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -2994,9 +2994,13 @@ static int phy_remove(struct device *dev)
static void phy_shutdown(struct device *dev)
{
+ struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL };
struct phy_device *phydev = to_phy_device(dev);
- phy_disable_interrupts(phydev);
+ /* If the device has WOL enabled, don't disable interrupts. */
+ phy_ethtool_get_wol(phydev, &wol);
+ if (!wol.wolopts)
+ phy_disable_interrupts(phydev);
}
/**
--
2.25.1
Powered by blists - more mailing lists