From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.246.85.4 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796567483; b=P/BLIh1k9UrJq4C6LiFeyGfpWGOM1nhVmrJJt99BSPI8G7xMngnzzxsaoTXvxsigcYCC /YO9EMhHahOIqvEUQY/uwBhGQHkElT5+8kvtLJBrtbpEJ2MfHXq4NVDQ0dfAdk2K1JbAe 2pwRliUpKnYwQMfXp1QEVKhR2cB3zBh5dJWhwmkEbJrMHEQTfp9iVELn1wpRubo7gvBlw lL6AQWIOk8tY7RcDd1ygC96sXSak9nArMOLIvRPo9mOJ7BpVBYfb5zoQtWG43ZvLW0EN5 B40OCyJn+SU3LDsRlbwms9te8Uez6qkJCq6L2AvFX8SowxGY3W6k63mS4Wymqh8i5Mg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796567483; h=DMARC-Filter:Received:Received:Received:DKIM-Signature:Message-ID: Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-Last-TLS-Session-Version; bh=YTl0xqtPtmbXH3dlBCM6djAXO4Cvm4XnRMbAYVyZzxo=; b=irUr1li78thDmK+FoTRwv3nRuEwGP5A9Zlucg9dTJdZ+FpAzVosc/tR/r+mGZVtHe94Z 58JSXQmEN77WfzhHsIVwqb2yH4fNDpiu1YF9aoopit1ppsUr4H7Ik/z3W60FJhk7JQTI0 aK4InitQro0tLreIHXQb4Ue8Y7C3JpMx4dqhklsiCd7NnngGZrmJgD9jc+c2g6HizT2T/ ou/MAVPDu9I7+kWQ6V1Px018pJPRmH0dgZh1MevqU/y+w0xsOGvNMn5hzujTSJP9DSD3K ZDAQQddMo8BptjW44GK7rgpHGpC5inMmZ4qJT/HC1nMsymlLqr0Bicw8GunqZ1cYWpg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=NrKhbG+B; arc=none smtp.remote-ip=185.246.85.4 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 3BDF8606A31F for ; Sun, 6 Dec 2026 14:31:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3BDF8606A31F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=NrKhbG+B Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id F410E4E418D5; Sun, 6 Dec 2026 14:31:18 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id B56C3604C0; Sun, 6 Dec 2026 14:31:18 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 60D2F11EA1788; Sun, 06 Dec 2026 15:30:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796567477; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:content-language:in-reply-to:references; bh=YTl0xqtPtmbXH3dlBCM6djAXO4Cvm4XnRMbAYVyZzxo=; b=NrKhbG+BnJAtBBiLGz6p/NspnJEAsOztUy3oz26wxOXTZMXh8U+V/tlLbWHfyNGbDcMgyo A4Bg7FegLr7LP/W1EysCnhHjP8dWnVCEv5WTj+8FLUMWvgO9DK0NID6+zbNf5yBdeo1gBc W3n61bCcpM7cXQ3PAuZYN+h7Rv/mdvN8+HeLmn+/oUyuDiuuLYCIjkHJp7F1zfWsWycG8H mqLMr8K8QHIeJeBWxsHe++fCi6hwny6ME2j6dtsY6SN18OJyGxNlfh1xOrClUjfolgprE1 ht5QyInR9Il5yeT5q/Dsoo36sRI+F6XDJhoyE7c51pXr+D+d8umSmeUa+ps8/A== Message-ID: <762d81b0-6f2b-4568-b500-9ad06a9d5b04@bootlin.com> Date: Sun, 6 Dec 2026 15:30:58 +0100 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next 03/12] net: phy: Don't create the sysfs links for PHYs behind a mux To: netdev-bot+sashiko@kernel.org Cc: davem@davemloft.net, andrew+netdev@lunn.ch, kuba@kernel.org, edumazet@kernel.org, willemb@google.com, pabeni@redhat.com, linux@armlinux.org.uk, kabel@kernel.org, sebastian.hesselbarth@gmail.com, gregory.clement@bootlin.com, hkallweit1@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, thomas.petazzoni@bootlin.com, devicetree@vger.kernel.org, conor+dt@kernel.org, krzk+dt@kernel.org, robh@kernel.org, christophe.leroy@csgroup.eu, herve.codina@bootlin.com, f.fainelli@gmail.com, vladimir.oltean@nxp.com, kory.maincent@bootlin.com, o.rempel@pengutronix.de, nicveronese@gmail.com, horms@kernel.org, marcin.s.wojtas@gmail.com, daniel@makrotopia.org, dimitri.fedrau@liebherr.com, frank.wunderlich@linux.dev, p.ameruoso@live.it, f@lex.la References: <20261204110622.1106492-4-maxime.chevallier@bootlin.com> <179647310509.3146.4826722371590579464@kernel.org> Content-Language: en-US From: Maxime Chevallier In-Reply-To: <179647310509.3146.4826722371590579464@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Last-TLS-Session-Version: TLSv1.3 On 12/5/26 13:18, netdev-bot+sashiko@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 2 potential > issue(s) to consider. [...] > [Severity: Medium] > Does skipping the whole helper also drop the attached_dev link for mux > PHYs? phy_sysfs_create_links() creates two links: > > err = sysfs_create_link(&phydev->mdio.dev.kobj, &dev->dev.kobj, > "attached_dev"); > ... > err = sysfs_create_link_nowarn(&dev->dev.kobj, > &phydev->mdio.dev.kobj, > "phydev"); > > The attached_dev link is created under each PHY's own mdio device kobject. > Several PHYs behind the same mux therefore can't collide on it. Only the > netdev side "phydev" link can conflict. > > Later in the series, phy_mux_attach() calls phy_mux_port_bind_phy(), which > sets phydev->mux_port, and then calls phy_attach_direct(): > > ret = phy_mux_port_bind_phy(port); > ... > ret = phy_attach_direct(dev, port->phydev, phy_flags, > port->interface); > > phy_attach_direct() still sets phydev->attached_dev = dev and adds the PHY > to the link topology. Every mux PHY is attached to the netdev, but > /sys/class/mdio_bus///attached_dev is never created for any > of them. > > Documentation/ABI/testing/sysfs-class-net-phydev describes attached_dev as > a symbolic link to the network device this PHY device is attached to. It > makes no exception for muxes. The phydev entry in > Documentation/ABI/testing/sysfs-class-net doesn't mention the mux case > either. > > Skipping the netdev side phydev link seems fine, because phy_mux_attach() > sets dev->phydev = NULL anyway. > > Would it make sense to keep creating attached_dev for mux PHYs and only > skip the netdev side link? If not, could the exception be documented in > the ABI files? True yeah, I can adddress that, so in sysfs : - phydev's attached_dev stays - netdev's phydev disapears. Maxime