From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C9D2606A336 for ; Thu, 3 Dec 2026 16:07:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=3Wj/4w/+; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=HKgOPmPU DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Unsubscribe-Post:List-Owner; bh=CL4JJzLkKN97pui0XC9pm66LV9rZO1M1MR5QAS7caSQ=; b=3Wj/4w/+VfWtM1BuCn6UxHz3iy Td37pdq+9pNquA83aerM83Q6XWRPilvaHQkaF81H5qZ1NjiFzHsLeHqhwTGr2a5ZuwfKORPQj4j8P vKszqJnJb3QrRIKwIb04lO+vj9XZTPUPc+B2f/1xEzcluLkG6g+h3cVOpC58x62qTusMdZST/ERUi ONtRVpspaOYNH9Qicuj1a+fyJTNIMQCspHXqkbTQ4brwv99fvPE78IKWwjewXT4Z57mXEUhhH1be2 g0yyXhZyQLalNuD5cKalpTpdGC1F8tPbx0VkbWP5XHKa+4QIiGPx8gGoOTojrRm+iE8LG3TTsNc9u R+seMrug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZ9L6-0000000FEQG-42Cr; Thu, 03 Dec 2026 16:07:20 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZ9L5-0000000FEQ8-4AYH for linux-arm-kernel@lists.infradead.org; Thu, 03 Dec 2026 16:07:20 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 1CF2460E54; Thu, 3 Dec 2026 16:07:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 991081F00893; Thu, 3 Dec 2026 16:07:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796314038; bh=CL4JJzLkKN97pui0XC9pm66LV9rZO1M1MR5QAS7caSQ=; h=Date:From:To:Cc:Subject:In-Reply-To; b=HKgOPmPU7tDtbXyMgvUE441up1HQqaZB88LR8vJ6Dhgcj1194nclFeEYBB93AGqBj 4HIC6QNl1lczrAS6x+Xz6KaYtqZF5dCeVksszfcqGQk49M9b8YKzwvRCfUav2vE1uv N8enD4mEafnwwrv26weTNlNlBdpeKUR1RNlRUP3FEts3yoLonl8JbQH5xXb3ZohkA1 HLou7CgJ8S9x0x4HpJBmXnnbqLKAzziWlp9z8yU1MbuBOclPOe7Iq+iYZKiLC295DC 83sd+QVy0xnAveOqWh29UKiNVEHn032dxQyCWzN813PNf2PCtoP3XOm0CKeL+8PF3F 0veVdkX+MN74g== Date: Thu, 3 Dec 2026 10:07:17 -0600 From: Bjorn Helgaas To: arina.kharlamova@mbzuai.ac.ae Cc: Maxime Chevallier , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Bjorn Helgaas , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Philipp Stanner , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Vaibhav Gupta Subject: Re: [PATCH net] net: stmmac: intel: Do not call pcim_enable_device() on resume Message-ID: <20261203160717.GA811382@bhelgaas> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261201-s2p-d103-v1-1-4304d05f8af8@mbzuai.ac.ae> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 [+cc Vaibhav] On Tue, Dec 01, 2026 at 11:14:13PM +0400, Arina Kharlamova via B4 Relay wrote: > From: Arina Kharlamova > > intel_eth_pci_resume() calls pcim_enable_device() although the device > is enabled in probe and intel_eth_pci_suspend() does not disable it. > Since commit 77f79ac8de0f ("PCI: Remove struct pci_devres.enabled > status bit") each call raises the enable count. Since commit > f748a07a0b64 ("PCI: Remove legacy pcim_release()") each call also adds > a pcim_disable_device() devres action. Both pile up with every > suspend and resume until the device is unbound. The call does not > touch the hardware, because the enable count is already above zero > there. > > The device stays enabled across suspend, so drop the call. > > Fixes: 77f79ac8de0f ("PCI: Remove struct pci_devres.enabled status bit") > Fixes: f748a07a0b64 ("PCI: Remove legacy pcim_release()") > Signed-off-by: Arina Kharlamova > --- > I found this while checking the other drivers that call > pcim_enable_device() again on resume, after the discussion of the t7xx > fix: > https://lore.kernel.org/all/20261201-s2p-d64-v1-1-c9147b2eedb0@mbzuai.ac.ae/ > > With the help of an AI coding assistant (Claude); I reviewed the > analysis and the fix. Not triggered at runtime. Compile-tested only, > not tested on hardware. > --- > drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c > index fcd8008545c2..d624f61a35d9 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c > @@ -1269,15 +1269,9 @@ static int intel_eth_pci_suspend(struct device *dev, void *bsp_priv) > static int intel_eth_pci_resume(struct device *dev, void *bsp_priv) > { > struct pci_dev *pdev = to_pci_dev(dev); > - int ret; > > pci_restore_state(pdev); > pci_set_power_state(pdev, PCI_D0); > - > - ret = pcim_enable_device(pdev); > - if (ret) > - return ret; > - > pci_set_master(pdev); > > return 0; This looks like another candidate for simplification. intel_eth_pci_driver already uses generic power management via stmmac_simple_pm_ops, but that ends up in intel_eth_pci_suspend() and intel_eth_pci_resume(). Both of those look like they're probably redundant and could be completely removed because the PCI core power management should take care of what they do. Bjorn