From: Paolo Abeni <pabeni@redhat.com>
To: Raju Rangoju <Raju.Rangoju@amd.com>, netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kuba@kernel.org,
edumazet@google.com, davem@davemloft.net, andrew+netdev@lunn.ch,
horms@kernel.org, Shyam-sundar.S-k@amd.com
Subject: Re: [PATCH v2 net 1/3] amd-xgbe: fix link status handling in xgbe_rx_adaptation
Date: Thu, 5 Mar 2026 08:59:33 +0100 [thread overview]
Message-ID: <9e430669-7930-4902-ab7f-ed0b63def827@redhat.com> (raw)
In-Reply-To: <20260305042952.835926-2-Raju.Rangoju@amd.com>
On 3/5/26 5:29 AM, Raju Rangoju wrote:
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
> index 1dbfa9d4360d..457d6049291f 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
> @@ -1964,11 +1964,20 @@ static void xgbe_rx_adaptation(struct xgbe_prv_data *pdata)
>
> /* Step 4: Check for Block lock */
>
> - /* Link status is latched low, so read once to clear
> - * and then read again to get current state
> - */
> - reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
> reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
> + if (reg < 0)
Coccinelle says:
/srv/nipa-builds-contest/testing/wt-cocci/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c:1968:5-8:
WARNING: Unsigned expression compared with zero: reg <
> + goto set_mode;
> +
> + /* Link status is latched low so that momentary link drops
> + * can be detected. If link was already down read again
> + * to get the latest state.
> + */
> + if (!pdata->phy.link && !(reg & MDIO_STAT1_LSTATUS)) {
> + reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
> + if (reg < 0)
Same here.
/P
next prev parent reply other threads:[~2026-03-05 7:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 4:29 [PATCH v2 net 0/3] amd-xgbe: RX adaptation and PHY handling fixes Raju Rangoju
2026-03-05 4:29 ` [PATCH v2 net 1/3] amd-xgbe: fix link status handling in xgbe_rx_adaptation Raju Rangoju
2026-03-05 7:59 ` Paolo Abeni [this message]
2026-03-05 4:29 ` [PATCH v2 net 2/3] amd-xgbe: prevent CRC errors during RX adaptation with AN disabled Raju Rangoju
2026-03-05 4:29 ` [PATCH v2 net 3/3] amd-xgbe: reset PHY settings before starting PHY Raju Rangoju
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=9e430669-7930-4902-ab7f-ed0b63def827@redhat.com \
--to=pabeni@redhat.com \
--cc=Raju.Rangoju@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.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