From patchwork Fri Aug 18 03:07:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 135979 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp1145179vqi; Thu, 17 Aug 2023 21:06:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGUqkji0mLnP7HDF5EVLqaOmD3/fhDKF3GGt4slVonwM72QhXb+rxdVSIH8dFoiVfeuQjI1 X-Received: by 2002:a17:902:ecc2:b0:1b8:b382:f6c3 with SMTP id a2-20020a170902ecc200b001b8b382f6c3mr1706327plh.13.1692331578147; Thu, 17 Aug 2023 21:06:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692331578; cv=none; d=google.com; s=arc-20160816; b=Y0ggp24mleZpP4LjTBYPl9RoMRSi+8YJ0/W1eN3Ck8inO2uvEbz1SNUAwyyqs+V+PW szXAOLPoxYoe3EUhfjAEOLg9kGBmW1KtlOL7YNfAArBT8j4o9V9LzMq/j/zAG4RBlYnZ vOeiXTdanQONmn07uX7JNJyQI6xiMHcGcad1cnxjFUmM5TbZOol79c/ymsj7nz3/+1hR Hoh4XvqmolfwEOmt/w73CJMu/XVc8PIrOroYfnH0h68YZp4IlVj/+k2xIW4EQweeomRv NBaYhYTQDnqR55Rf2HltGSQuvUrfuTidVb/npLglVE24531bKrjjUWYvxiq6EuqrF4aS 5DCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date; bh=IBUO2uNKo6cW99tMDi2TTggtzV1GAG9jZeGG97PGh4M=; fh=UHMNjJiuxKuA03v9I9ZORlBFAtuL/SiP8nCBgfAAnpQ=; b=FJEcSK3LVuzZaCI3pQ0Qb6mjCZ1wKveRpXVaeLBPQBbpL3ZgDG6gLV/7Sp+qrBSnHC W16jgX10SAjh8ffF7/iuy5lDlejJCHYpK4geBPCcE+J8vHIjLzNAyIWAPE/euFrXKpgp FiI8Rn4Ii9ASUnkUJSmwBfDtI2H5KMd7pRduLZIJ716e9b397PfwJT8+Qi/LJDwMSWhB D3j1VDB8ltu8HK1NnOuopGANv2aQUS1uFrLXqbUd8kO1k0XlYjxVGo/luheuiIvUNGyv qnj6rbhhryqroznhuhTaChhgj53ZA3BrcXdGSCsi7bPDqS6tUoc89ZcPPrmgCBcsryio u7Pw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u1-20020a17090341c100b001bba879700fsi797936ple.514.2023.08.17.21.05.48; Thu, 17 Aug 2023 21:06:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357378AbjHRDIK (ORCPT + 99 others); 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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774538276939076066 X-GMAIL-MSGID: 1774538276939076066 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-lynxi.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, } } +static void mtk_pcs_lynxi_disable(struct phylink_pcs *pcs) +{ + struct mtk_pcs_lynxi *mpcs = pcs_to_mtk_pcs_lynxi(pcs); + + mpcs->interface = PHY_INTERFACE_MODE_NA; +} + static const struct phylink_pcs_ops mtk_pcs_lynxi_ops = { .pcs_get_state = mtk_pcs_lynxi_get_state, .pcs_config = mtk_pcs_lynxi_config, .pcs_an_restart = mtk_pcs_lynxi_restart_an, .pcs_link_up = mtk_pcs_lynxi_link_up, + .pcs_disable = mtk_pcs_lynxi_disable, }; struct phylink_pcs *mtk_pcs_lynxi_create(struct device *dev,