From nobody Fri Sep 20 11:59:55 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA2FEC001DE for ; Fri, 18 Aug 2023 03:08:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357424AbjHRDIK (ORCPT ); Thu, 17 Aug 2023 23:08:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343839AbjHRDIG (ORCPT ); Thu, 17 Aug 2023 23:08:06 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39DE2100; Thu, 17 Aug 2023 20:08:05 -0700 (PDT) Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1qWpq5-00056L-0G; Fri, 18 Aug 2023 03:07:53 +0000 Date: Fri, 18 Aug 2023 04:07:46 +0100 From: Daniel Golle To: Alexander Couzens , Daniel Golle , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next] net: pcs: lynxi: implement pcs_disable op Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When switching from 10GBase-R/5GBase-R/USXGMII to one of the interface modes provided by mtk-pcs-lynxi we need to make sure to always perform a full configuration of the PHYA. Implement pcs_disable op which resets the stored interface mode to PHY_INTERFACE_MODE_NA to trigger a full reconfiguration once the LynxI PCS driver had previously been deselected in favor of another PCS driver such as the to-be-added driver for the USXGMII PCS found in MT7988. Signed-off-by: Daniel Golle --- drivers/net/pcs/pcs-mtk-lynxi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/pcs/pcs-mtk-lynxi.c b/drivers/net/pcs/pcs-mtk-lynx= i.c index b0f3ede945d96..8501dd365279b 100644 --- a/drivers/net/pcs/pcs-mtk-lynxi.c +++ b/drivers/net/pcs/pcs-mtk-lynxi.c @@ -233,11 +233,19 @@ static void mtk_pcs_lynxi_link_up(struct phylink_pcs = *pcs, } } =20 +static void mtk_pcs_lynxi_disable(struct phylink_pcs *pcs) +{ + struct mtk_pcs_lynxi *mpcs =3D pcs_to_mtk_pcs_lynxi(pcs); + + mpcs->interface =3D PHY_INTERFACE_MODE_NA; +} + static const struct phylink_pcs_ops mtk_pcs_lynxi_ops =3D { .pcs_get_state =3D mtk_pcs_lynxi_get_state, .pcs_config =3D mtk_pcs_lynxi_config, .pcs_an_restart =3D mtk_pcs_lynxi_restart_an, .pcs_link_up =3D mtk_pcs_lynxi_link_up, + .pcs_disable =3D mtk_pcs_lynxi_disable, }; =20 struct phylink_pcs *mtk_pcs_lynxi_create(struct device *dev, --=20 2.41.0