πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17192

Re: [PATCH net v2 04/12] net: au1000: report MDIO transaction timeouts

#17192
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 13:50
72 lines
10454 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The patch adds a second timeout exit to au1000_mdio_write()
  (drivers/net/ethernet/amd/au1000_eth.c), and both exits log the same…

--

net: au1000: report MDIO transaction timeouts

This commit makes au1000_mdio_write() return -ETIMEDOUT instead of
reporting success when the MII controller stays busy. It also adds a
readl_poll_timeout() check after the write so that a failed final
transaction is reported to phylib. The read path now returns -ETIMEDOUT
instead of -1.

> diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c
> index 7063f9e5bc7c0..6b2e216a83618 100644
> --- a/drivers/net/ethernet/amd/au1000_eth.c
> +++ b/drivers/net/ethernet/amd/au1000_eth.c

[ ... ]

> @@ -292,26 +293,27 @@ static int au1000_mdio_read(struct net_device *dev, int phy_addr, int reg)

[ ... ]

>  	while (readl(mii_control_reg) & MAC_MII_BUSY) {
>  		mdelay(1);
>  		if (--timedout == 0) {
>  			netdev_err(dev, "mdio_write busy timeout!!\n");
> -			return;
> +			return -ETIMEDOUT;
>  		}
>  	}
>  
> @@ -320,6 +322,13 @@ static void au1000_mdio_write(struct net_device *dev, int phy_addr,
>  
>  	writel(value, mii_data_reg);
>  	writel(mii_control, mii_control_reg);
> +
> +	ret = readl_poll_timeout(mii_control_reg, mii_control,
> +				 !(mii_control & MAC_MII_BUSY), 20, 20000);
> +	if (ret)
> +		netdev_err(dev, "mdio_write busy timeout!!\n");

[Severity: Low]
This isn't a bug, but could this message use different wording from the
one in the busy wait loop above?

Both timeout paths in au1000_mdio_write() now print "mdio_write busy
timeout!!". The first one fires before anything is written to the
registers. The new one fires after writel() has already started the
transaction, so the PHY register may or may not have been changed. From
dmesg there is no way to tell which of the two happened.

au1000_mdio_read() already uses two separate messages ("read_MII busy
timeout!!" and "mdio_read busy timeout!!"). Something like "mdio_write
completion timeout" here would separate the two write cases the same way.

> +
> +	return ret;
>  }

[ ... ]

-- 
Sashiko AI review Β· https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112045301.3669532-1-f.fainelli%40gmail.com
Technical Details
Message-ID: <179483704272.3136.4869685253432664524@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364355-linux-kernel-netdev=dewy.ru
References: <20261112045301.3669532-5-f.fainelli@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364355-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2 04/12] net: au1000: report MDIO transaction timeouts
Date: Mon, 16 Nov 2026 13:50:42 +0000
Organization: Usenet Network
Message-ID: <179483704272.3136.4869685253432664524@kernel.org>
References: <20261112045301.3669532-5-f.fainelli@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2076832"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:dAZ0K5CoaDoNgJ8C2glFbRY9CSs= sha256:kYmqHvpeIL5O+/S9hPNymYFLjcEK7vsEPmjs8Pi0EDY=
	sha1:cecbcn2DWIt28tltfjhArKZiiPE= sha256:O4zVfUTgAv66s8/a9lLWFPUfhcowYTrd+Booh2DkpEE=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id D4331114C3C; Mon, 16 Nov 2026 16:52:33 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id hl7y-7Parkd8;
	Mon, 16 Nov 2026 16:52:29 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364355-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 9AA48114C35; Mon, 16 Nov 2026 16:52:21 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id DA2972A9EB; Mon, 16 Nov 2026 13:51:20 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794837050;
	b=jHsb0cbcNxWYotxswvIhQA6+OJkcEv4U0o9nb2LzwBXMZdybkgom+KHWBgjeTSBK+Vk9
	 +cd/fv2BX4B5h/3UqiwFjYW7EjBk3eZg3LcjGXmkpMCiL95IrH2Mk9/IGzDvYZWsOgW+5
	 /8Qomq836AKFZKKRWFy29TLuX3ZaiGQzCdZPvT6u7Pfe6hLlhCVYIslitI63M2T5XoYB9
	 pWvQPsIQbEw74Xv8Wd2YUnYcui4Hszvm6qHTg4BglXGCXJB3jWV4XdufZ8PuHBuTN2hSe
	 J1FgCSNl4h8fmqEG88yZYxdiAc+kWEdRsJ7+40PYhVPWeUmJiPsqlHui9OBFE96HX4w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794837050;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=uRFviz/P/Rq31yiMk9CbEywo6qCv0MBbNeVhyjXUEeM=;
	b=Z+dmH25aN7wNCCQ6hRNm0n0SOkgaaGyJw+rlr7ja6uiwkiC4HZ93wx2gTigHLDc9MKj3
	 hvvmHDOdx1EKfCe5zcrS2JvDfLwwmnrerP078yWPfgr1y8AXyGsg9HI4IiysF8C0IwvBu
	 LGmGNKfEZhCIUPXKqr2qaXLNaweB3FOZbFpBjmyKpj2ms9ewYE/lhG9kJgqZtVNL1CQbP
	 UTPv3L6BGo3Km7sjRYK1guZyccd0gcjsk9u+/Awe2iOpEEFIp6vwAddYDXq2maYFQhiF7
	 Wx3eubxaEykL2b1hX2UMIRhsG59BBRj71sqKl+va3iHVnVJcHT+R5GVGaIN9WS3fuAw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XklXBhHB;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 7EDF960A6F5B;
	Mon, 16 Nov 2026 13:50:50 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XklXBhHB
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794837044;
	b=b2ZxqJBHihb+RYDrjak73sEHE9uJPwqWhXSHVozp/AxdJ81si818KT/wkXj/w8nZZaFk
	 dxCWOqPLegYPcy1q+aifJddCPrRiA7Ssc0yt7VXh0GcJ3MwAjpENG5P9uSSeK7lx9GT0G
	 ALOWb/aEokvez4A0BRLU9dSX9GHOuFFvNBobN6I5kmco1oE1e37MEWdQfnu7tHH6OdKrf
	 wMDP9xbz6Qu/SJxPTOAbOtwaNdixUiDA+peRUlf+/Mj2AC8c/nZL1P/41Bp0MDLMz2maZ
	 uXCq4IFckHcnarGhZh4FMjyl2hvRF6FVedvxi4zv41JUY3Y4sX9ISq0V4GCydeEA4GA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794837044;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=uRFviz/P/Rq31yiMk9CbEywo6qCv0MBbNeVhyjXUEeM=;
	b=tCzMNwwpbB2F88yDSdhFPKV9ldJXHUfd7kRHpknwbukGZHMsvxrOQKdRhecmO0b5m37c
	 y+O8FmMMsl7VFC3qK7o37p+jWJ8JQXOwy+fYcdUL6/pa4sEP1NZtT1dp1X1ABmoGOlLeT
	 ++vQ5YaEqyyiSwXbP61HiMg9OQVTlG3GPrXeU+t3fw0jKCY4JjgTJcUBNKFmirWCHKiM+
	 JqXlnenjf/PET6lY0S58623fAelfoBNqRZbZVO40HKG24ezgRfdPh46WE2PJK5o6PHkB1
	 u4Gy/i0Ap9x9ujT0BPlHjtDTW4UVe4vEWALnBzZcBSRmL5Q2v1jA4otgnjriplOfejw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XklXBhHB;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 982A8606A89E;
	Mon, 16 Nov 2026 13:50:44 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FD401F000C4;
	Mon, 16 Nov 2026 13:50:43 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794837044;
	bh=uRFviz/P/Rq31yiMk9CbEywo6qCv0MBbNeVhyjXUEeM=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=XklXBhHB2Zhcr/rhwELX6ANHrSIQiAUjM3hsXTcuXS78BX0GsX5Nc3GQKg6ouJg4h
	 5Xe5AxYy7B2iZ8XEnDVM5FLtF5QAl1vuZVR5Z6Z7Ut7EQ+bkobwhkTEsIl1eWGTLfO
	 /0sKmKTGNG1f782mkYs6oSFr6KvdLDTxUx0Mf4oFkztwrOAcMdtF60wlYR4WfevxZN
	 nT4AhuK0Ftq7sRMIRSDnDoLECtUMgEauq9M/K6vysmZ6tI7Z1CEY6MTNExoMrEaave
	 EWiGE1smQF5x+Z94JNw7Zytvqg+UY7Nm5j6qudNb382jwJEvMFr9SKSjKTzm6d4uNi
	 q/aDBFxugDwow==
X-Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net,
 edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, hkallweit1@gmail.com,
 linux@armlinux.org.uk, shaojijie@huawei.com, horms@kernel.org,
 runyu.xiao@seu.edu.cn, mmyangfl@gmail.com, hvr@gnu.org, jeff@garzik.org,
 danny.kukawka@bisect.de, mugunthanvnm@ti.com, sebastian.hesselbarth@gmail.com,
 linux-kernel@vger.kernel.org, manuel.lauss@gmail.com
X-In-Reply-To: <20261112045301.3669532-5-f.fainelli@gmail.com>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list