[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <94d74b65-55ad-d070-2590-d21b79ff5abb@gmail.com>
Date: Thu, 1 Jun 2023 13:14:27 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Andrew Lunn <andrew@...n.ch>,
Detlev Casanova <detlev.casanova@...labora.com>
Cc: linux-kernel@...r.kernel.org, Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>, "David S . Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>, netdev@...r.kernel.org,
devicetree@...r.kernel.org
Subject: Re: [PATCH 2/2] net: phy: realtek: Add optional external PHY clock
On 6/1/23 12:37, Andrew Lunn wrote:
>> I'm not sure about this. Isn't the clock still necessary when suspended for
>> things like wake on lan ?
>
> Yes, but the PHY should know if its a WoL source, and not disable its
> own clock. There is some support for this in phylib, and Florian has
> also reworked it recently for Broadcom PHYs.
If you want to have the PHY driver have a chance to disable the clock if
Wake-on-LAN is disabled and therefore conserve power, you should set
PHY_ALWAYS_CALL_SUSPEND in the phy_driver::flags and in the
suspend/resume functions do something like:
suspend:
/* last step after all registers are accessed */
if (!phydev->wol_enabled)
clk_disable_unprepare()
resume:
/* first step before registers are accessed */
if (!phydev->wol_enabled)
clk_prepare_enable()
The flag is necessary to ensure that the PHY driver's suspend function
will be called. The resume will be called regardless of Wake-on-LAN
being enabled or not.
--
Florian
Powered by blists - more mailing lists