Re: [PATCH RFC WIP 0/2] net: stmmac: dwmac-rk: add support for PHY wake on LAN

From: Javier Carrasco
Date: Thu Nov 23 2023 - 14:28:24 EST


Hi Andrew,

On 23.11.23 20:04, Andrew Lunn wrote:
>> Setting the USE_PHY_WOL flag configures the PHY as expected (its driver
>> writes the MAC address and the interrupt configuration into the PHY
>> registers) and an interrupt is generated with every magic packet,
>> but only during normal operation i.e. there is no interrupt generation
>> in suspend-to-RAM.
>
> Do you have a logic analyser connected? Can you see if the PHY is
> toggling its output pin? We then know if its a PHY problem, or a SoC
> problem.
>
what I meant by no interrupt generation was not even physical interrupt
generation i.e. the signal does not toggle in suspend-to-RAM, but it
does during normal operation.
>> A (probably naive) wakeup-source property in the dt node does not help.
>> So now I am trying to find out why the PHY does not react in suspend and
>> why its interrupt is ignored in freeze mode, but I might be overlooking
>> some other important point to consider.
>
> What is the clock setup? Sometimes the MAC gives a clock to the
> PHY. Sometimes the PHY gives a lock to the MAC. If its MAC->PHY, and
> this clock is getting turned off, that might cause a problem.
>
> Andrew
Thank you for your feedback, I will analyze the clocks carefully.

Primarily I would like to know if my approach makes sense in the first
place even if there is no clock dependency. Two dwmacs (realtek and
intel) make use of the USE_PHY_WOL flag, but I could not find any dts
where the mac-wol property is used to check if the MAC power source is
off in suspend.

Best regards,
Javier Carrasco