[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <00ef2d9e-2c30-9f13-f702-f692ce0baee9@broadcom.com>
Date: Mon, 8 May 2023 12:17:42 -0700
From: Florian Fainelli <florian.fainelli@...adcom.com>
To: Andrew Lunn <andrew@...n.ch>, Florian Fainelli <f.fainelli@...il.com>
Cc: netdev@...r.kernel.org, Doug Berger <opendmb@...il.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Heiner Kallweit <hkallweit1@...il.com>, Russell King
<linux@...linux.org.uk>, Marek BehĂșn <kabel@...nel.org>,
Peter Geis <pgwipeout@...il.com>, Frank <Frank.Sae@...or-comm.com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next 1/3] net: phy: Let drivers check Wake-on-LAN
status
On 5/8/23 12:02, Andrew Lunn wrote:
> On Mon, May 08, 2023 at 11:43:07AM -0700, Florian Fainelli wrote:
>> A few PHY drivers are currently attempting to not suspend the PHY when
>> Wake-on-LAN is enabled, however that code is not currently executing at
>> all due to an early check in phy_suspend().
>>
>> This prevents PHY drivers from making an appropriate decisions and put
>> the hardware into a low power state if desired.
>>
>> In order to allow the PHY framework to always call into the PHY driver's
>> ->suspend routine whether Wake-on-LAN is enabled or not, provide a
>> phydev::wol_enabled boolean that tracks whether the PHY or the attached
>> MAC has Wake-on-LAN enabled.
>>
>> If phydev::wol_enabled then the PHY shall not prevent its own
>> Wake-on-LAN detection logic from working and shall not prevent the
>> Ethernet MAC from receiving packets for matching.
>
> Hi Florian
>
> Did you look at using late_suspend for this? Then there would not be
> any need to change all these drivers which are happy as they are.
I did not know its existence until you mentioned it, this would require
plumbing all the way from the MDIO bus driver down to the PHY driver
level, which could be done, but for a single driver? The way Linux
suspends devices currently, and the fact that the interrupt is driven
level low, it does not give much room if at all for missing the
interrupt AFAICT.
phy_suspend() is called both from the system suspend path, but also
whenever the PHY is unused, and this is a nice property because we do
not really need to differentiate these paths usually, that includes
Wake-on-LAN.
Besides there are drivers like drivers/net/phy/at803x.c that wish to
isolate the PHY if WoL is enabled and which are currently not doing it
because this never gets called.
--
Florian
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4221 bytes)
Powered by blists - more mailing lists