[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7da02335-6c02-f9f8-5cdd-b9bf3734addb@gmail.com>
Date: Mon, 8 May 2023 12:18:36 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Florian Fainelli <florian.fainelli@...adcom.com>,
Andrew Lunn <andrew@...n.ch>
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:17, Florian Fainelli wrote:
> 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.
I suppose that a middle ground could be to introduce a specific callback
or flag that says: please call my suspend routine and I will do what's
necessary.
>
> 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
Powered by blists - more mailing lists