Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp675382rwd; Wed, 7 Jun 2023 05:35:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Yyo8yBYbPPm4l06NEZ2P1yAzZHIRY+JdhgdwzciEtxfY8wTcbmiXdMXlJYnN2tauhFcuo X-Received: by 2002:aca:f09:0:b0:39a:b55b:a445 with SMTP id 9-20020aca0f09000000b0039ab55ba445mr5712356oip.22.1686141358037; Wed, 07 Jun 2023 05:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686141358; cv=none; d=google.com; s=arc-20160816; b=05V8kOIKoef5p6o6zj1qGyC4EmikvwVr6Eflkes8ULFr/UonkFygPmbZ0d0hAADpX2 3T+unR9Rt232/cQkBcgONQDfeEUOiYxgiCd/NbLEBHU3XSHGa//g9Gxqq6zpTjB26OQq HDfnsp2hsP8RZvFNvyVam8s6gixQC/2A+iXLVGlbfbpcC9bJRMmKnAxgJkZcQPqstWxs QTBTp54EyvWMeB3gQhcXfibv4tUWT7ev1TaWwrtCRUU47kiDTAw4Q1664QRCfM43lRZp 0TW/7EjGPIZUGflAHkMXMqy2K4zQuHpjHOU5y6m6nlvO2rdvfrsqmA1tQQhd8aWEDRyD KWYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JAZzarZqhM2iVjfpFiTJa4PhaSPy8dShUtf29Ng6/6c=; b=UEu8o86DgPBUcPh2zbsqtaztjigZaZtU0Bb/NaNO/Y+G+IwQik/nxNdKAxhxFxGw8J sC+8H8SWMTs+Jd/Gy/hZ/RpHkNEu6/+DUn3h7o26QWtCTYy+EfJnMNw7gh9p9R43cNT7 FZSviRS6NQnQm9t0F0JIxKd/X2LFf7vfBgzdD8lB+/sDZjdLYpTALN1EGHJojVK9kAg1 dHmiaiy1gT0A+sgsRTC6i2TOPcsp8q6FiwYt28Ff57lcXQDBBvykJqN4ZTLvYSPXT0q8 oDrVrhrDUDnbtLOor9D/xtzZLDChUEw1XRzZkw+48ObQjdPbIGgTM9d7qk/iabdfJK9r HZYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=YxldgSAc; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h21-20020a633855000000b0053fbb2ddb4csi8931367pgn.36.2023.06.07.05.35.45; Wed, 07 Jun 2023 05:35:57 -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; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=YxldgSAc; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240517AbjFGMJB (ORCPT + 99 others); Wed, 7 Jun 2023 08:09:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240495AbjFGMI0 (ORCPT ); Wed, 7 Jun 2023 08:08:26 -0400 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63F591BDA; Wed, 7 Jun 2023 05:08:24 -0700 (PDT) X-GND-Sasl: maxime.chevallier@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1686139703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JAZzarZqhM2iVjfpFiTJa4PhaSPy8dShUtf29Ng6/6c=; b=YxldgSAcYSesTyWKUeEpxssivRO2lMjbEBJ77yE0epqggeY6sbg/z8rajFXfHTPIfYDxVn xAYbLzj5wlB7whJ1PQLOhAilmC/Vlo/ZcmyGZSnsQX4INlswuMvHygawRRQY0soXE2Mjog saE6hlbl+wJoVkxrgECrIETaMuYVhxV3V2bSOVQc6SpMhAp/aJBSa+7jwLwo7fbeXatvOU A4r1AFQ07ul9QDae+xDRZlOXdX87a4TTSJB97ccP82vZHiicGWITB/2TZqgnmCf3OiPWQB uHOUkhgFHu0rdG0qnSybOzpx5jeoChUcdrCyaZO+Q3me7uBLGcM0lfhwyWtn7A== X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id E559CE0012; Wed, 7 Jun 2023 12:08:20 +0000 (UTC) From: Maxime Chevallier To: davem@davemloft.net Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, alexis.lothore@bootlin.com, thomas.petazzoni@bootlin.com, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Florian Fainelli , Heiner Kallweit , Russell King , Vladimir Oltean , Ioana Ciornei , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Maxime Coquelin , Jose Abreu , Alexandre Torgue , Giuseppe Cavallaro , Simon Horman , Maciej Fijalkowski , Feiyang Chen , Russell King Subject: [PATCH net-next v4 3/5] net: stmmac: make the pcs_lynx cleanup sequence specific to dwmac_socfpga Date: Wed, 7 Jun 2023 15:59:39 +0200 Message-Id: <20230607135941.407054-4-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230607135941.407054-1-maxime.chevallier@bootlin.com> References: <20230607135941.407054-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 So far, only the dwmac_socfpga variant of stmmac uses PCS Lynx. Use a dedicated cleanup sequence for dwmac_socfpga instead of using the generic stmmac one. Fixes: 5d1f3fe7d2d5 ("net: stmmac: dwmac-sogfpga: use the lynx pcs driver") Suggested-by: Russell King (Oracle) Signed-off-by: Maxime Chevallier --- V3->V4 : No changes V2->V3 : Removed extra whiteline V1->V2 : New patch drivers/net/ethernet/stmicro/stmmac/common.h | 1 - .../net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 14 +++++++++++++- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 3 --- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h index 52c5ec553276..16e67c18b6f7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/common.h +++ b/drivers/net/ethernet/stmicro/stmmac/common.h @@ -16,7 +16,6 @@ #include #include #include -#include #include #if IS_ENABLED(CONFIG_VLAN_8021Q) #define STMMAC_VLAN_TAG_USED diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c index e399fccbafe5..1fb808be843b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -494,6 +495,17 @@ static int socfpga_dwmac_probe(struct platform_device *pdev) return ret; } +static void socfpga_dwmac_remove(struct platform_device *pdev) +{ + struct net_device *ndev = platform_get_drvdata(pdev); + struct stmmac_priv *priv = netdev_priv(ndev); + struct phylink_pcs *pcs = priv->hw->lynx_pcs; + + stmmac_pltfr_remove(pdev); + + lynx_pcs_destroy(pcs); +} + #ifdef CONFIG_PM_SLEEP static int socfpga_dwmac_resume(struct device *dev) { @@ -565,7 +577,7 @@ MODULE_DEVICE_TABLE(of, socfpga_dwmac_match); static struct platform_driver socfpga_dwmac_driver = { .probe = socfpga_dwmac_probe, - .remove_new = stmmac_pltfr_remove, + .remove_new = socfpga_dwmac_remove, .driver = { .name = "socfpga-dwmac", .pm = &socfpga_dwmac_pm_ops, diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index c784a6731f08..3db1cb0fd160 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -665,9 +665,6 @@ int stmmac_mdio_unregister(struct net_device *ndev) if (priv->hw->xpcs) xpcs_destroy(priv->hw->xpcs); - if (priv->hw->lynx_pcs) - lynx_pcs_destroy(priv->hw->lynx_pcs); - mdiobus_unregister(priv->mii); priv->mii->priv = NULL; mdiobus_free(priv->mii); -- 2.40.1