From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796128227; b=WjLsfC2Xn9rwC77uG6ILB15ZUjnG1xmTuBVegdcQ/20MzXAQ4vXUIPDcQ9PjUaPGnapi tj62noE+m6cXKv+ERFcz0pr4arF60PKRyrMX6ojl0Us+U/OLuBBjb8ntoTYML/MQ55k7q G+CTUL3O+gJIVLg4GOjT7lCnqdbTr66OYBWFmQoHrCIYFBZ0yM+fIKqKq9cnIaGcwNSR/ VTuZYjNtV2oNEbIG22JhoZbOwPqFZLCDbZy43qNdmQJYyJm0omBaORHgcCfBE1PT1AocF iZObnACs1vVhbHvuEpG1qwWZksGOt645+ty5o6Bb05M5kKKo28QWCX3xw3YaeSV9sgA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796128227; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=8ZG81G6pMp46fuVpzLPWd5h9rReZmfbdKKyHZgOB4rE=; b=O2W/byYSxOclQh2r5nduG9CprapbYCbwRmGhIGmB0Hzv4lQpfRjH31vjbX49HCp+lJvl UBAn8TGUsH4cm1E+oNa90AEeRKVxKvPfbUacqj00XsyM/YIDsXC7MzJMBbRMMw86jMwNl xqKoTGHx4Arg+tEbuSIC4TJx54ZVYnb07HMmv/UuEveDvs/3MQRuj9+VYYsHZl9ZW7A/Y kXB3gZYRve8PUMjkxH/ecK3RX5yLHsYpFavvfp857IY0NnauoGC1Gt6OI2ObJpcweGX+8 2zIvfiqty40Xz9F+5j9XjPJMpCyOYFRSvXMqfle6p4ti4w2LhJy9yY6fQRXBe23b42Q== 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=GaHZNhot; arc=none smtp.remote-ip=100.103.45.18 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 97AD3606A331 for ; Tue, 1 Dec 2026 12:30:27 +0000 (UTC) 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=GaHZNhot Received: by smtp.kernel.org (Postfix) with ESMTPSA id 631911F00898; Tue, 1 Dec 2026 12:30:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796128227; bh=8ZG81G6pMp46fuVpzLPWd5h9rReZmfbdKKyHZgOB4rE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GaHZNhotpdiEDzi2xB9GbTiq/YPyQqCzFMH51+zRqiJzPX7XNgx49ktGWpAACbCVw IOcYB8iQN+Rm1mw2PILYZA2cAn/o1phCPDnk2D5rwJ+sacMhTkQYzZiV0stgXkC8af OXziJr4fK0arzcmr+KIa8x7QwUxhPsKWYCdM//iAHaJb+bDoKHpsUWl67h8Hvao2Se z1Z8c2lS6yOk/cWTKubnBfXPSjaHlT76nf4t8drpFCBLN7yY1F1rNH/yjOUtSYry7w ndWzkLLtb/PqxMPzHbo1pP1nPaegtBcY9EYxmePfBw+Nnc3sIPAuxqMn+U/CutZbrT 0erBX5j8VcRUw== From: Philipp Stanner To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Philipp Stanner Subject: [PATCH 3/3] PCI: Deprecate pcim_pin_device() Date: Tue, 1 Dec 2026 13:29:52 +0100 Message-ID: <20261201122951.904104-5-phasta@kernel.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261201122951.904104-2-phasta@kernel.org> References: <20261201122951.904104-2-phasta@kernel.org> X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit pcim_pin_device() reverts the action set up by pcim_enable_device(), namely that the device gets disabled on driver unload. This makes the PCI devres API inconsistent and confusing. Who does not want automatic disablement of the device, should not use a function that sets up automatic disablement. In other words, whoever needs pcim_pin_device() just should use pci_enable_device() over pcim_enable_device(). Mark pcim_pin_device() as deprecated. Signed-off-by: Philipp Stanner --- drivers/pci/devres.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c index afc7e966bb32..b6e81ee72943 100644 --- a/drivers/pci/devres.c +++ b/drivers/pci/devres.c @@ -397,11 +397,15 @@ int pcim_enable_device(struct pci_dev *pdev) EXPORT_SYMBOL(pcim_enable_device); /** - * pcim_pin_device - Pin managed PCI device + * pcim_pin_device - Pin managed PCI device (DEPRECATED) * @pdev: PCI device to pin * * Pin managed PCI device @pdev. Pinned device won't be disabled on driver * detach. @pdev must have been enabled with pcim_enable_device(). + * + * This function is deprecated and should be removed. If you're ever in a + * position where it seems useful, you should manage your device enablement + * fully manually, with pci_enable_device() and pci_disable_device(). */ void pcim_pin_device(struct pci_dev *pdev) { -- 2.56.0