回覆: [net-next 3/3] net: mdio: aspeed: Add dummy read for fire control

From: Jacky Chou
Date: Tue Nov 19 2024 - 00:46:56 EST


Hi Andrew Jeffery,

Thank you for your reply.

> >         iowrite32(ctrl, ctx->base + ASPEED_MDIO_CTRL);
> > +       /* Add dummy read to ensure triggering mdio controller */
> > +       (void)ioread32(ctx->base + ASPEED_MDIO_CTRL);
>
> Why do this when the same register is immediately read by
> readl_poll_timeout() below?
>
> If there is a reason, I'd like some more explanation in the comment you've
> added, discussing the details of the problem it's solving when taking into
> account the readl_poll_timeout() call.
>

Agree.
When the bus is sometimes busy, it may cause the driver is unable to
write the register to the MDIO controller immediately.
Therefore, add a dummy read to ensure the previous write command
has arrived to the MDIO controller before polling MDIO controller status.
I will add more details in next version of the commit.

Thanks,
Jacky