🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25464

Re: [PATCH net] net: wwan: t7xx: Do not call pcim_enable_device() on every reinit

#25464
From: Bjorn Helgaas
Date: Tue, 01 Dec 2026 20:36
40 lines
10333 bytes
On Tue, Dec 01, 2026 at 10:45:31AM +0100, pstanner@redhat.com wrote:
> On Mon, 2026-11-30 at 18:02 -0600, Bjorn Helgaas wrote:
> > 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.
> 
> I don't think that the APIs behavior should be guarded with more checks
> (like "already enabled" checks). In the past, first the managed API was
> added, and then (for unknown reasons) counter APIs were added to revoke
> the managed actions. Look at pcim_pin_device(). IMO that makes the API
> more convoluted, inconsistent and even harder to understand.
> 
> But it's true that drivers often don't seem to understand what a
> managed interface is, proven by the fact that many of them also called
> pcim_disable_device() in their remove(), which leads the entire design
> ad absurdum.
> 
> I think what we can is to document more explicitly what functions you
> could use when and for what purpose. Especially, we should deprecate
> pcim_disable_device(), pcim_iounmap() et al.

I wonder if sashiko could be taught to look for this issue, e.g.,
maybe something in
https://github.com/sashiko-dev/sashiko/blob/main/projects/linux/prompts/maintainers/pci.md?
Technical Details
Message-ID: <20261201203608.GA477233@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-375351-linux-kernel-netdev=dewy.ru
References: <97494bf10c949bc3a6845f79aef02ca52afe945f.camel@redhat.com>

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-375351-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: Tue, 1 Dec 2026 14:36:08 -0600
Organization: Usenet Network
Message-ID: <20261201203608.GA477233@bhelgaas>
References: <97494bf10c949bc3a6845f79aef02ca52afe945f.camel@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1814537"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:tvDq3N8v5ffydJqOL09RgaltLKE= sha256:4sJ3HoT+oToOXOoZd8xmpMi3bbokK7x4i3USzEV7SJU=
	sha1:YYCQqVithSWQjfC7iS2icmyiPpA= sha256:1o4OXPyBBWU05Ey1xn778fij4v6qOVBZHWTx0vyYTmw=
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 39E6D117496; Tue,  1 Dec 2026 23:36:24 +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 ZqPJf32di9Sw;
	Tue,  1 Dec 2026 23:36:20 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-375351-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 8F05711747B; Tue,  1 Dec 2026 23:36:12 +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 07EC428D64; Tue,  1 Dec 2026 20:36:11 +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=1796157370;
	b=PHDuoM+lgOMv1n16mq1IptBEsH58v0LQqdvD/lLPG8Bl/ng0LLUV1rttXw1S3ceswbq3
	 PHJm1AgTqfiemypD+0G35S84gbo18auNYasehql/lZ/l5NVdK5fhgCG5cYEChPXRutRnU
	 u1WYpR21MbtZvLsXI57lbRawE1HvqwqDDitaYQTg8McpCLECPE9Givjoo+neLwFfKM2dj
	 rk1WFGWI3a0U5XgRTkwp5IC1Aon0I4T6TZyLB3//8V5VGCgo4fRaznY1Kdhv0dUpIA/aG
	 olewDiaNdyp1hY+BpoKAA4Q9kxnup4HmT2nyOaNWp5vuu7vnwdtob5+yJbnjkBj/F3A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796157370;
	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:Content-Transfer-Encoding:
	 In-Reply-To;
	bh=JMj85r73AvAFFzdQpMaiwVxoNvOi4Qr9u2cWuwXhzT4=;
	b=xMn3Trba6l8dW56RMuE60RvreqjRDIq22Tp1cjuzXz+/RAPQADTpk7yJyMy52ISq/0Cp
	 HG6bcPfo7piKpwOkBryTwgB2lqrFX60kVEtZlSPxeKC0aYJIcgE3IS7xc2RCTEGhPb7uA
	 9N0PReJcxpzdY1L7lKd08HaaB8OweWcLfUeQeEFWKXUxTbt5mic4rt3McRwPtVeIn+Vo0
	 x7KWZ20AXbQNmWIVwKFB+NFDt/5C5jSxEhGJxn6UqlWCuAHgnU9ba9dhHFIfuJfxvMowT
	 D6hXVkerrZ4D6PhFL4SslRkOcuv4EqiCIOu67ndzvvf9sq3Mc30nzg0isAE41Ka3qcA==
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=oB4nA1Kc;
	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 D423F606A32A;
	Tue,  1 Dec 2026 20:36:10 +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=oB4nA1Kc
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=1796157370;
	b=M2S7P4SwX5qP3TaVkANk6+0RmtoBX4AS/kprFGGb8p2oZmGlCBgg7kEaIova7zJ5eRWO
	 UBkMm3arZk679J0GmVGcwiGM8PoVz2vnfg5VH5zAYVOYYV/VrsMNbyWBdba7Hr8gyxU8t
	 Kc9y1w2WqgRWvtFyMtKBZ3wqp0Blp++EX7LAW+SRvomoZdO7dvC5fuinOf+y6w05zARsD
	 tXAeJHPnX/AnwWd9wqadacrtzaRVV7mbhRsOqPpe+WxFKxEPFO0tUYTQxSofmWOBCtS6X
	 36Ag9cOBgOxwltSivHmiw1E+hgdAu5q833Hn0/Ioa0gTIoMOHZ8HsGweFuFuu4N9AZg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796157370;
	h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID:
	 MIME-Version:Content-Type:Content-Disposition:
	 Content-Transfer-Encoding:In-Reply-To;
	bh=JMj85r73AvAFFzdQpMaiwVxoNvOi4Qr9u2cWuwXhzT4=;
	b=vYlq4Sto+z3y4r1X6ZB2LfhM4+5uckM20WaZ3K12jH7qmjyoEw5Sb/BWGEJx2viiYEV+
	 OFtkZC4wbhsLXUfGSPZF+VGALO15olwoHg4cE5mwn94/+60NON3LW1yyVsl21hty5hLco
	 KxkDAWpWWxQgYKzqTDWXXXcyVdG159vbMw+4MCSIDx44/QdleqSnXKKSGXYNRRSaaG9+m
	 do/YW5hEiPOlF3bWn1am1TySnyxGt1eFISlARJuuCaK0/rU+WXT3Zi/D7L47xaivjdUIu
	 h6rL0EwiW5a5FOrzILPgXLmmL5W9ctQG1lsZCY9AZB10fGec4rCvWekdcPGc9XElZtQ==
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=oB4nA1Kc;
	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 00138606A31A
	for <netdev@vger.kernel.org>; Tue,  1 Dec 2026 20:36:09 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DF401F00897;
	Tue,  1 Dec 2026 20:36:09 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796157369;
	bh=JMj85r73AvAFFzdQpMaiwVxoNvOi4Qr9u2cWuwXhzT4=;
	h=Date:From:To:Cc:Subject:In-Reply-To;
	b=oB4nA1KchgRo5wUGiMaRJkITKiVzVsvqicGKpBnFSDuNncRjfiAVSn3cST6uhBt89
	 3WhRT9604AbZgHCeAhkOxESADVjVraWWudg+KVDeGkpVxOzskH5gYcaSpMx3HG8Za9
	 7GQ0A0CuMjOcZNgozYg+YrKCJ4KnsWhG9ZoZgfwYcRFWIvYYtZpI431R7Dy85GBpRd
	 1MJvmigiaDS7Awif5CAS6B/goF+lsh0p0ZPa3vh3BzSvKtKKurkzbdOrATwIKzVHKS
	 3OePDUpWt3JjNB1IGQv1Bc/6J08/aPYSe+vQrc7WCbXPV0wlpg8kgEyyakoVP5vvYt
	 Q1IuJFcMWnvKg==
X-Cc: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>,
	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>,
	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: <97494bf10c949bc3a6845f79aef02ca52afe945f.camel@redhat.com>