lkml.org 
[lkml]   [2023]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/2] net: phy: realtek: Add optional external PHY clock
From
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

\
 
 \ /
  Last update: 2023-06-01 22:16    [W:0.051 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site