Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH] PCI: Allow untainted driver_override for PCI stub drivers
       [not found] <DMYH4ED3GWDO.29DGXPK4M82VR@kernel.org>
@ 2026-11-18 23:56 ` Alex Williamson
  2026-11-19  0:03   ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Williamson @ 2026-11-18 23:56 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Alex Williamson, Greg Kroah-Hartman, Jonathan Corbet, Shuah Khan,
	Randy Dunlap, Rafael J . Wysocki, Danilo Krummrich, Johan Hovold,
	Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers,
	David Lechner, Armin Wolf, Thierry Reding, Mike Rapoport,
	Arnd Bergmann, Karl Mehltretter, Paul E . McKenney,
	Borislav Petkov, Dapeng Mi, Marco Elver, Ethan Nelson-Moore,
	Jeff Layton, Bradley Morgan, Andrew Morton, Petr Mladek,
	Pnina Feder, Mete Durlu, Aaron Tomlin, Rio, Feng Tang, linux-doc,
	linux-kernel, driver-core, linux-trace-kernel, Mark Brown,
	Bjorn Helgaas, linux-pci

As the name suggests, the pci-stub driver is only a stub, it performs
no hardware access and is typically used only to prevent other drivers
from binding to the device.

Similarly, pci-pf-stub only interacts with devices through the SR-IOV
capability, and may be used to create VFs on any PF that otherwise does
not require a PF driver.

Both of these are often used with driver_override, as this is our
standard, non-racy mechanism for associating a driver to a device.
With the introduction of support_driver_override in driver core, this
use case needs to be explicitly flagged as safe or else the bind will
be denied or taint the kernel.  Declare these drivers as safe for use
with driver_override.

Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Alex Williamson <alex@shazbot.org>
---

Uwe, both these PCI stub drivers should allow driver_override use cases.
Thanks,

Alex

 drivers/pci/pci-pf-stub.c | 1 +
 drivers/pci/pci-stub.c    | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/pci/pci-pf-stub.c b/drivers/pci/pci-pf-stub.c
index da4db4928907..328fb4a57092 100644
--- a/drivers/pci/pci-pf-stub.c
+++ b/drivers/pci/pci-pf-stub.c
@@ -36,6 +36,7 @@ static struct pci_driver pf_stub_driver = {
 	.id_table		= pci_pf_stub_whitelist,
 	.probe			= pci_pf_stub_probe,
 	.sriov_configure	= pci_sriov_configure_simple,
+	.driver.support_driver_override = true,
 };
 module_pci_driver(pf_stub_driver);
 
diff --git a/drivers/pci/pci-stub.c b/drivers/pci/pci-stub.c
index 9bc478df4e8f..acbd43c17adc 100644
--- a/drivers/pci/pci-stub.c
+++ b/drivers/pci/pci-stub.c
@@ -37,6 +37,7 @@ static struct pci_driver stub_driver = {
 	.id_table	= NULL,	/* only dynamic id's */
 	.probe		= pci_stub_probe,
 	.driver_managed_dma = true,
+	.driver.support_driver_override = true,
 };
 
 static int __init pci_stub_init(void)
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] PCI: Allow untainted driver_override for PCI stub drivers
  2026-11-18 23:56 ` [PATCH] PCI: Allow untainted driver_override for PCI stub drivers Alex Williamson
@ 2026-11-19  0:03   ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-19  0:03 UTC (permalink / raw)
  To: Alex Williamson; +Cc: linux-trace-kernel, linux-pci

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] PCI: build failure due to missing support_driver_override in
  device_driver
--

commit 6d515d8bf97cee4e2be39125c16fa6391240af86
Author: Alex Williamson <alex@shazbot.org>

PCI: Allow untainted driver_override for PCI stub drivers

This commit sets .driver.support_driver_override = true on pf_stub_driver and
stub_driver to declare them safe for driver_override bindings.

> diff --git a/drivers/pci/pci-pf-stub.c b/drivers/pci/pci-pf-stub.c
> index da4db4928907e..328fb4a57092c 100644
> --- a/drivers/pci/pci-pf-stub.c
> +++ b/drivers/pci/pci-pf-stub.c
> @@ -36,6 +36,7 @@ static struct pci_driver pf_stub_driver = {
>  	.id_table		= pci_pf_stub_whitelist,
>  	.probe			= pci_pf_stub_probe,
>  	.sriov_configure	= pci_sriov_configure_simple,
> +	.driver.support_driver_override = true,
>  };
>  module_pci_driver(pf_stub_driver);
>  
> diff --git a/drivers/pci/pci-stub.c b/drivers/pci/pci-stub.c
> index 9bc478df4e8f0..acbd43c17adc7 100644
> --- a/drivers/pci/pci-stub.c
> +++ b/drivers/pci/pci-stub.c
> @@ -37,6 +37,7 @@ static struct pci_driver stub_driver = {
>  	.id_table	= NULL,	/* only dynamic id's */
>  	.probe		= pci_stub_probe,
>  	.driver_managed_dma = true,
> +	.driver.support_driver_override = true,
>  };
>  
>  static int __init pci_stub_init(void)

[Severity: High]
Does this fail to build when CONFIG_PCI_PF_STUB or CONFIG_PCI_STUB is
enabled?  struct device_driver in include/linux/device/driver.h has no
support_driver_override member in this tree, as the prerequisite driver-core
patch introducing it is missing.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118235645.2907908-1-alex@shazbot.org?part=1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-19  0:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <DMYH4ED3GWDO.29DGXPK4M82VR@kernel.org>
2026-11-18 23:56 ` [PATCH] PCI: Allow untainted driver_override for PCI stub drivers Alex Williamson
2026-11-19  0:03   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox