Article View: linux.kernel.netdev
Article #26488Re: [PATCH net] net: stmmac: intel: Do not call pcim_enable_device() on resume
From: Bjorn Helgaas
Date: Thu, 03 Dec 2026 16:07
Date: Thu, 03 Dec 2026 16:07
63 lines
10763 bytes
10763 bytes
[+cc Vaibhav]
On Tue, Dec 01, 2026 at 11:14:13PM +0400, Arina Kharlamova via B4 Relay wrote:
> From: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
>
> 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 <arina.kharlamova@mbzuai.ac.ae>
> ---
> 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
Technical Details
Message-ID:
<20261203160717.GA811382@bhelgaas>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376741-linux-kernel-netdev=dewy.ruReferences:
<20261201-s2p-d103-v1-1-4304d05f8af8@mbzuai.ac.ae>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376741-linux-kernel-netdev=dewy.ru From: helgaas@kernel.org (Bjorn Helgaas) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net] net: stmmac: intel: Do not call pcim_enable_device() on resume Date: Thu, 3 Dec 2026 10:07:17 -0600 Organization: Usenet Network Message-ID: <20261203160717.GA811382@bhelgaas> References: <20261201-s2p-d103-v1-1-4304d05f8af8@mbzuai.ac.ae> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="2536641"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:O1oOcjB4thcVM864GaEqOKEqQds= sha256:oIyq5E61fNbwyp9qcXjTuXKwtu+Y8DcKggJMfTXHYN4= sha1:6dlOHym79cWrm7vOIx6PMOcpCDM= sha256:QvE9pyIwCVzJJsg+Vnf4vtvDVUIvbmJy8FfqDTURzgU= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 9662B1179C6; Thu, 3 Dec 2026 19:07:47 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.64 X-Spam-Status: No, score=-3.64 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tqol39BI8vEf; Thu, 3 Dec 2026 19:07:44 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-376741-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id B295911799A; Thu, 3 Dec 2026 19:07:30 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id EDE3921AC9; Thu, 3 Dec 2026 16:07:25 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796314045; b=Wek+yNY6FjTbgO82IN8RvIL8mA3ZdPSy9QWqFFN8zCXn0WvfDIEDlky468adjlPa0MTE FmBFtDopggMdGkM/1RG+Eg/k4HXuNkBOKtpCpvyBRiOZitnxc24Ou2bEdzj45kuRdna0b aYq6g6gOc4DBzVsIzqwKE0eUgzRCe4+tHt39mjYv/dMgWmJZP1VYMkIYevz0XRyYbSWM4 rXdJtNAiNqlc8pCPCjWSzAW4O2E6GT096Q6EZK7LpPYRo+uiY6rtfzffbvgGkQZCgJISO XpMluylympE38ZB6tZizaAwHAyYhvKutSGSsWKkfL+pX61ED5yWynZWCoGrQrEXugwg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796314045; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=CL4JJzLkKN97pui0XC9pm66LV9rZO1M1MR5QAS7caSQ=; b=Ut78LtClD7o3E1r1GgJoJyrGCsK+wJT+NYa2/SbKIuz+7pCqUssESQgqVoh9egMgYBtY ic4RPWygUzJKK3dkov5/h6doTc3T4TD4wa7YzPHpVpVg4AtgGYO8ptN5lEQOo0v48wG5E VUZ7mJDE9sZBZlrSaD/DU8LekDtgsbqk9sSEHXcZwvaDCsHY5pTkQGkraMVEGC6bWjUIQ UGwRJ3DXeNIhccGxQEQR2p5CC+X2QOZPCZg2Wm5sFLaXZLq9d6g1IY+DKtFPafAhPaP5Y U6nXadYvNll186DRjol7cTWF99R/aBmVJZhVoEdF9dlChIeM+PwrDg02HC0ByYJzKzw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=HKgOPmPU; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2945A606A339; Thu, 3 Dec 2026 16:07:25 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=HKgOPmPU X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796314039; b=JOEc6xMuU3PB6wVu04uJMBQRq5N1bj639FM7Ru4cB4v+v/0wCfQNgFacghwAZepQk5no 5fJQdR8iPwfzbDx99B/WS8+syiGjC1cpm2mwShYuDsMjEX0vsTy0d1y6Kw1Jb6Y3KXWs2 IcL04xkKzao5rqAp+VGUG/qif0Whg+/KS3U4k2LN6MtVvg/Gz0kGZ16ludHtHPocZQEne Y4mgx+uI448JCRlezLF2A/qeJTno0YAHlbiuguNE4SNxD58cpCVNYo5EtSTdVTUqt7GZ+ FMMlVYMdWWrcsZ2ODZdoyYKwlJJnSAqKRBkHKEWT+E1ohVTzH5vA/WCpkYu4H2ZgWRw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796314039; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=CL4JJzLkKN97pui0XC9pm66LV9rZO1M1MR5QAS7caSQ=; b=4PMUU7FwW6brnVE6dM+DyAtXzIWvouZLANhUBq9uIf6a8TY7H9gKMtEcQmijWgVhNZDM aWDRu6wlN0HIsRGrNdJDsnzI61JfJh6whEGEpdP9oE/OKqj1gWHJsL3kY284rNWZjgjC2 Xo5CaGjJH7krjnOFJ4fom61bnisRvtptn+mP95GKY+UrtXs1uFUG4tyw3IqYku1rS25EQ YV1uJ3d5fQ+ZThiWlse09wa1WUq54OWti0hZmlscMJnvtnZQAy63XYlpQnPhjRJdbYcOH zTkvB+uFH3lN3yTak6LBOHplg2UEzM43ifzDw70YtN2kNTxuieZ27qrG0Lw2m6DiY6g== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=HKgOPmPU; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44509606A322; Thu, 3 Dec 2026 16:07:18 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 991081F00893; Thu, 3 Dec 2026 16:07:18 +0000 (UTC) X-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== X-Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>, Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, Bjorn Helgaas <bhelgaas@google.com>, Krzysztof Wilczyński <kwilczynski@kernel.org>, Philipp Stanner <phasta@kernel.org>, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Vaibhav Gupta <vaibhavgupta40@gmail.com> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261201-s2p-d103-v1-1-4304d05f8af8@mbzuai.ac.ae>