mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ling Pei Lee <pei.lee.ling@intel.com>
To: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	davem@davemloft.net, Jakub Kicinski <kuba@kernel.org>,
	Ioana Ciornei <ioana.ciornei@nxp.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: pei.lee.ling@intel.com, weifeng.voon@intel.com,
	vee.khee.wong@linux.intel.com, vee.khee.wong@intel.com,
	mohammad.athari.ismail@intel.com
Subject: [PATCH net] net: phy: skip disabling interrupt when WOL is enabled in shutdown
Date: Tue,  6 Jul 2021 17:02:09 +0800	[thread overview]
Message-ID: <20210706090209.1897027-1-pei.lee.ling@intel.com> (raw)

From: Mohammad Athari Bin Ismail <mohammad.athari.ismail@intel.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@intel.com>
Signed-off-by: Ling PeiLee <pei.lee.ling@intel.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


             reply	other threads:[~2021-07-06  9:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-06  9:02 Ling Pei Lee [this message]
2021-07-06 13:14 ` Andrew Lunn
2021-07-07  0:36   ` Ismail, Mohammad Athari
2021-07-07  0:57     ` Andrew Lunn
2021-07-07  2:51       ` Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210706090209.1897027-1-pei.lee.ling@intel.com \
    --to=pei.lee.ling@intel.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=ioana.ciornei@nxp.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mohammad.athari.ismail@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=vee.khee.wong@intel.com \
    --cc=vee.khee.wong@linux.intel.com \
    --cc=weifeng.voon@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®