🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23982

Re: [PATCH net-next v7 1/4] net: phy: Map C45 probe read errors to -ENODEV during bus scan

#23982
From: Nicolai Buchwitz
Date: Sat, 28 Nov 2026 20:54
95 lines
12525 bytes
On 24.11.2026 19:58, Florian Fainelli wrote:
> get_phy_c22_id() maps a bus read error of -EIO or -ENODEV to -ENODEV, 
> so
> that mdiobus_scan_bus_c22() carries on with the next address when 
> nothing
> answers. get_phy_c45_ids() only does so for phy_c45_probe_present(); a
> failed read of the devices in package registers is turned into -EIO, 
> which
> mdiobus_scan_bus_c45() treats as fatal and which makes the whole
> __mdiobus_register() fail.
> 
> MDIO controllers that report a read from an empty address as a bus 
> error
> (e.g. MDIO_READ_FAIL on the UniMAC MDIO block) and that provide 
> read_c45()
> with unmasked addresses therefore cannot be registered: the C45 scan 
> fails
> on the first empty address. mdio-bcm-unimac does not provide read_c45()
> yet, this is enabled by "net: mdio: mdio-bcm-unimac: Add Clause 45
> support" later in this series.
> 
> Make get_phy_c45_devs_in_pkg() apply the same mapping as 
> get_phy_c22_id()
> to its first read (MDIO_DEVS2): a failure with -EIO or -ENODEV there 
> means
> that nothing answered and is reported as -ENODEV. A failure of the 
> second
> read (MDIO_DEVS1) happens once the first one succeeded, i.e. once the 
> MMD
> has answered, and is still reported as -EIO so that the PHY is not 
> silently
> skipped.
> 
> get_phy_c45_ids() then handles -ENODEV in the two places that look for 
> a
> device at an address: the loop over the MMDs and the MMD 0 fallback. In 
> the
> loop, an MMD that does not answer is handled like one that reads as all 
> Fs,
> except that the remaining MMDs are not probed: the scan goes straight 
> to
> MMD 0, and -ENODEV is only returned if that does not answer either, so 
> PHYs
> that only respond on MMD 0 are still found while an empty address costs 
> a
> bounded number of bus reads. Carrying on with the remaining MMDs is not 
> an
> option: the vendor MMD presence check done on the way fails with the 
> same
> bus error on such a controller and ends the scan before MMD 0 is 
> reached.
> 
> This patch does not change how the other errors are reported: the 
> vendor
> MMD presence check done while reading the identifiers and the reads of 
> the
> per-MMD identifiers themselves only happen once a device has answered, 
> and
> their error is returned as is. The kernel-doc therefore documents "a
> negative error code" rather than -EIO as the only alternative.
> 
> This is not limited to mdiobus_scan_bus_c45(): get_phy_c45_ids() is 
> reached
> through get_phy_device(bus, addr, true) and phy_get_c45_ids() by every 
> C45
> caller. For those, a failed devices in package read is now reported as
> -ENODEV instead of -EIO, which is what C22 callers already get:
> 
> - fwnode_mdiobus_register_phy() for "ethernet-phy-ieee802.3-c45" nodes:
>   __of_mdiobus_parse_phys() logs that the device is missing and 
> registers
>   the bus without it, instead of failing the registration.
> - sfp_sm_probe_phy(): the mdio-i2c buses report a PHY that does not
>   answer as a read of all Fs, so nothing changes for an absent PHY. The
>   only error that can reach this code is an I2C transport error (-EIO) 
> on
>   a RollBall module: it is now handled like the -ENODEV that C22 
> modules
>   already get, i.e. retried and, if it persists, reported as "no PHY
>   detected" instead of "mdiobus scan returned -EIO" and SFP_S_FAIL.
> - gpy_probe() through phy_get_c45_ids(): the driver core treats -ENODEV 
> as
>   a silent match rejection rather than a probe failure.
> 
> Fixes: 17b447539408 ("net: phy: c45 scanning: Don't consider -ENODEV 
> fatal")
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>

Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>

> [...]

Thanks,
Nicolai
Technical Details
Message-ID: <f6eaee9793482f85ee22f67ee198277d@tipi-net.de>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder2.feed.ams11.usenet.farm!feeder4.usenet.farm!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373275-linux-kernel-netdev=dewy.ru
References: <20261124185820.3954716-1-florian.fainelli@broadcom.com> <20261124185820.3954716-2-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!2.eu.feeder.erje.net!feeder.erje.net!feeder2.feed.ams11.usenet.farm!feeder4.usenet.farm!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373275-linux-kernel-netdev=dewy.ru
From: nb@tipi-net.de (Nicolai Buchwitz)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v7 1/4] net: phy: Map C45 probe read errors to -ENODEV during bus scan
Date: Sat, 28 Nov 2026 21:54:08 +0100
Organization: Usenet Network
Message-ID: <f6eaee9793482f85ee22f67ee198277d@tipi-net.de>
References: <20261124185820.3954716-1-florian.fainelli@broadcom.com> <20261124185820.3954716-2-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="1027274"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:SgmfiiCtOAaiuax1erGgDqBx7yI= sha256:hE2GQrdUSk+QtOfbR1kCBRSu/ktir5AyS9gHu53BdH0= sha1:DwrqdVgBYLaLQhPVNjEo4pC6nWw= sha256:D4/3SgtJdSMF5FOCThBftowIsmCkuMa4faP7V87+1tc=
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 9454C125F8A; Sat, 28 Nov 2026 23:54:38 +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 56LBmJHQoDsB; Sat, 28 Nov 2026 23:54:35 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-373275-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 4731D125F8B; Sat, 28 Nov 2026 23:54:24 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 1758A23EA2; Sat, 28 Nov 2026 20:54: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=1795899256; b=5WwxDWBf9sv7ZAxh1BSSboY24wNeySDCAm5tPtBLFuX4TmgRcWHhCf4jq+RT9zUjX8zV Dfw+yfN2YW8rQdlZx9goPsdDb5j3J5XqOyar+blh9QqJ2F1Kq7W9kSCGaVWXZ4meGIJEB /2bg/yS4x2+fe2Gjl9osOpSe2XhhXlWzoY9l9mtBIirO9gP8iN4SIKWVstIqxyDWexLy2 LtNf9kHUKBiYjbLwcX0y2i6bGar+1yQb2xIhJl8qUou6p8XMXUo2UEykmJZSRPlzYG5ps JISKrd4wAMtF6QpDzfCBixlqYgsBjW+EXfGWnLMdFq7t3Q3scDJs/OvbyFvpgMl3KIg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795899256; 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=SJdDCTzV2nTT0JJCmMjblSPwDYHE8IRno2FLETU6rrk=; b=ynrSQw+7azoP6u7NsQ2wULQ/edPRRDXSmQspznsCZ6rCAdN4eOmTI8wUHx2QpDzomxid oe5Am8iKTKSl8iY3f3W/6iD41v6bxaRpRl3brKPTnprR8PBLccggdjN/2xd2OZN15VaWO K6+U/c2r85XPXotAAgkjHuzH8RrqhegURrV+5lPvJRJBeeo+SexqMeMBVPKzVGePlMiAm EH712rmINbEoUHeb87nB32DSmwEctZOD+OJH1VzHHJmLN2CJT2/3hnEXJ/la2I/The1zG JmE6R7jjoRKTeGmgrBSEAwKcCEDsfSChNq383pgc/me7jvzI9V8RoAVf1FYWJzbA8+Q==
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="JLI1Jr/K"; 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 7CB05606A32F; Sat, 28 Nov 2026 20:54:16 +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=JLI1Jr/K
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=1795899255; b=2tLzt3j8pwjLnYDGAaRW4F7sSHeiN4WxqJQAutyuZXyl6AvwNtVwc17pbd8g8p6+xsiB L9dUaNUpEq+6/d/Cfl9TG30UminF4UMUbQiI+SfCYnqWWlKSdDC6a0nx+V5Ynkl3FMF0I FXnG/pmOhbRg6yPyJhHO+D67PpYu9hG4wQcR/MJmrR7j9yVuI49TCONmnHhRwXVf3N5lG Z3R1TkUxj7v22bDvCemsOPEOMMq5WBNt7cUB8vFH1UXosJdwTSZgoLHZKMhdK4ZacPck7 TsIRSRrX9cR6dzgP4kJFeu2Z+D6oRwPAmmC7WAbbXZwtP2vdDmV+Xebi29iAh4k5wyg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795899255; 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=SJdDCTzV2nTT0JJCmMjblSPwDYHE8IRno2FLETU6rrk=; b=Se6MHoXtqIJ1X7ba/vXJMPSYfjtqO1BfNQJ2mxeK9OUSgX5xBQV1+P1f+krNEVfJwIr8 pnf43Px7GideEik48+2ywnUts0b7iHU8SILVuyQj+5oO3lbeMlyvzo4RbIgsDefoN1ZSy +c75FDaz42dgSAm4eXTcQ545ssy8wKEmSn1Wa1opOLbDivJRSHn+MPkfiyXrMmwRT8fj8 TVdUMDjmVwV0jymbYim1BdGdWN5FzwYq/dEChaUslJG0b7tIJJRLr3bW0sexKpskWmOGo TRsFv3/764T37qh/Rq8UcORvt53SPq89srDpVCyZKUumrfygT2kEpWs4+MYQgspKiKw==
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="JLI1Jr/K"; 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) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68771606A31C; Sat, 28 Nov 2026 20:54:14 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 68771606A31C
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 21A23A03F0; Sat, 28 Nov 2026 21:54:08 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim; t=1795899251; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=SJdDCTzV2nTT0JJCmMjblSPwDYHE8IRno2FLETU6rrk=; b=JLI1Jr/KMnVwKi5RsODfnAxMmDRZ1CX8s3SnOsC5NVfi7sZuWoBtDzjfjpjF7zss3+W/tb YX6m8Tty5yi6v3AxgrFZBXr0Fauw5Zt3vRXe34k1lVkUtWGC5rbzMVGLUb4z12q6lzmOM3 Pd7ZWxzH9ovs+9nFT+eJoRjma80KIpSyGHxNuDnmAZpUepfxFjB+CAeRXA7DyTIUdOx4qS xangomFF40aQiUgGt5lwUPBc15RgKt1uHXxtRvbxnNvIMi45N9/v3N8+ya3a91UhQG6F/1 0wVQR+vAt8WGhtmx189enL+yKTzdzhyB1wqz+WIb/F/0L51zjN2Q5pRE557eeQ==
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, 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: <20261124185820.3954716-2-florian.fainelli@broadcom.com>
X-Sender: nb@tipi-net.de
X-Last-TLS-Session-Version: TLSv1.3
X-Received-Bytes: 12215