Article View: linux.kernel.netdev
Article #16737Re: [PATCH net-next 3/3] net: mdio: mdio-bcm-unimac: Add Clause 45 support
From: Nicolai Buchwitz
Date: Sun, 15 Nov 2026 18:59
Date: Sun, 15 Nov 2026 18:59
58 lines
10780 bytes
10780 bytes
Hi Florian On 13.11.2026 22:15, 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. > > 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. > > 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> > --- > drivers/net/mdio/mdio-bcm-unimac.c | 105 +++++++++++++++++++++++++++-- > 1 file changed, 98 insertions(+), 7 deletions(-) > > diff --git a/drivers/net/mdio/mdio-bcm-unimac.c > b/drivers/net/mdio/mdio-bcm-unimac.c > [...] > @@ -301,6 +390,8 @@ static int unimac_mdio_probe(struct platform_device > *pdev) > bus->parent = &pdev->dev; > bus->read = unimac_mdio_read; > bus->write = unimac_mdio_write; > + bus->read_c45 = unimac_mdio_read_c45; > + bus->write_c45 = unimac_mdio_write_c45; AFAIU this breaks GENET without DT (e.g. Pi 4 with ACPI). Arguably an edge case, but last time I tried it worked at least. With your changes all addresses get a C45 scan there for which the empty ones return -EIO. get_phy_c45_ids() passes that up instead of mapping it to -ENODEV like the C22 path. A cheap fix would be to do the same mapping in get_phy_c45_ids() as we have for C22. Thanks, Nicolai
Technical Details
Message-ID:
<7cb0d621e794378956b737530ebade24@tipi-net.de>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363807-linux-kernel-netdev=dewy.ruReferences:
<20261113211554.2058181-1-florian.fainelli@broadcom.com> <20261113211554.2058181-4-florian.fainelli@broadcom.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-363807-linux-kernel-netdev=dewy.ru From: nb@tipi-net.de (Nicolai Buchwitz) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 3/3] net: mdio: mdio-bcm-unimac: Add Clause 45 support Date: Sun, 15 Nov 2026 19:59:15 +0100 Organization: Usenet Network Message-ID: <7cb0d621e794378956b737530ebade24@tipi-net.de> References: <20261113211554.2058181-1-florian.fainelli@broadcom.com> <20261113211554.2058181-4-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="1878237"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Ya6xVccH4Jum+OkcyJ9rl+67XC0= sha256:9cl5EsWqAmc4Iju3N7Q3WabxOHt0/OMzfPqHDWmXaUM= sha1:xTr7QVIXbWHMbtvudz7FZHtQvrw= sha256:06uxsKbaDXoAIgKs0q8Htxy09OiG9VB9Q8M0DFqyXCs= 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 576D9114A3B; Sun, 15 Nov 2026 21:59:35 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 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] 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 S4rJQkjLMMyo; Sun, 15 Nov 2026 21:59:31 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-363807-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id CFF5F114A2E; Sun, 15 Nov 2026 21:59:22 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 855E22D91D; Sun, 15 Nov 2026 18:59:21 +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=1794769160; b=snQxUOnPiDks+C5C6obDPBKbUFzLoZMCPSpAbsVg9TOQrQgsku5+8GmysBQYCUlCYQlu G9k51XwvQn/D09oK1cGsaWhZt/Ba+/fN0bokU28zdmL4k+lc9RwyI4i1gInaZG3I11jCu y+EkArM+pE2Mn53BkOx6EkjAWjbJ5TyC55cJq5xexDh2EPjGS39nd4a29d+kzDUDviVkj GT+kdv+pTsLRHLjxTGbVQNkjcsXzqQTU5yRSAumbnhUbs7qsuwignDZTCDzyHyisPJ0mR E7EZCOLu6chGfk++6lMtBH57qSHX012JiW8jG/uKYMVboHyn7JKQ6SbBHVPQQHX7juw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794769160; 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=ykE7D6WtiThp3GLJUoPg9fvayjrS+VOMD2ZgX4Sxk/0=; b=pKSDZStNJwD9j6h5OVYwrKAD2sypPm92G5rHmiJEfdIyd8Gi5Mzy/3Uyptv7+6M9uKjx sHWGL00KXfBw3aCkHsHi6eVfP2RyeWCI51lMgVkWl8CULtHdUv+NMqVcBSRlUmduuVJAv 97/IIeK1/r/xmVzJmSuh2hiU+j0C7/SJTmlQAQ+lEi0b5gmzQy7QUFd5sxVLReqjtMzv5 tGn67DGFvA/oDgapxswrKpvkHt5wyDgI+WxkqXcFAV16UY300EJ3m+cWZSjDxH+jeCs5j F5cVqBYPhhkEM0VI9YpgbC9bBwjvWq15EA2p+cYUD8XkqfljTRit7lHICVdXi6XQ6IQ== 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=Egc+JtXD; 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 61392606A333; Sun, 15 Nov 2026 18:59:20 +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=Egc+JtXD 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=1794769159; b=TIDKjJcStuhDriL0nyFCpUbZmyiWrvCWWS19XSknlIO31XOFdV8l6Zdjo2admLjKlZ7N x+zsWzUQJTsi4nNMgsWxVERn5BDWz1raR3GMFwvNGf89yhdh7/qrrkuhCvQ34sMtAS32h Awe4focGCD1AZcJixGh9EfOkR8zQaWe6LqYt18yDCtuKK942ndcOe5SZzffpe9mQoJ1/I scXkDCCdp+0D2q2GGgP+rPzDlzB+2YlnWxUNfDdjMHEk8+fuqo2skEwKW4y2iSHkZmvqg HrOJd8v0j/zain1/NkxhdxXLJW9oi36n2mhRU5+nOb0dLq/AT8Tlrz+jhoZKmlIus5g== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794769159; 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=ykE7D6WtiThp3GLJUoPg9fvayjrS+VOMD2ZgX4Sxk/0=; b=udj4n1pP5p91Igdri6FwTvNYAHohMQid7YuYSdDBhaVRmxmpvj/TYnYEY6w78ORhF827 tWjWCXuQ3RgUEGw+khjSsjlXLZaXAAmpv7Rvi6FRnyeyFuVkBxXZIu0v+0+tUL5k1HwsL 9EgOzc2Z4CkkDM6Pmp3Hvvstd03xc/KFeaibRaFOZBNbWoU/ONrXAnO11qbisrAqHjXB2 rSffH+Sfy5TFeuqcgCXGOVm5fS+8+901qAewmReqQloemYzxiy9QXg6wtIptVMjBfW1fe aJ7InMW9z+F7Aoj2EQCkuTbDOLyd0NMCGd9j7nwmaBbM0mVb15OAVBd1uolY/Fdz1Kg== 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=Egc+JtXD; 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 0E900606A31D; Sun, 15 Nov 2026 18:59:18 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0E900606A31D 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 7B225A1654; Sun, 15 Nov 2026 19:59:15 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim; t=1794769156; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=ykE7D6WtiThp3GLJUoPg9fvayjrS+VOMD2ZgX4Sxk/0=; b=Egc+JtXDoxiPXp69r0Sla0rHxBu/kRo4aDwcU0qOX5Tn1Rqm2rJ4eMGgeuMcpDKX3Kv0tO uIxnYX6YM1JNhSF2UvGQ7ROI5xsprwDQXoV2YSKahp7BpJVbJdKduGEWXWlN9qZOSKIe9v 3iLh/XLBkw5Rwf4UktCDxswWS36JvOu44KMM22tjjSuKR0+Su2FsH0l+RFXPMnn1cDLFvI 06yWqKJplxR4aV1emSXym1hhi05tM6kkjl7/DZhaIRStWv4Lgvu1iCx2vPu2PNotSFUyGI ko2qdDEptRMYSaorbmRNnDbhcM1NatDB8MMXQDOF+In6dH3yUEy2o3Djn+zT1Q== 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: <20261113211554.2058181-4-florian.fainelli@broadcom.com> X-Sender: nb@tipi-net.de X-Last-TLS-Session-Version: TLSv1.3