Thread (5 messages) flat view 5 messages, 4 authors, 2021-07-07

Re: [PATCH net] net: phy: skip disabling interrupt when WOL is enabled in shutdown

From: Florian Fainelli <f.fainelli@gmail.com>
Date: 2021-07-07 02:51:38
Also in: lkml


On 7/6/2021 5:57 PM, Andrew Lunn wrote:
On Wed, Jul 07, 2021 at 12:36:30AM +0000, Ismail, Mohammad Athari wrote:
quoted
quoted
-----Original Message-----
From: Andrew Lunn <andrew@lunn.ch>
Sent: Tuesday, July 6, 2021 9:14 PM
To: Ling, Pei Lee <redacted>
Cc: Heiner Kallweit <hkallweit1@gmail.com>; Russell King
[off-list ref]; davem@davemloft.net; Jakub Kicinski
[off-list ref]; Ioana Ciornei [off-list ref];
netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Voon, Weifeng
[off-list ref]; vee.khee.wong@linux.intel.com; Wong, Vee Khee
[off-list ref]; Ismail, Mohammad Athari
[off-list ref]
Subject: Re: [PATCH net] net: phy: skip disabling interrupt when WOL is enabled
in shutdown

On Tue, Jul 06, 2021 at 05:02:09PM +0800, Ling Pei Lee wrote:
quoted
From: Mohammad Athari Bin Ismail <redacted>

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.
If the device is being used to wake the system up, why is it being shutdown?
Hi Andrew,
quoted
When the platform goes to S5 state (ex: shutdown -h now), regardless
PHY WOL is enabled or not, phy_shutdown() is called. So, for the
platform that support WOL from S5, we need to make sure the PHY
still can trigger WOL event. Disabling the interrupt through
phy_disable_interrupts() in phy_shutdown() will disable WOL
interrupt as well and cause the PHY WOL not able to trigger.
This sounds like a firmware problem. If linux is shutdown, linux is
not controlling the hardware, the firmware is. So the firmware should
probably be configuring the PHY after Linux powers off.
There are platforms supporting S5 shutdown that don't run firmware and 
would also expect to be able to be woken-up from an Ethernet 
PHY/Wake-on-LAN scheme.

The problem that is being addressed here is that even if your Ethernet 
driver was playing through properly and attempting not to disable the 
Ethernet PHY in suspend or shutdown callback, that decision would be 
overridden by phy_shutdown() when the MDIO bus' shutdown is called and 
that breaks up that wake-up mode.
If Linux is suspended, then Linux is still controlling the hardware,
and it will not shutdown the PHY.

-- 
Florian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help