[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZF6VLIMWG4paonAi@corigine.com>
Date: Fri, 12 May 2023 21:36:12 +0200
From: Simon Horman <simon.horman@...igine.com>
To: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
Cc: Jose Abreu <Jose.Abreu@...opsys.com>, Andrew Lunn <andrew@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH RFC net-next 9/9] net: pcs: xpcs: avoid reading STAT1
more than once
On Fri, May 12, 2023 at 06:27:45PM +0100, Russell King (Oracle) wrote:
> Avoid reading the STAT1 registers more than once while getting the PCS
> state, as this register contains latching-low bits that are lost after
> the first read.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
...
> @@ -880,13 +854,25 @@ static int xpcs_get_state_c73(struct dw_xpcs *xpcs,
> const struct xpcs_compat *compat)
> {
> bool an_enabled;
> + int pcs_stat1;
> + int an_stat1;
> int ret;
>
> + /* The link status bit is latching-low, so it is important to
> + * avoid unnecessary re-reads of this register to avoid missing
> + * a link-down event.
> + */
> + pcs_stat1 = xpcs_read(xpcs, MDIO_MMD_PCS, MDIO_STAT1);
> + if (pcs_stat1 < 0) {
> + state->link = false;
> + return stat1;
Hi Russell,
stat1 doesn't seem to exist in this scope.
> + }
Powered by blists - more mailing lists