🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #19952

Re: [PATCH net-next v5 4/4] net: mdio: mdio-bcm-unimac: Add Clause 45 support

#19952
From: Nicolai Buchwitz
Date: Fri, 20 Nov 2026 20:29
63 lines
11208 bytes
On 20.11.2026 20:43, Florian Fainelli wrote:
> Add Clause 45 read/write support to the UniMAC MDIO bus controller 
> driver
> by implementing the read_c45/write_c45 bus callbacks. Each access 
> performs
> the two-step C45 sequence (ADDR cycle followed by a READ/WRITE cycle) 
> under
> the bus lock and switches MDIO_CFG between C22 and C45 mode as needed;
> MDIO_CFG is only written when the mode actually changes.
> 
> Since MDIO_CFG also holds the clock divider, unimac_mdio_resume() now 
> takes
> the bus lock around unimac_mdio_clk_set() so that it cannot race with 
> the
> read-modify-write done by the accessors. Resume may therefore wait for 
> an
> MDIO access that is in flight.
> 
> Some wait_func implementations (e.g.: bcmgenet_mii_wait()) return 0 
> even
> when the controller is still busy. For C45 this would let the data 
> cycle
> or the next access's MDIO_CFG switch start while a frame is in flight, 
> and
> return the command bits instead of the read data. Check that the 
> controller
> is idle after every cycle, C22 ones included, and report a timeout 
> instead.
> 
> Also skip the BMSR workaround read in unimac_mdio_reset() for children
> compatible with "ethernet-phy-ieee802.3-c45", since such PHYs are not
> expected to respond to C22 accesses.
> 
> Note that providing read_c45/write_c45 also makes the MDIO core scan 
> for
> C45 PHYs at registration time, on addresses that are not masked and do 
> not
> already have a C22 device. This is not the case when the bus is 
> registered
> from a Device Tree node, which masks all addresses.
> 
> The platform device that GENET instantiates when it is probed without a
> Device Tree node (e.g.: ACPI) does not mask any address, so it is 
> scanned
> too. Its wait_func is bcmgenet_mii_wait(), which sleeps for up to a 
> timeout
> per frame since GENET's interrupt is not registered yet when the bus is
> registered. That makes the scan slower at probe time on such systems, 
> the
> same way the C22 scan already is.
> 
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
> Co-developed-by: Carlos Soto <carlos.soto@broadcom.com>
> Signed-off-by: Carlos Soto <carlos.soto@broadcom.com>
> Co-developed-by: Justin Chen <justin.chen@broadcom.com>
> Signed-off-by: Justin Chen <justin.chen@broadcom.com>

Forgot to mention: Your tag needs to go last (v3 had it right).
You can keep my R-b as the changes are OK.

Thanks,
Nicolai
Technical Details
Message-ID: <905c34c37a843cfc95f95e10b32f513e@tipi-net.de>
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368135-linux-kernel-netdev=dewy.ru
References: <20261120194318.3952487-1-florian.fainelli@broadcom.com> <20261120194318.3952487-5-florian.fainelli@broadcom.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368135-linux-kernel-netdev=dewy.ru
From: nb@tipi-net.de (Nicolai Buchwitz)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v5 4/4] net: mdio: mdio-bcm-unimac: Add Clause 45
 support
Date: Fri, 20 Nov 2026 21:29:40 +0100
Organization: Usenet Network
Message-ID: <905c34c37a843cfc95f95e10b32f513e@tipi-net.de>
References: <20261120194318.3952487-1-florian.fainelli@broadcom.com>
 <20261120194318.3952487-5-florian.fainelli@broadcom.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="3256314"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:nV9kxJz6ZxNXTQU76hCtAlA0uvg= sha256:mejnLDn2UriTRAGU1oDQOIxGxtLPxp/4Og60aDbnhzU=
	sha1:ilCncfkUQskP9TvdfHyqMLUahl8= sha256:5GbsGAQGvLRwe047kVwTFfN5lpABl1UZM8vzjVJUDrE=
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 1D034115A72; Fri, 20 Nov 2026 23:30:13 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	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=tipi-net.de
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 uBlFnMT9GBWO;
	Fri, 20 Nov 2026 23:30:10 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-368135-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 902C1115A66; Fri, 20 Nov 2026 23:30:00 +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 CA54B160F3D; Fri, 20 Nov 2026 20:29:58 +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=1795206598;
	b=l0RRurYHt524+5+bWXsEPFRRteyEG2Ks7I05SJSCJp9oeACHOnJod4OSDuKfs//fCRDx
	 +fPEKgtQ45nb41hZfZQ1JzSPTCexxro4g2LTsPpTwdBds8w+/NYOpEQ4rT+aKLl6oMCT+
	 21GGg5Dns9UjSidzvvHF9egj5VrA88yFvq9JYhuPRnnzBVuvnNmaVqn9fbWAGtUP0zT4g
	 UXWFzF8uZUh+Ta+c50TFr+7ziBqUf0aclqm6xiymI8zNCZijOLBQKa8T/GtkVogGBAVgy
	 AbetFTlknNQXY8uTLkUqx02/NPMKn0uKVSGkJYMGcFv/jNKghDySeJOfMZTEKIqO1hA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795206598;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Date:From:To:Cc:
	 Subject:In-Reply-To:References:Message-ID:X-Sender:Content-Type:
	 Content-Transfer-Encoding:X-Last-TLS-Session-Version;
	bh=h3ow/BbNuDYJS6H6glK8M79YXas//OK5TqTnYZxokFg=;
	b=0uSWt2e26AoC1McHBqLNNqDP88v/DgRXhhrC6jHaUUVe787NudonjezzwWqIw0ky9T9y
	 l8n70u5CdJEy03Wk6hM3ryRld4qKJQNeaxo0MZ0PrqQMm4i8nmmN5wVNszV51VL6/VFuV
	 sYh9XLVgFtKUXoE/7529azWQu8bsn7H4pvMnfQByERwgmWvMhKA1C0GO90O3QhEBknKVq
	 4UiEtRMeuKrCZu0qiOli3OHaJknSYRrMq8Lc5dXhkkh+/YuTKsnRld8PpbyolRzPtZbKU
	 01i/PkegUKjrpkBAHDN4DOesRIHa9ue5HNzPUHHl2GKsdLjFC6mUUWZJmoQtthKbWLQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b="o/tPdefi";
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	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 A0261606A6C1;
	Fri, 20 Nov 2026 20:29:58 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=o/tPdefi
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=194.13.80.246
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795206592;
	b=OnKOPkc4Xcdu+918XQDeNUgapmUUa7IdZCM/wFGS/ntiUK/NS5HSIn4VRl0uF+PhUqgq
	 G1lU9kcVgH+hq6GjdSRpv2doO2x+MswPh2AZ1lU8TgTMKRPmrdf6ef2YllgVgu4QnCMbe
	 v6Md2K+y6h2AV1JEbIR+DE1mBFB4F2mPnxhmJI6Xl0lyBrW1WedK7VX2EUq+cCgx4vbtH
	 Tmprfpd1HhGOoyQsbgNWRnuvzRsh/h8FILURF95BeIqskE8GM+GVh090bRnt9iz1fiKZc
	 zO598dTWlMQ9tTaBA4oiMCKnqWBIdX3G8rpCpq0uit8i51klDUK3qCnkWnW8uPItAIQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795206592;
	h=DMARC-Filter:Received:DKIM-Signature:MIME-Version:Date:From:To:Cc:
	 Subject:In-Reply-To:References:Message-ID:X-Sender:Content-Type:
	 Content-Transfer-Encoding:X-Last-TLS-Session-Version;
	bh=h3ow/BbNuDYJS6H6glK8M79YXas//OK5TqTnYZxokFg=;
	b=JdCQaGH22wwSKBATJZn8dNtbFWmifbY4dsNrIb/BDOnWXUNnSoshmIq+7xudnju38SQ4
	 RQJHz6gE3GCUb/89uRFjDj/+xYOLjePqovruLhD9Ur6ouKYoMvrcL7ypbyvyWEyHG1Wl9
	 bUX7IMmazOYpLfiltgQ1tCcjVS4w3dVkZY7113zOr/hGjhWHgtIu31vS0FS7WK9i4Tl1b
	 0rJp+v/fFVQjePBqQbwkF4vkQpiY1qO51sNMGwkQaHXDXEQH0APvYRvgYG4EoXuTqaSD8
	 dCDfPtw98h518ofD4ujQpQjuHjDdMD7BlOj1Lp52zFkmSV2pNuTkgtCsJGE5LrFfHYA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b="o/tPdefi";
	arc=none smtp.remote-ip=194.13.80.246
X-Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246])
	(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 76819606A320;
	Fri, 20 Nov 2026 20:29:44 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 76819606A320
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de
X-Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id BFEA2A05A5;
	Fri, 20 Nov 2026 21:29:40 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim;
	t=1795206581; h=from:subject:date:message-id:to:cc:mime-version:content-type:
	 content-transfer-encoding:in-reply-to:references;
	bh=h3ow/BbNuDYJS6H6glK8M79YXas//OK5TqTnYZxokFg=;
	b=o/tPdefi+2ABf9FFThFngDTSoPA+OXELbxYRO8BHg1OM3SrhVLoew99kekjJubfy5h5lnC
	21OvNfu0HXrsmAO4ITRhT1VZwP+zPFK2AyYyQdASaBtAlcbhi7tZbM/w5JAQrl/xAz0s4s
	srskIzhGgnYAGtpknfnkiNVcih1NV89tXe1vR02xQEKV0PiS15uY9yUImLeBQD1wFfli9H
	Ztsnup79WLu6rv2JFJqV3BzZoF7VHVz8xp3eYBSs6pgbqwuFltSXEPCxOv4KYxZAdueiOV
	9VLA5kck0vlrjWV0K1qssOfqavNQbqYLdQrgvg4sxi0aYHF6zDOygy4TUp6m9Q==
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
X-Cc: netdev@vger.kernel.org, Carlos Soto <carlos.soto@broadcom.com>, Justin
 Chen <justin.chen@broadcom.com>, Doug Berger <opendmb@gmail.com>, Broadcom
 internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, Andrew
 Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>, Russell King
 <linux@armlinux.org.uk>, "David S. Miller" <davem@davemloft.net>, Eric
 Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni
 <pabeni@redhat.com>, linux-kernel@vger.kernel.org, Mlody12 mlody12
 <kudzo51@gmail.com>
X-In-Reply-To: <20261120194318.3952487-5-florian.fainelli@broadcom.com>
X-Sender: nb@tipi-net.de
X-Last-TLS-Session-Version: TLSv1.3