Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7277667rwd; Tue, 6 Jun 2023 08:32:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5FJ52FRdN4TIqSDZiPj8vsoCZ8jDnypieci8tyrL16CAGWNkly72EWOQpTkfsD+JLF4eXq X-Received: by 2002:ad4:5966:0:b0:62b:3dd9:2dc with SMTP id eq6-20020ad45966000000b0062b3dd902dcmr1964749qvb.64.1686065567660; Tue, 06 Jun 2023 08:32:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686065567; cv=none; d=google.com; s=arc-20160816; b=KscdiZxFv+QIOTwfNMstYmyUlcNW1/qrfa7/5Duv+yOT1su+ke3xwhhvLz6ZX7bNw2 h4DjxSHR7ikDLniLu+blLiP9V//9ixoJe5I6kXCn0bax7VGCvzXqMVyRamLo7rlZ1V4c vC4MhnIh5iS2GYWkFmyii0sibs9ofiqzII5mLMhLahB6NcGKa6cNn0efE8bBazsWxlxL GD1CVnzqdiPHH5pISGg/hHwZcVfwQY1jEDQDFlgUcFDqwcWAwB9D7o8aIoMEdjoUXwNo rUj6mAYjb+fqv6q3id7HjRasbQeoeNoo5oeqncQf2hYFSnrTpiupv9apepOR7528pfPg Z3/w== 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=ttnVbaUsbmopLb6Rdtc5eppinnLixmLTsDnBT1AeYTA=; b=LAK/CMD84D9lXJjPl6cZOWhd2MKnEkrOUZ2EpZAEpLX3qyD44Mc3rEdchTURaMQTq0 53QFYmmjRXH1fEEOxHKFvAwWRwqI6eWOYEBwhnZFlW3BVl1SEdNij8u7M3ek64ZftMYS wHcMSmuaNipzMV2414tjPP86BJj0YchtO0+cg1ZptR/r7A31YQ5/n59jrTiV7J78eOKG VDFgmQPof6vkIqySl0mj4csAEX/CkQjC9YLBb1uoZGysec1y/h0XB0hSLkXdO5BWTikC fQkMCmBSPfx1BpQsJAewDLC88MGgspG3wunUZ0N73f/U8kDgApXBeeCxRSS1oKE+0y6I 4dTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=dHuNiXq+; 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 i8-20020ad45c68000000b00625b6cf122dsi6564655qvh.115.2023.06.06.08.32.30; Tue, 06 Jun 2023 08:32:47 -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=dHuNiXq+; 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 S237056AbjFFPZ1 (ORCPT + 99 others); Tue, 6 Jun 2023 11:25:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237271AbjFFPZT (ORCPT ); Tue, 6 Jun 2023 11:25:19 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 783AEE7E; Tue, 6 Jun 2023 08:25:18 -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=1686065117; 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=ttnVbaUsbmopLb6Rdtc5eppinnLixmLTsDnBT1AeYTA=; b=dHuNiXq+6+m6WpaHmsIfvChgyt24BlatKTcW4ZHOOiL23GcfunRhgf9tfgTgofsVoWPkSg 9wRr81zMmzadPwGZw8rdby+7G0VN9kg9Zu3l1+h3vkzIPTISB9CJ6xRJh+02yLPLBZduNI /zCgfPdyo+eJwo5F1O+gcHDSjRmWLnMgn533IiHsTVGaJHyhIoisGFnQbbimwJpLWKNa6b CioSyg3jEE+3+XlubAW8lUc3zF4Vs/uZMWVh38BgeSQIvfkla9+kSmHxFyKZ2apClk6C5O 6+DkXpWgQcMgIEdRlrI9dBlt64nePJB2s9EQgoxPUmpsixSZaEYk3m+5vzyXQQ== 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 2A5A7FF80D; Tue, 6 Jun 2023 15:25:14 +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 , Russell King Subject: [PATCH net-next v3 3/5] net: stmmac: make the pcs_lynx cleanup sequence specific to dwmac_socfpga Date: Tue, 6 Jun 2023 17:24:59 +0200 Message-Id: <20230606152501.328789-4-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606152501.328789-1-maxime.chevallier@bootlin.com> References: <20230606152501.328789-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,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 --- 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