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=1796568428; b=xOiRKZYGx/z6xdHSC/4gM9sMHnEQFCYiUpuxAzRJDWnleexLgSnUb3Nnto+0F0pWdprG DDJOS2kruk6bf+74qd48g2FY6G3v7STgNvSdIgdIw1yUG5tTy0ITOAroEVfifIdRO7yFD rxQyNQCbcg1mV2LsomNZmUNSJ2giKDTRTG08G4LVzVeVknw/4Tx+Uf+WdP414BmgUCL6Y 4R4pI5U34EmbOfhN39cAsMfFs0xrOn9HE+qzyiRAI9m+ZoMFvJZnmFK3j09WWV0djNDjw EBZ6g9BmbYqZt0x6rB9KlrVk1QNzinveY7Z9rAxX69wDyhN3RAChaHDp2RGl0JVONPA== 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=AEx9tJLJ4+gflPXpwGMQN51plbMQSlkdadJHrFnUxUafGQMD3Xg9nXWIff8dbxed0zyR H3rg9AURZflQufUijMU1jJOf0uzWHZLp/wOh/7N6ZZ/TCqiPOVbAHz1/5/dz7Z3SBwg+p CPQ9pndmd2c36G+dMEqEnx54vZZSMjUCIIQXd7E4koTD4t2+mswZXeLiLz2GiE+XkVXCA tKjcswZw1AQlbFchubascd4y2rHkIbk43qrgf5ko33Zn9PN/tyPIrdSaNYtk4TNiwhY2C Ta6NBrcImfsWJ4OLwUjgn9bXTqpiEAssc55hVH+kdsl8RqTXUeirBN2Xyj2mRwNmr9w== 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.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 88D61606A31F for ; Sun, 6 Dec 2026 14:47:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 88D61606A31F 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-03.galae.net (Postfix) with ESMTPS id C6EA34E418DB; Sun, 6 Dec 2026 14:47:05 +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: netdev@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