Re: [PATCH net-next] net: phy: dp8382x: keep WOL setting across suspends
From: POPESCU Catalin
Date: Fri Mar 22 2024 - 12:34:40 EST
On 22/03/2024 16:56, Andrew Lunn wrote:
> [Some people who received this message don't often get email from andrew@xxxxxxx. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> This email is not from Hexagon’s Office 365 instance. Please be careful while clicking links, opening attachments, or replying to this email.
>
>
>>> It looks like the issue I'm trying to address in this patch is not
>>> specific to dp8382x. Right now, depending on if the PHY is reset or not
>>> during resume (either through mdio_device reset_gpio/reset_ctrl or
>>> phy_driver soft_reset callback), the WOL configuration is either the PHY
>>> reset value or the BIOS value. I could still make the patch but it
>>> doesn't really make sense to address only dp8382x.
> This is an interesting point. soft_reset the driver is in control
> off. It can preserve the WoL setting over the soft reset.
> A hardware reset is a different matter.
>
> However, if we woke up due to WoL, the PHY never went to sleep, its
> state is intact, so why are we doing a hardware reset?
I checked again the code and the datasheets and I was wrong: the driver
does a "digital" reset instead of "software hard" reset :
- "digital" reset : registers are preserved
- "software hard" reset : registers are reset
The names are misleading and explains why I made the mistake :)
So, it makes sense to provide a patch for dp8382x that ensure we don't
forcefully disable WOL on the resume path.
> Andrew
>