From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.171.202.116 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796568428; b=TMIGtFgdAF/k568Jm2aRq8Gr30fBWnbalPx3IaBux3Adq+FCTwiLVJ3yBz+J5BL077Vg SQMCHh/KPdgx190OtsSvdHCqDB6I5v4w7UkvhR6GKfVr3xXBG8Z15pgZ22k2eQ7jmZEPH j+tJlNJMV50TtrTRBwQzkqQK8z6tnPvS0RYgFGANNHmm57ACjaC7TFPDE6H1fAvBR1ISG N3T7UbtjXb+YPhUs1mde6x2qwSNRqUqDHwZry1CGszT49BQOAjYHoEIpaRuXLICpBXU3Z SvLr4ioX1KMlkMjP3KQwzoTmQENuJP6UGX7cAM1fhJU6yO+9CMDqnk+/6tsaEzTI75Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796568428; 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=lfcNlot3PrxbRJbrHGPiSr9xfJcktCLb9LkSZWYE5XU=; b=HrJa8wsSX2cx/1vIpMCIOkLF/rE2RKk5qN1NvZNADkrUqy2yM726x/gdfXfsQ6qgVaPD BSsLitleChlPCUfjHibND+vNLp8X1jmWgrx1aXKNxEIBSBGkCRhKR+J0vvuNJRd6WryDZ XgqQ89DcUCjWgbVp9Xx+1S1oPHjpe60uA9yYU8UU5C122O8sN5DP8YGfUDGZsraZIfW2q 6sbsiBxLL+bJ86G5FFIFHfG86CgzXmCdStMpAho2k0z+BLOgj0rsJqNYnqj0VsAAnPkFK y8BHZL5gva2jTkyiS2Git8nQ77NmupKLoOhg5XrCCwN2TGbQy1cJRHDprx4NW7RT32w== 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=eBleDypd; arc=none smtp.remote-ip=185.171.202.116 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 395E4606A321; Sun, 6 Dec 2026 14:47:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 395E4606A321 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=eBleDypd Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 64F33C026D8; Sun, 6 Dec 2026 14:47:18 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 78897604C0; Sun, 6 Dec 2026 14:47:05 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id B7FBA11EA178B; Sun, 06 Dec 2026 15:46:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796568423; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:content-language:in-reply-to:references; bh=lfcNlot3PrxbRJbrHGPiSr9xfJcktCLb9LkSZWYE5XU=; b=eBleDypddT2BPtTYzlxlqelQhmVpx0cXiG7/CgIJiPg4JM7lU0cjV02Mbr4Zt9e3Ip9F7r ddvyrr5RQU+oK831r4l4EuXUDkqxJhmmN2Bz0w0+XTp93gh8AFNwM2/2Y0LKo3qXbhl7JD OgeGdzw36BUawiEUneEOQPw4YlazuWzZOZGp9YExDvXPBfbUgAD7J8eMzXfxcgsSItoV5W KccPIZEU0bXnPWeHli+s3tPkfPb2pfL0iJ15EXt7u531znMotWqhrYDNxQ/j9Y4QB1zbIA 15oSeXxJFoZrsxGH0iOi3cRLMxnsJjuRXOasfDrWG+nJZy3ONSoE2SumhFzSNA== Message-ID: <82e368d2-d19f-4045-a748-40e5f093192a@bootlin.com> Date: Sun, 6 Dec 2026 15:46:57 +0100 X-Mailing-List: devicetree@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 06/12] net: phy: phy_mux: Support SFP cage ports 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-7-maxime.chevallier@bootlin.com> <179647311238.3146.3730324098600663207@kernel.org> Content-Language: en-US From: Maxime Chevallier In-Reply-To: <179647311238.3146.3730324098600663207@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 5 potential > issue(s) to consider. > > Critical: 0 · High: 0 · Medium: 2 · Low: 3 > > If you believe none of the issues are legitimate, please reply to each > issue of Medium severity or higher and explain why the AI is wrong. > If any of them are legitimate and you plan to respin, please let patchwork > know by including "pw-bot: cr" as a separate line at the end of your reply > (one such reply per series is enough). > > - [Medium] When a port switch fails, nothing is selected and the mux core > never retries. > - [Medium] net: phy: phy_mux_detach() races with unregister, free, and > attach > - [Low] This patch changes phy_mux_start() from synchronous to deferred > selection without saying so. > - [Low] In include/linux/phy_mux.h, the kernel-doc for struct > phy_mux_port::interface says "The MII mode the link runs in when this… > - [Low] net: phy: commit message overstates auto-mux scope and omits > design > [Severity: Medium] > What happens when the switch to the new port fails? > > phy_mux_state_machine() and phy_mux_port_set_available() both ignore the > return value of phy_mux_select(). phy_mux_select() deselects the old port > before it tries the new one, and nothing is rolled back: > > phy_mux_select() { > ... > if (mux->current_port) { > __phy_mux_deselect_port(mux, mux->current_port); > mux->current_port = NULL; > } > ... > ret = __phy_mux_select_port(mux, port); > if (ret) > return ret; > ... > } > > For a PHY port, __phy_mux_deselect_port() also calls phy_suspend() > through phy_mux_phy_power_down() and clears netdev->phydev. > > The phylink parent added later in this series makes the switch back to > copper after an SFP module removal reachable: > > phylink_sfp_module_remove() > phy_mux_port_set_available(sfp, false) > phy_mux_trigger() > phy_mux_state_machine() > phy_mux_select() > __phy_mux_deselect_port(SFP) > __phy_mux_select_port(PHY) > phylink_mux_select() > phylink_bringup_phy() > > phylink_bringup_phy() can fail in phylink_validate_phy(). It can also > fail when phy_eee_rx_clock_stop() hits an MDIO error, or return -EBUSY if > pl->phydev is still set. > > A PHY port's available flag is set once in phy_mux_register_port() and > never changes. A repeated phy_mux_port_set_available() call with the same > value returns early. > > Can this leave current_port NULL, with no port selected while the copper > cable is still connected, and nothing retrying until ifdown/ifup or the > next SFP event? Should the error at least be logged, or should > phy_mux_choose_port() fall back to another available port? > > Before this patch, phy_mux_select() was only called with current_port > NULL from phy_mux_start(), or with port NULL from phy_mux_stop(). A > deselect followed by a failed select could not happen then. For now the only kind of switch supported forces the switch to SFP regardless of what is inserted. If the module inserted is incompatible then yeah nothing works, nothing we can do here. Proper error handling for this will come with user-configurable muxes, where it will be necessary Maxime