From patchwork Tue Aug 16 14:23:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 12945011 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1DABEC25B0E for ; Tue, 16 Aug 2022 14:25:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=WnoATLl6lfvVgwLZIIdhoJjCD9vd+pUD2meWus6FoGQ=; b=cvIGDW/OazwMSI Vk/kPoD7iJCuLNTcrvCiQlpintBwuapn+bKimdb7NfyCn6K9grIZQEJxLBCjcLjObcEFrDdXV9z/a ZiVz17l85szCYsR0hqHI22RFUxPOAcQUf9h48Of5WiDyFBJMuACjG19XsxOmuiGm34elXz72xxS1k PAxf+CFaFAEX3/lyoeofyKTNCizqGq+18zd8iP4tmfzUbcabcpdIe4QkQljHXvCLvLR7d13Cvi6P7 rC6GwubNtsQ+bUOmsXAcxSJj6ZcEg9eR7hx4RX4jn9eputrjg4WaSGxX2tpP0/i+Y9MkhiImXgjhG O56GuiH3AwGU2L5iy5Ug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNxUS-003Kbw-Kl; Tue, 16 Aug 2022 14:24:20 +0000 Received: from smtp02.smtpout.orange.fr ([80.12.242.124] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNxUO-003KVu-Pl for linux-arm-kernel@lists.infradead.org; Tue, 16 Aug 2022 14:24:19 +0000 Received: from pop-os.home ([90.11.190.129]) by smtp.orange.fr with ESMTPA id NxU7oTaciBDYDNxU7oNjp3; Tue, 16 Aug 2022 16:24:07 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 16 Aug 2022 16:24:07 +0200 X-ME-IP: 90.11.190.129 From: Christophe JAILLET To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Joakim Zhang , Andrew Lunn Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , Andy Shevchenko , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/2] stmmac: intel: Add a missing clk_disable_unprepare() call in intel_eth_pci_remove() Date: Tue, 16 Aug 2022 16:23:57 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220816_072417_015833_BF3C05EA X-CRM114-Status: GOOD ( 13.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Commit 09f012e64e4b ("stmmac: intel: Fix clock handling on error and remove paths") removed this clk_disable_unprepare() This was partly revert by commit ac322f86b56c ("net: stmmac: Fix clock handling on remove path") which removed this clk_disable_unprepare() because: " While unloading the dwmac-intel driver, clk_disable_unprepare() is being called twice in stmmac_dvr_remove() and intel_eth_pci_remove(). This causes kernel panic on the second call. " However later on, commit 5ec55823438e8 ("net: stmmac: add clocks management for gmac driver") has updated stmmac_dvr_remove() which do not call clk_disable_unprepare() anymore. So this call should now be called from intel_eth_pci_remove(). Fixes: 5ec55823438e8 ("net: stmmac: add clocks management for gmac driver") Signed-off-by: Christophe JAILLET Reviewed-by: Andy Shevchenko --- Change in v2: * Fix a copy'n'paste typo from the error handling path of the probe to the remove function * Remove the big warning added below the --- in v1 (see link below if needed) * Add Reviewed-by: v1: https://lore.kernel.org/all/b5b44a0c025d0fdddd9b9d23153261363089a06a.1659204745.git.christophe.jaillet@wanadoo.fr/ Andy proposed another way to fix the issue. See the thread above. I won't be able to propose it myself. --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index 52f9ed8db9c9..4f2b82a884b9 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -1134,6 +1134,7 @@ static void intel_eth_pci_remove(struct pci_dev *pdev) stmmac_dvr_remove(&pdev->dev); + clk_disable_unprepare(priv->plat->stmmac_clk); clk_unregister_fixed_rate(priv->plat->stmmac_clk); pcim_iounmap_regions(pdev, BIT(0)); From patchwork Tue Aug 16 14:24:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 12945012 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F18BC2BB41 for ; Tue, 16 Aug 2022 14:25:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DOzZH5z9gHS/uBZpoXCrBMyJTkjSj1FjZC1PQMAQOMU=; b=rsAHFs507OzhpM 8Rtztf4oP75vV9nSBqiX7tQPTFqvCpR6MYke90rXBw6826DbcTmE8vF1ZGwIhWV5jqg9Yad1YIoSh twErLj+6gSKVe3q88k2xI38c+UyjwkhncM40mriCghGPmvgUm3kBnABSQktP3F2Mvdk9IOw3dfMwI ghTp+5gzOu1cCrokhp8Ch9wUZp/XGKoblupTTXZ5M+dFr2vakDTQ6XnSVsaV2+dZx3iIUcF+hx9jG ZFaxl43LaI/dEa78tL3eM/OTvV4ZHapbFSxYOL2IjcPlDQJDNwQQEJR16na/4taAMfM2rpvX6vOSw PqU3TrYdFHcBNRHZMEuQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNxUb-003KhN-6S; Tue, 16 Aug 2022 14:24:35 +0000 Received: from smtp01.smtpout.orange.fr ([80.12.242.123] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNxUX-003KcK-3f for linux-arm-kernel@lists.infradead.org; Tue, 16 Aug 2022 14:24:26 +0000 Received: from pop-os.home ([90.11.190.129]) by smtp.orange.fr with ESMTPA id NxUOonfIjLFqbNxUPoHQGV; Tue, 16 Aug 2022 16:24:20 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 16 Aug 2022 16:24:20 +0200 X-ME-IP: 90.11.190.129 From: Christophe JAILLET To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , Andy Shevchenko , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/2] stmmac: intel: Simplify intel_eth_pci_remove() Date: Tue, 16 Aug 2022 16:24:15 +0200 Message-Id: <2aeb1a03d07c686efd8b3e6fc8ff2d45cd7da1e8.1660659689.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220816_072425_332119_BEE06D55 X-CRM114-Status: GOOD ( 11.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There is no point to call pcim_iounmap_regions() in the remove function, this frees a managed resource that would be release by the framework anyway. Signed-off-by: Christophe JAILLET Reviewed-by: Andy Shevchenko --- Change in v2: * (no code change) * Remove the text added below the --- in v1 (see link below if needed) * Add Reviewed-by: v1: https://lore.kernel.org/all/9f82d58aa4a6c34ec3c734399a4792d3aa23297f.1659204745.git.christophe.jaillet@wanadoo.fr/ --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index 4f2b82a884b9..9af25be42401 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -1136,8 +1136,6 @@ static void intel_eth_pci_remove(struct pci_dev *pdev) clk_disable_unprepare(priv->plat->stmmac_clk); clk_unregister_fixed_rate(priv->plat->stmmac_clk); - - pcim_iounmap_regions(pdev, BIT(0)); } static int __maybe_unused intel_eth_pci_suspend(struct device *dev)