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 E1812606A320 for ; Mon, 30 Nov 2026 23:49:15 +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=AzDqXKw0; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WadacLIn 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:MIME-Version: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Message-ID:Date :Cc:To:From:Subject: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=pKV8WXb0qjnWoBDHn+cQjl//uOwfucbOLsU6Ms1mxV4=; b=AzDqXKw0MBU3W5X0M86mvDS27l FayBa2mX9Ya4lqpgYGTS+I7rRLkcbY/njmFqh0hF6+feIG4NW58LvlR8nd21OTd8rY1T8LoVgG8u/ nHNhmeEUF1zaMGnXAMLkMhybzteaIc+Zf1j9Jbz22ELl5HUVq+kirw1+UuwL6vE0lnTRXFPQmUJTx 9sSC8ZZgea9sgXzAoGA6Y0gyCP0u2MxioHUBcdCbmgzBEilAXFO5LLKxTmDQXPX0iMDeWibjxQbw0 BR8Vs//i2yn1dSl2fcmcqmZQ2z8vkLaH7Wmgua5mC+fh9rZIMwtoaryAUwOOSdHgO7OfhYc9qR4Bt 4K8Zouvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYB7T-000000064i2-2Yxw; Mon, 30 Nov 2026 23:49:15 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYB6C-00000006455-1X2H; Mon, 30 Nov 2026 23:47:56 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 21ECA4418F; Mon, 30 Nov 2026 23:47:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 405DC1F00933; Mon, 30 Nov 2026 23:47:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796082476; bh=pKV8WXb0qjnWoBDHn+cQjl//uOwfucbOLsU6Ms1mxV4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=WadacLInfcnT613db47eeD7FPQqXBsKjNeGEC66h6/0FVBpi9Q1wpaA0jNwVZE4Ol q96kuG4TfwJFmDgHf7BeWAZv3wFCb4ijancZnpAsH4CEUWJvbWmvtAtMmn7YWnn/KL 38u5OaFoxoLUqH89oadI17KlqXomOGZQAUDE3g9NP2ylSkLT7ytlpr0AkCPd1v1NvS JDUaCyFTaP1Q+RsEnAt00MQggnVVWsafvS4oWAn9DNOjPbZT071/rTyBbwp600U4Ll jyCmH+DfKS5Oa+UP0cnPTnu7qVsEe+RQB+v5VnPesqew6m1wnaRuZ3BqdBFU8M8rUR 20HSfqEozAt4A== Subject: Re: [PATCH net-next v23 12/15] net: phylink: add .pcs_link_down PCS OP From: netdev-bot+sashiko@kernel.org To: ansuelsmth@gmail.com Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, willemb@google.com, horms@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org, lorenzo@kernel.org, hkallweit1@gmail.com, linux@armlinux.org.uk, maxime.chevallier@bootlin.com, p.zabel@pengutronix.de, nathan@kernel.org, ndesaulniers@google.com, morbo@google.com, justinstitt@google.com, rmk+kernel@armlinux.org.uk, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, llvm@lists.linux.dev, zhengping.zhang@airoha.com Date: Mon, 30 Nov 2026 23:47:53 +0000 Message-ID: <179608247377.3146.11725760694388618130@kernel.org> In-Reply-To: <20261129230558.612526-13-ansuelsmth@gmail.com> References: <20261129230558.612526-13-ansuelsmth@gmail.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Archived-By: MIME-Version: 1.0 X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] The comment in rtl8365mb_phylink_mac_link_down() (drivers/net/dsa/realtek/rtl8365mb_main.c, lines 1839-1843) is now… - [Low] The new pcs_link_down() kernel-doc (include/linux/phylink.h:698-706) copies the mac_link_down() contract… -- net: phylink: add .pcs_link_down PCS OP This commit adds an optional .pcs_link_down operation to struct phylink_pcs_ops. phylink_link_down() calls it right after .mac_link_down, so a PCS driver can tear down the link between the MAC and the PCS. > diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c > index 3471ba8d5ba6f..b57a7de058b8f 100644 > --- a/drivers/net/phy/phylink.c > +++ b/drivers/net/phy/phylink.c [ ... ] > @@ -1889,6 +1895,9 @@ static void phylink_link_down(struct phylink *pl) > > pl->mac_ops->mac_link_down(pl->config, pl->act_link_an_mode, > pl->cur_interface); > + > + phylink_pcs_link_down(pl->pcs); > + > phylink_info(pl, "Link is Down\n"); > } [Severity: Low] With this hook added, the comment in rtl8365mb_phylink_mac_link_down() in drivers/net/dsa/realtek/rtl8365mb_main.c is no longer accurate: /* phylink has no pcs_link_down callback, so on the SerDes path only the * MAC external interface force is reset here. Clearing the MAC force is * enough to bring the link down; the SerDes keeps presenting its last * forced state until the next pcs_link_up() reprograms it. */ rtl8365mb_pcs_ops does not set .pcs_link_down, so runtime behaviour does not change. The comment still says phylink lacks this callback, and it uses that to explain the stale SerDes state. The comment is unchanged at the end of the series. Should this comment be updated in this series? Another option would be to move the SerDes teardown into a .pcs_link_down implementation. > diff --git a/include/linux/phylink.h b/include/linux/phylink.h > index 9ce66b0344370..d53319e67f776 100644 > --- a/include/linux/phylink.h > +++ b/include/linux/phylink.h [ ... ] > @@ -693,6 +695,16 @@ void pcs_an_restart(struct phylink_pcs *pcs); > void pcs_link_up(struct phylink_pcs *pcs, unsigned int neg_mode, > phy_interface_t interface, int speed, int duplex); > > +/** > + * pcs_link_down() - tear down link between MAC and PCS > + * @pcs: a pointer to a &struct phylink_pcs. > + * > + * This call will be made just after mac_link_down() to inform the PCS the > + * link has gone down. PCS should be configured to stop processing packets > + * for transmission and reception. > + */ > +void pcs_link_down(struct phylink_pcs *pcs); [Severity: Low] This text follows the mac_link_down() contract but leaves out its in-band caveat: * If @mode is %MLO_AN_INBAND, then this function must not prevent the * link coming up. Should pcs_link_down() have the same caveat? With MLO_AN_INBAND, phylink_resolve() gets link state from pcs_get_state(). The only call that reverses pcs_link_down() is pcs_link_up(), and phylink_link_up() calls it only after pcs_get_state() has reported link up: phylink_link_down() phylink_pcs_link_down() <- PCS stops RX/AN, as this doc allows phylink_resolve() phylink_mac_pcs_get_state() <- link stays false phylink_link_up()->pcs_link_up() is never reached phylink_link_down() calls the hook on every link-down, including the latched link-fail retrigger path. Could a PCS driver that follows this doc literally and stops its receive or AN logic here leave an in-band port down for good? Unlike pcs_link_up(), the new callback gets no neg_mode or interface argument. A driver cannot tell from the call alone whether in-band detection has to stay active. The only implementation in the series is airoha_pcs_link_down() in "net: pcs: airoha: add PCS driver for Airoha AN7581 SoC". It is not affected. It only sets the XFI MAC RX/TX MPI/MBI STOP bits, which airoha_pcs_pre_config() also sets before link-up. airoha_pcs_get_state() reads the hsgmii_an and usxgmii_pcs registers. -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261129230558.612526-1-ansuelsmth%40gmail.com