Article View: linux.kernel.netdev
Article #24858Re: [PATCH net] net: wwan: t7xx: Do not call pcim_enable_device() on every reinit
From: Bjorn Helgaas
Date: Tue, 01 Dec 2026 00:02
Date: Tue, 01 Dec 2026 00:02
57 lines
10281 bytes
10281 bytes
On Tue, Dec 01, 2026 at 02:56:31AM +0400, Arina Kharlamova wrote:
> t7xx_pcie_reinit() runs on resume from L2 or L3 and on every reprobe
> after a modem reset. It calls pcim_enable_device(), which did nothing
> for an already enabled managed device until commit 77f79ac8de0f
> ("PCI: Remove struct pci_devres.enabled status bit"). Since then each
> call raises the enable count. Since commit f748a07a0b64 ("PCI: Remove
> legacy pcim_release()") each call also registers a new
> pcim_disable_device() devres action, and the actions pile up until the
> device is unbound.
>
> The device is enabled once in t7xx_pci_probe() and the driver never
> disables it, so drop the call from the reinit path.
This and the loongson/lsdc issue
(https://lore.kernel.org/all/20261201-s2p-d60-v1-1-d88cf22132ab@mbzuai.ac.ae)
seem like basically the same issue, so I wonder if the pcim API could
be improved to avoid it. It seems a bit subtle and like something
driver authors are likely to trip over.
> 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>
> ---
> Found by checks derived from the spec2patch kernel API specifications,
> with the help of an AI coding assistant (Claude); I reviewed the
> analysis and the fix.
> ---
> drivers/net/wwan/t7xx/t7xx_pci.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/net/wwan/t7xx/t7xx_pci.c b/drivers/net/wwan/t7xx/t7xx_pci.c
> index c51c3b267186..47593e759238 100644
> --- a/drivers/net/wwan/t7xx/t7xx_pci.c
> +++ b/drivers/net/wwan/t7xx/t7xx_pci.c
> @@ -496,12 +496,6 @@ static void t7xx_pcie_interrupt_reinit(struct t7xx_pci_dev *t7xx_dev)
>
> static int t7xx_pcie_reinit(struct t7xx_pci_dev *t7xx_dev, bool is_d3)
> {
> - int ret;
> -
> - ret = pcim_enable_device(t7xx_dev->pdev);
> - if (ret)
> - return ret;
> -
> t7xx_pcie_mac_atr_init(t7xx_dev);
> t7xx_pcie_interrupt_reinit(t7xx_dev);
>
>
> ---
> base-commit: 25faec9ce61c01fb45abf812a222c5b43c3cd5c5
> change-id: 20261129-s2p-d64-e315656e3f12
>
> Best regards,
> --
> Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
>
Technical Details
Message-ID:
<20261201000233.GA399004@bhelgaas>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374544-linux-kernel-netdev=dewy.ruReferences:
<20261201-s2p-d64-v1-1-c9147b2eedb0@mbzuai.ac.ae>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374544-linux-kernel-netdev=dewy.ru From: helgaas@kernel.org (Bjorn Helgaas) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net] net: wwan: t7xx: Do not call pcim_enable_device() on every reinit Date: Mon, 30 Nov 2026 18:02:33 -0600 Organization: Usenet Network Message-ID: <20261201000233.GA399004@bhelgaas> References: <20261201-s2p-d64-v1-1-c9147b2eedb0@mbzuai.ac.ae> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="1571142"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:uSC/v9G04Ps48E+UvTIeRCQ4aT8= sha256:+bFM+nJ8OyVpNZmigohSdt0G18OpRdR0PSprUAv0sHw= sha1:64lSIw+mkDpmKLgs4GaHJq17I5o= sha256:NFrYs5nxraQQliZvw1/ovKkXOjEvx5cnAxsywId63+U= 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 BDB8A126013; Tue, 1 Dec 2026 03:02:52 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, 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 5dAJ2gVzioTK; Tue, 1 Dec 2026 03:02:49 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374544-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id D111012600C; Tue, 1 Dec 2026 03:02:39 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 8132228E2D; Tue, 1 Dec 2026 00:02:36 +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=1796083356; b=36gK4EryBvbYGkDdi8Et2smrxCVlSwG9HeqjpCChxbEhNReXsvOs9H4DAXiAW+i2h53E R8c0x3WefSlRf0Boa2jsRjgHMQLDL24LL45sZQXva8dnoF3gaLWgUI7IbRxllWhWGD6Q9 iKzSyTJT/BWrOjgcZeCLSg6I+6dLZGp/qHy20lTAF9BKGbG/C4u7qDozeujZ2h/NPuEN/ CRHQuMMUT4tNeA62pdyM2hc74fzr+oh4gPfng0E4pKvRyYgfq1dl4XoYS22TkYrfkZUoM 8Ov75CYhkVj/Rks2kG4cCF5qgn77od6dX13wP3W+zjwwWPJ8/qd2JBz4pf3KfWOL4mg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796083356; 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=CGpN1Kuo1/wRSIre3T/QvHy07qfurxmtBPGr9Xd3JBg=; b=2Ehgh9Zz+g6lVIg7jpx9SDxU7NJpRm0SeD7ifOq/ozQ4hB4uceVM8f50M2XcglS/NiWN gWSww11E9dVvD+g6BKhp6dkADEO2VDh7aTdq1PDB4GPuNqGFh+cqoqZpnUCGFhmw4JgR3 xmN1weIi9FXJhJxA6D9NVaudXR+mp13rBhIp/avJmqK08Y2i29yhHNZGiRCkHsWkCo8I0 aofK9s7zGsP4ZRYn7p8SQpn/PY71UW0Q/YWf9+dc4CMTD5y9yHZWHL2jbRHoDJLeJp6KV FsN31H3abHAgjgBVxWXmeDkJ4mNVU5gsrNJsDzT/J9a7T0NFtGc48F4fjWfB6wftjGw== 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=XaHl6mxD; 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 437CE606A32C; Tue, 1 Dec 2026 00:02:36 +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=XaHl6mxD 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=1796083355; b=ZTaj7gW5U29bEmkMxsqIvXYlsXbu9zwnslGe0vPD0HPfV9eZqRqVXRJdicIVS2GNG9N4 dILJVMzoYCAntIOE0q6MvEcV9ECjxM1k6pvaf5ApkRCyM+REn+LS2NEae6vpZQvhyXgd5 ZVfAlNPAt+CNTd2O0wjn+YkSG+g0G4uMSdXvjfUPWsJ8vEeiHZ2DTIDQP3NV9UXHJX8ME Mbum7oVhXowDlMiTWRnOW//V4S5okrYopvLlx6KdKNiEL5uqEnZmxL+BYc/sO1nC/w3nG SeOGA12ZfVE6q42MNg3OrNMVOwo+W9lHV80vaCVX6aD5UUBbo0yWYIT+zYgeDRqX/rA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796083355; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=CGpN1Kuo1/wRSIre3T/QvHy07qfurxmtBPGr9Xd3JBg=; b=5jFaaU2X3D553f4SzpQZrhfInE2CCKzDstp9UkYifTKx2/lzr2LWr4whCDNEnj/mOn53 wsaptWI5yR/43Zl/x4P23WSr76+vC2pjDde6t4N6FiGuPrQL3yFjO0cIb/Z5IGXP+Yp/B 9mcUS8grpbzkIx/YnfqUUBZ+TQdFxcnBn/iapk1KH5SPwNHfkxxSyLZB8EOMp7hVgXrOR zN9BwaZwmP3Grb+NU20TXlHjMLK7dFXBKynOGmByzudBxf21RwSa2mA5nEFSmx7yrl2uh 7w+zu99b8Py2d40Tlm5g3Ft1N6XB5E+lUmjnkQkK3IOPWAue+TUJZRGEY6igQHyiBUA== 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=XaHl6mxD; 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 5F485606A31A for <netdev@vger.kernel.org>; Tue, 1 Dec 2026 00:02:35 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 668371F00919; Tue, 1 Dec 2026 00:02:34 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796083354; bh=CGpN1Kuo1/wRSIre3T/QvHy07qfurxmtBPGr9Xd3JBg=; h=Date:From:To:Cc:Subject:In-Reply-To; b=XaHl6mxD/LwnXNEMxTxp3AI8/H5KAibnxQMCjCUIOUijS0Geo6lZs25UkkJVuNkpU 8skMTdvHBJgjok1W/lf4NfBSwnnGJL/+BP3GAJdd52m8OcExTnKQgsAjmwFPIab4BU 6EgADGphdshlo6du44SCeP2G9BEkCo9cmDroycSRPoH7FXgpa8+oHRLTX9PcDa1CQs NMXZ1htSy+OyRvragzetUUdC4H5epdHGYR0pltuCoq38UDcwbpF7q4FE+cbgdUOJqa QrUN+YNIWj5HBKdUYuogcWsAVNiQ7mrU+kKYZKZ93DosPxYBSqaHPCtCy4S3lVOnqv qo5uW55MiN7kA== X-Cc: Chandrashekar Devegowda <chandrashekar.devegowda@intel.com>, Liu Haijun <haijun.liu@mediatek.com>, Ricardo Martinez <ricardo.martinez@linux.intel.com>, Loic Poulain <loic.poulain@oss.qualcomm.com>, Sergey Ryazanov <ryazanov.s.a@gmail.com>, Johannes Berg <johannes@sipsolutions.net>, 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>, Philipp Stanner <pstanner@redhat.com>, Krzysztof Wilczyński <kwilczynski@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>, netdev@vger.kernel.org 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-d64-v1-1-c9147b2eedb0@mbzuai.ac.ae>