[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yqj3qpq5Ew+JT+28@lunn.ch>
Date: Tue, 14 Jun 2022 23:03:38 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Raju Lakkaraju <Raju.Lakkaraju@...rochip.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
linux-kernel@...r.kernel.org, bryan.whitehead@...rochip.com,
lxu@...linear.com, richardcochran@...il.com,
UNGLinuxDriver@...rochip.com, Ian.Saturley@...rochip.com
Subject: Re: [PATCH net-next 3/5] net: lan743x: Add support to SGMII block
access functions
On Tue, Jun 14, 2022 at 04:04:22PM +0530, Raju Lakkaraju wrote:
> Add SGMII access read and write functions
>
> Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@...rochip.com>
> ---
> drivers/net/ethernet/microchip/lan743x_main.c | 69 +++++++++++++++++++
> drivers/net/ethernet/microchip/lan743x_main.h | 12 ++++
> 2 files changed, 81 insertions(+)
>
> diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
> index 6352cba19691..e496769efb54 100644
> --- a/drivers/net/ethernet/microchip/lan743x_main.c
> +++ b/drivers/net/ethernet/microchip/lan743x_main.c
> @@ -909,6 +909,74 @@ static int lan743x_mdiobus_c45_write(struct mii_bus *bus,
> return ret;
> }
>
> +static int lan743x_sgmii_wait_till_not_busy(struct lan743x_adapter *adapter)
> +{
> + u32 data;
> + int ret;
> +
> + ret = readx_poll_timeout(LAN743X_CSR_READ_OP, SGMII_ACC, data,
> + !(data & SGMII_ACC_SGMII_BZY_), 100, 1000000);
> + if (unlikely(ret < 0))
unlikely() seems pointless here. You have just done a blocking poll,
so you don't care about high performance, this is not the fast path.
Andrew
Powered by blists - more mailing lists