Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7185782rwd; Tue, 6 Jun 2023 07:26:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ZaRzZ9WHzd1GnPmx26HisIyfYC6M2EuXkQFhysJG6gg/QprXMtDgcaHgx6A79/0ZsWYDk X-Received: by 2002:a05:622a:1209:b0:3f3:8dff:68fc with SMTP id y9-20020a05622a120900b003f38dff68fcmr2271009qtx.22.1686061613080; Tue, 06 Jun 2023 07:26:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686061613; cv=none; d=google.com; s=arc-20160816; b=AxrOY9Fnb+/q/3UBSYlq+VriQmPC108caDsLKEM+K9YDijySjVn/DTpfdLfPYWub0Y QCD2PBpAn4/5AIcOFQoSiuT+iHZbXwKJLoCl/0+epGhPSj83HJY4Ba9/rp69KB6+RLCH YU1icrI7HM5wg7nPkJ/aCA75cwmzjOdupDZ7O8kl++VEouPaLMM2bMUj1olxBifRD5iT u1iPTX1BXcSpzJ2gK9coYwkvGF1ixq+gcPizWm20aKJjq8E1wXbNCZYHTtHp0EUUHe/6 hocS/bQs32q1kAmnmUJV0Ju2TMiwKrz1fwkHzgOh1n9fm8JgdCWxS+EyyIOXgzIqEVY3 IQlA== 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=Aus9EhxnuypVHJz+n+8T0gWLvZSkfscoIF7dmEyGuTs=; b=CshHB+Obb2U6CIX4cw26vrKvp2E8G9BgLFsmp9RQOOjBW6epLyWP4H95rvuWX31mVR QjB+4RqF0ajCd1CMeUFxVMyPRxyLm0yCxz/2oaWOGkMo4qYmNaYGWZbgaEXzZWbrr6al AXp/Ti9wAV8z71Qwrr77S4Xoakdi7Qa9NbpnACOwkw+Ezf/7GrM4yc3kY802yuFlGuuI duZwr6W3/0+p5hXb6kkBps7Eh1EaNrQA1dZHPPKGTGM+EHL24rLvEgBaC7xYo1brfnw2 g3rJJPeWbvJx7xLdXDumN486P0T+7n97VQXUvYeWi8h/3qKs+CMFFQkIhRAx1xBt7fhg StDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=kLEY0sJM; 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 p3-20020a05622a00c300b003f68a1f4d62si6135988qtw.356.2023.06.06.07.26.37; Tue, 06 Jun 2023 07:26:53 -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=kLEY0sJM; 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 S237676AbjFFOWE (ORCPT + 99 others); Tue, 6 Jun 2023 10:22:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237380AbjFFOV6 (ORCPT ); Tue, 6 Jun 2023 10:21:58 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03F7AE6E; Tue, 6 Jun 2023 07:21:56 -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=1686061315; 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=Aus9EhxnuypVHJz+n+8T0gWLvZSkfscoIF7dmEyGuTs=; b=kLEY0sJMP559X0ta4SVVD/7nI8L471Z1ofzQR6WYY82SbwBigvxuTACNJ6LbFP8yHP3F8n CMNb2m56iQTIlPH9lawzgJmb4EoDmurwraKFoqVA9SUePDXV63kAMvCASSSdLomdfH5RbR kfavFb0foudEEH56LEwMFfcLXrb+vg4DHUsw4+C7BEHDCJ2ieN/F5A+yv+EOlf0nn9ok4B bZAwdI9hpiU/B3Ulnhyzrfwx+ypz70YQQbmlx/QbRJv8peAGiK1bvE/t6zBUsSlpRGAaJv cdJuGevorfpimNWAvud7fmhUsbx1tMYo2YDZa53N9JEB+1KhSIsdBhXd6zf1vA== 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 997DFC0012; Tue, 6 Jun 2023 14:21:53 +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 v2 3/3] net: stmmac: make the pcs_lynx cleanup sequence specific to dwmac_socfpga Date: Tue, 6 Jun 2023 16:21:44 +0200 Message-Id: <20230606142144.308675-4-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606142144.308675-1-maxime.chevallier@bootlin.com> References: <20230606142144.308675-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 --- V1->V2 : New patch drivers/net/ethernet/stmicro/stmmac/common.h | 1 - .../net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 15 ++++++++++++++- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 3 --- 3 files changed, 14 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..ad66e128bff9 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,18 @@ 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 +578,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