Re: [PATCH net-next v2] net: phy: mdio_device: Reset device only when necessary

From: Andrew Lunn
Date: Thu Nov 30 2023 - 09:11:22 EST


On Mon, Nov 27, 2023 at 03:41:10PM -0600, Andrew Halaney wrote:
> Currently the phy reset sequence is as shown below for a
> devicetree described mdio phy on boot:
>
> 1. Assert the phy_device's reset as part of registering
> 2. Deassert the phy_device's reset as part of registering
> 3. Deassert the phy_device's reset as part of phy_probe
> 4. Deassert the phy_device's reset as part of phy_hw_init
>
> The extra two deasserts include waiting the deassert delay afterwards,
> which is adding unnecessary delay.
>
> This applies to both possible types of resets (reset controller
> reference and a reset gpio) that can be used.
>
> Here's some snipped tracing output using the following command line
> params "trace_event=gpio:* trace_options=stacktrace" illustrating
> the reset handling and where its coming from:

...

> Reported-by: Sagar Cheluvegowda <quic_scheluve@xxxxxxxxxxx>
> Signed-off-by: Andrew Halaney <ahalaney@xxxxxxxxxx>

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew