From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 878A3606A31F for ; Sun, 6 Dec 2026 14:47:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=EVX3ABmA; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=eBleDypd DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=lfcNlot3PrxbRJbrHGPiSr9xfJcktCLb9LkSZWYE5XU=; b=EVX3ABmAax4Sl3 ECimk4AwJvgfTzqUQMrhrBiWVqS5C21Qz4wpPmMBVojdJUKOS6h7fushHq5ugzqUjVGpCmKD8gf9N pa491fQX8MuBz8UTXLUsqkfQ3oTT5qqm3caNS8ciFxN6uDq5nXhxgowRXoaYulY749fVhjobbU+aa 6N8TvKhaNkQSmVjP/NDnjDG+pXONI0jLJ5P1EWDjwigaAgWztfVjNB2vDn+EYEhXqL+AjC7N3aZju /fw/ULcltHh4KW5i2/RYoGn5uuSsyMyt2MGcfrJBo7PEa6/mXeTQ6ggdSJTZwx9mBwzvivDcwC6pk gygwCXvMOTO7hki9PJBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xaDWA-00000003gXH-2Gcp; Sun, 06 Dec 2026 14:47:10 +0000 Received: from smtpout-02.galae.net ([185.246.84.56]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xaDW7-00000003gWq-2X4t for linux-arm-kernel@lists.infradead.org; Sun, 06 Dec 2026 14:47:08 +0000 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id C24561A199A; 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-Archived-By: 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261206_064707_820902_64CF072E X-CRM114-Status: GOOD ( 19.90 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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