From: Florian Fainelli <f.fainelli@gmail.com>
To: Florian Fainelli <florian.fainelli@broadcom.com>,
Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, "Doug Berger" <opendmb@gmail.com>,
"Broadcom internal kernel review list"
<bcm-kernel-feedback-list@broadcom.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"Russell King" <linux@armlinux.org.uk>,
"Marek Behún" <kabel@kernel.org>,
"Peter Geis" <pgwipeout@gmail.com>,
Frank <Frank.Sae@motor-comm.com>,
"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next 1/3] net: phy: Let drivers check Wake-on-LAN status
Date: Mon, 8 May 2023 12:18:36 -0700 [thread overview]
Message-ID: <7da02335-6c02-f9f8-5cdd-b9bf3734addb@gmail.com> (raw)
In-Reply-To: <00ef2d9e-2c30-9f13-f702-f692ce0baee9@broadcom.com>
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
next prev parent reply other threads:[~2023-05-08 19:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-08 18:43 [PATCH net-next 0/3] Support for Wake-on-LAN for Broadcom PHYs Florian Fainelli
2023-05-08 18:43 ` [PATCH net-next 1/3] net: phy: Let drivers check Wake-on-LAN status Florian Fainelli
2023-05-08 19:02 ` Andrew Lunn
2023-05-08 19:17 ` Florian Fainelli
2023-05-08 19:18 ` Florian Fainelli [this message]
2023-05-08 18:43 ` [PATCH net-next 2/3] net: phy: broadcom: Add support for Wake-on-LAN Florian Fainelli
2023-05-08 19:09 ` Andrew Lunn
2023-05-08 19:12 ` Florian Fainelli
2023-05-08 19:23 ` Simon Horman
2023-05-09 9:25 ` kernel test robot
2023-05-08 18:43 ` [PATCH net-next 3/3] net: bcmgenet: Add support for PHY-based Wake-on-LAN 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=7da02335-6c02-f9f8-5cdd-b9bf3734addb@gmail.com \
--to=f.fainelli@gmail.com \
--cc=Frank.Sae@motor-comm.com \
--cc=andrew@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=florian.fainelli@broadcom.com \
--cc=hkallweit1@gmail.com \
--cc=kabel@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=opendmb@gmail.com \
--cc=pabeni@redhat.com \
--cc=pgwipeout@gmail.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®