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=1796302429; b=X5vdkO+6mwDT/OtGxvQpA7D+lGSnU3CkE9w62jRoF4FTXStk2la0oxX3OdSwEePd/1Kp JbaE+UaO7dlEWEU0Rkz4FrCWa1bAVP2CxuxILIEb/g6Qf/1B000JZhThvuWnDenVXaa4h sgtzs7QnTEt4H5j5zB9iDYvo86RFdtOm6GuHoAdKJq5dAGnAXWE+CSb5XKiCqKyLF8wsQ 4gOb5k6WynFPsw0Ol0267ba7c28hWJGYX7BPouRwiLifIn7Y+b8UL3VDHYqwNW0k4zCIo auX+//gdCziXpwylKzOv+ywo44KvrOku4K5SMPgwtX9RKfEoemc+xf5wY6Jv0leiGHA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796302429; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=8Wy4QUp3oAIoZc5/G0VdLdwBz3vxvk10Qz/I+WElGcc=; b=PSRVtzC+NIlaQZ/a6sfFmmdvFs1eImGhr8Jtxj61jKc/cVvCbft2QUsQmGBCUGOsiSYY tp+8wH99f6BCA0831frXwSZM5rHzHmg+FqiDQx/0/cejEDU2lmoaNEI4NsVDscKssrd1o Yk990EscYQ4GFZlydljC+UahKdJuNS9SxRQlZj+i9QmWue1HNcfPemtohoWA80pvoWkAq 5/EGGMMyDCBA1D1PZIOIis0JHcMClTahVvWh+9FZqJmIu7JoYoZdJ+qTMn/NGGOoYo89r FnT1/nmh43jHIko9tBm0eZCw1JL5CMg/lifohjT/5vudZ0jmYGwUclgTRRu4Rl2uQEg== 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=hblqedtn; 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 F3258606A322 for ; Thu, 3 Dec 2026 12:53:48 +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=hblqedtn Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3DD21F0089A; Thu, 3 Dec 2026 12:53:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796302428; bh=8Wy4QUp3oAIoZc5/G0VdLdwBz3vxvk10Qz/I+WElGcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hblqedtn1/mX9qHATb6SsTSZkl5a7NxrQHuz4C8VMGf70IDj9FBhf5NWZqXiARZvj nWIIgYkuH0hjXdx3UrcMWYt+YWL6QMRy/Z6c8fkhyTH8186r4wcX5FJnD6fg69a3Nz AKw03lLsWc+d9SSF+SadLAjbbTYimNoLXBq2vOT+pVaAAYCWCT4pUdsdZSs72Qjfmm 2gqBFqaYPcRPMGWOSoSH0wesHlO9nB7+ffLAHsK1YmvCFSUR1UWGJwihPwM9rALLm2 w1JwmJHJBPJ0+kePBAhSRVdJQoDfA69cq6oVkS/e5pwua3+7YPB8n0dm/m6h49vbVd PZvnP0+2j84kQ== From: Philipp Stanner To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Philipp Stanner Subject: [PATCH v2 3/3] PCI: Deprecate pcim_pin_device() Date: Thu, 3 Dec 2026 13:53:30 +0100 Message-ID: <20261203125328.2421736-6-phasta@kernel.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261203125328.2421736-3-phasta@kernel.org> References: <20261203125328.2421736-3-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 3e49017bb717..a96fa984b315 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