🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #22062

Re: [PATCH net-next v5 3/4] net: mdio: mdio-bcm-unimac: Poll for completion at 1us granularity

#22062
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 20:04
72 lines
10764 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] Concern: the commit message and the new comment in
  unimac_mdio_poll() (drivers/net/mdio/mdio-bcm-unimac.c) describe…

--

net: mdio: mdio-bcm-unimac: Poll for completion at 1us granularity

This commit drops the fixed 30us udelay() and the 2ms sleeping poll in
unimac_mdio_poll(). It now busy-polls MDIO_START_BUSY every microsecond
with read_poll_timeout_atomic(), and the timeout goes from 100ms down
to 1ms. The goal is to cut per-access latency before Clause 45 support
is added.

> diff --git a/drivers/net/mdio/mdio-bcm-unimac.c b/drivers/net/mdio/mdio-bcm-unimac.c
> index 5f79f31220f26..f8e5c1811d96b 100644
> --- a/drivers/net/mdio/mdio-bcm-unimac.c
> +++ b/drivers/net/mdio/mdio-bcm-unimac.c

[ ... ]

> @@ -79,14 +86,15 @@ static int unimac_mdio_poll(void *wait_func_data)
>  	struct unimac_mdio_priv *priv = wait_func_data;
>  	u32 val;
>  
> -	/*
> -	 * C22 transactions should take ~25 usec, will need to adjust
> -	 * if C45 support is added.
> +	/* A frame should take ~25 usec. A C22 transaction is a single frame,
> +	 * a C45 transaction is an address frame followed by a data frame and
> +	 * each of them is waited for separately.
>  	 */

[Severity: Low]
This isn't a bug, but the new comment in unimac_mdio_poll() describes C45
address and data frames that are waited for separately. At this commit
there is no C45 path yet. unimac_mdio_probe() only sets bus->read and
bus->write, and only MDIO_RD_C22/MDIO_WR_C22 are defined.

The next patch in the series, "net: mdio: mdio-bcm-unimac: Add Clause 45
support", adds unimac_mdio_addr_c45() and unimac_mdio_do_read()/do_write().
Each of these calls unimac_mdio_wait(), so the comment is accurate once
the series is applied. Would it be clearer to add this comment in that
patch, or to word it so it makes sense for this commit on its own?

The 100ms to 1ms timeout reduction for existing C22 users is stated in
the commit message. The numbers hold up: the largest divider allowed by
MDIO_CLK_DIV_MASK is 128, which gives about 1.95MHz from a 250MHz
reference clock and about 32.8us per 64 bit frame. That is well under
MDIO_POLL_TIMEOUT_US.

> -	udelay(30);
> -
> -	return read_poll_timeout(unimac_mdio_readl, val, !(val & MDIO_START_BUSY),
> -				 2000, 100000, false, priv, MDIO_CMD);
> +	return read_poll_timeout_atomic(unimac_mdio_readl, val,
> +					!(val & MDIO_START_BUSY),
> +					MDIO_POLL_DELAY_US,
> +					MDIO_POLL_TIMEOUT_US, false, priv,
> +					MDIO_CMD);
>  }

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120194318.3952487-1-florian.fainelli%40broadcom.com
Technical Details
Message-ID: <179555065159.3135.7257809284035507896@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370726-linux-kernel-netdev=dewy.ru
References: <20261120194318.3952487-4-florian.fainelli@broadcom.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370726-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v5 3/4] net: mdio: mdio-bcm-unimac: Poll for
 completion at 1us granularity
Date: Tue, 24 Nov 2026 20:04:11 +0000
Organization: Usenet Network
Message-ID: <179555065159.3135.7257809284035507896@kernel.org>
References: <20261120194318.3952487-4-florian.fainelli@broadcom.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="28358"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:d8ns45clZY9vHApbtAFYnRx+ob0= sha256:E777cT/JcH+yss5VXm5FcNvqlpCdrWj2oLvkRlkg3/c=
	sha1:TGWHPhAIPHBznGHBIt4tIO44jU8= sha256:q9IBT/RkTnpgMYzPdFXHhputoqcbn4F+wHyGwGBsxik=
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 1DF05125E29; Tue, 24 Nov 2026 23:04:34 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.5
X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31
	tests=[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 h8yb4mNmfQJn;
	Tue, 24 Nov 2026 23:04:30 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-370726-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 2B6F1125E2D; Tue, 24 Nov 2026 23:04:21 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id CC4F160890F; Tue, 24 Nov 2026 20:04: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=1795550659;
	b=2uZeShsmdOMvqm1mNPV9tDTrQnq9I6oaAMGlVQwB/WKUS/wGyN6yindPGSDENq6oeBdC
	 fef0DO0lMqPuI2L8pXH0tgYjGGhe4qFJyORQGRMP6z3QnqpPfoeX99qY8llIhiWkByb05
	 sFdlbV3srFFzk2NVL7hrtG/ww5aJDj+Y+SYKt1VUIofZ75Ganj5Ohmt7AxHIJYA+zKcED
	 PWIwg69GPzdHPJSEHwftchzuj+F4Movv03rINlNsqNt1sb6iOiGdjHSwhU6vZkjYtf18W
	 pcXywaoeFnuDZzuM2OqXgrLhyeNKC/ba4DHxDcrQ7UXBk033Xy0D+zb3fHKLovPBi9Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795550659;
	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=7ipmu1RjM6Rh1EJ3Z3e0jsQckbhS/99owpow7ZIHu9I=;
	b=lM/OTTloSXP3Bgo+1udfauMJWzTGFCaTc3X9WjWoSipzXyX5i63xfhMa0jqW2wD+XVxv
	 tWJCt6c5oiaioc+s9Mq4dE1QDPZ9HIuaMC8Qf0kYO8MwW2lUYkio1OdmAh6vTnvfKF9X7
	 KBPF3xuf4Qw+HPDbjIDSwKxfCihYHBrYfAin7sCP1PfiYN2bxJBStzuYkVBzFH5wE4u3c
	 kv2E4FqhjwBanYgLmtSFgDgDaUInWIjEQf9q7DWWMOVS7bB4zmXW+j1jq2cHCWTfZxvWt
	 sOWu39o6rp+aSxvQerW5OC6bA2Sh7aBnA2BbbasP934dXuj6XAUjUNpLqmEhDRGfMaA==
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=EClf+Go4;
	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 0F796606A337;
	Tue, 24 Nov 2026 20:04:19 +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=EClf+Go4
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=1795550653;
	b=nzRqLVyo4mkd6umsN3JX/1+yNTFuHR7bCShh6kHeKFi0n05RYwC7xTXp9Yd25KiK40st
	 q4c6e8nCbMlFVoakfnBMeo+CGXf9iOogS742ATaTwlb6XigsLVgcBsnxYi2jsazNhHsks
	 04Et911BckUUC37hzEARRaeZrBqo3UD9mdL8lWSFHTnTTVykItUJKU/DzGEqthsEFaCKR
	 OaxnJ7u/KKkNWnUCqNThnvEPCvM4/iArCXiyCs6lULyAIcUnGtfUXVokAhOkn2l7EkMqI
	 MS3gqdvTvu3+LHQCKWdQwHpV0QLD2EcpMZnSIUGjMlPvglCMdpErgvsDIhTK/1mlDQg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795550653;
	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=7ipmu1RjM6Rh1EJ3Z3e0jsQckbhS/99owpow7ZIHu9I=;
	b=HoWJR/Uz3rwqzdfhxOv1OLQgmbqVPj14Qi8xQcpqjstNZ80QQxgOGwC51kFpgvRipoLp
	 FmYBwarnP2J3K7P2b4GJJfmeFjKFzbLwcsKLouSazmjNwmPfqz/RyVGI0M4fNO10jf+/9
	 vWfbSJ/p/RtvLYi0MWj/WofzrlOZ4CiVYSL6xLQemUAD32bxad9qjHvMVjPcv8hBM1hLY
	 MggniMwLps9wex5mLoFheFs4ySD28LaAsHfmDNgfP0kZATGJ67zrqzS15PYphdKgfRNZ3
	 ii9UCLDzVlR8iDJHIKZNl8kB0kAfZRxx+QVU0amvRtA6RrSHA/7I8v727loHJnXj65g==
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=EClf+Go4;
	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 2E69A606A336;
	Tue, 24 Nov 2026 20:04:12 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09D361F000D4;
	Tue, 24 Nov 2026 20:04:11 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795550652;
	bh=7ipmu1RjM6Rh1EJ3Z3e0jsQckbhS/99owpow7ZIHu9I=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=EClf+Go4PVg7a8mggnTHsDhnMlCNx1v/2yrevK6okbCl9HDr6P09yg7a7ShNqYVIK
	 oo3sGprNkQANpmIcmONSiZUTDQmWmhQdCdMkJtyZEj6QvdmCxl1PXgtZ52FHb5W7AX
	 iOvissy8R4TuqZdAntpszbkhEEcNJFvrSpfLzZ/eewuxmie53/sxnh/8RcTh/svyF7
	 FQHQzCzDjuWYRPZ9wDQv5IPShaxk4BvMf5q1vSx+M+/KOTPnRQsfSuphZ9lGxI3i60
	 gOWHrSYrcMr3z26K9JdRy5qgyFObpophQlvhrsKvIFHkFwnDILlIdOYYWoglgY5ZVl
	 QktbBcP5Q5UwQ==
X-Cc: netdev@vger.kernel.org, andrew@lunn.ch, nb@tipi-net.de,
 carlos.soto@broadcom.com, opendmb@gmail.com,
 bcm-kernel-feedback-list@broadcom.com, hkallweit1@gmail.com,
 linux@armlinux.org.uk, davem@davemloft.net, edumazet@kernel.org,
 kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org,
 kudzo51@gmail.com
X-In-Reply-To: <20261120194318.3952487-4-florian.fainelli@broadcom.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