From: Andrew Jeffery <andrew@codeconstruct.com.au>
To: Jacky Chou <jacky_chou@aspeedtech.com>,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org, joel@jms.id.au,
hkallweit1@gmail.com, linux@armlinux.org.uk,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [net-next 3/3] net: mdio: aspeed: Add dummy read for fire control
Date: Tue, 19 Nov 2024 09:35:39 +1030 [thread overview]
Message-ID: <0d53f5fbb6b3f1eb01e601255f7e5ee3d1c45f93.camel@codeconstruct.com.au> (raw)
In-Reply-To: <20241118104735.3741749-4-jacky_chou@aspeedtech.com>
Hi Jacky,
On Mon, 2024-11-18 at 18:47 +0800, Jacky Chou wrote:
> Add a dummy read to ensure triggering mdio controller before starting
> polling the status of mdio controller.
>
> Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
> ---
> drivers/net/mdio/mdio-aspeed.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/mdio/mdio-aspeed.c b/drivers/net/mdio/mdio-
> aspeed.c
> index 4d5a115baf85..feae30bc3e78 100644
> --- a/drivers/net/mdio/mdio-aspeed.c
> +++ b/drivers/net/mdio/mdio-aspeed.c
> @@ -62,6 +62,8 @@ static int aspeed_mdio_op(struct mii_bus *bus, u8
> st, u8 op, u8 phyad, u8 regad,
> | FIELD_PREP(ASPEED_MDIO_DATA_MIIRDATA, data);
>
> 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.
>
> return readl_poll_timeout(ctx->base + ASPEED_MDIO_CTRL, ctrl,
> !(ctrl & ASPEED_MDIO_CTRL_FIRE),
Cheers,
Andrew
next parent reply other threads:[~2024-11-18 23:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20241118104735.3741749-1-jacky_chou@aspeedtech.com>
[not found] ` <20241118104735.3741749-4-jacky_chou@aspeedtech.com>
2024-11-18 23:05 ` Andrew Jeffery [this message]
2024-11-19 1:52 ` [net-next 3/3] net: mdio: aspeed: Add dummy read for fire control Andrew Lunn
2024-11-19 1:50 ` [net-next 0/3] Add Aspeed G7 MDIO support Andrew Lunn
[not found] ` <SEYPR06MB513475D2B233EA9BDF52AD259D202@SEYPR06MB5134.apcprd06.prod.outlook.com>
2024-11-19 13:25 ` 回覆: " Andrew Lunn
2025-10-27 2:44 ` Jacky Chou
2025-10-27 12:34 ` Andrew Lunn
[not found] ` <20241118104735.3741749-2-jacky_chou@aspeedtech.com>
2024-11-19 18:18 ` [net-next 1/3] dt-bindings: net: add support for AST2700 Rob Herring
[not found] ` <20241118104735.3741749-3-jacky_chou@aspeedtech.com>
2024-11-19 18:20 ` [net-next 2/3] net: mdio: aspeed: Add " Rob Herring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0d53f5fbb6b3f1eb01e601255f7e5ee3d1c45f93.camel@codeconstruct.com.au \
--to=andrew@codeconstruct.com.au \
--cc=andrew+netdev@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=jacky_chou@aspeedtech.com \
--cc=joel@jms.id.au \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).