summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMukesh Rathor <mrathor@linux.microsoft.com>2025-07-03 15:44:32 -0700
committerWei Liu <wei.liu@kernel.org>2025-07-09 23:47:07 +0000
commitf84b21da3624d9c8514db409d254a22b84fac66a (patch)
tree510e2a2b35801b8c0523679f76762de4407edfa6
parent9669ddda18fbe7f1e28cd0bfc1218e746fae6c50 (diff)
PCI: hv: Don't load the driver for baremetal root partition
The root partition only uses VMBus when running nested. When running on baremetal the Hyper-V PCI driver is not needed, so do not initialize it. Signed-off-by: Mukesh Rathor <mrathor@linux.microsoft.com> Signed-off-by: Nuno Das Neves <nunodasneves@linux.microsoft.com> Reviewed-by: Roman Kisel <romank@linux.microsoft.com> Reviewed-by: Michael Kelley <mhklinux@outlook.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://lore.kernel.org/r/1751582677-30930-2-git-send-email-nunodasneves@linux.microsoft.com Signed-off-by: Wei Liu <wei.liu@kernel.org> Message-ID: <1751582677-30930-2-git-send-email-nunodasneves@linux.microsoft.com>
-rw-r--r--drivers/pci/controller/pci-hyperv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
index ef5d655a0052..275b23af3de2 100644
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@ -4144,6 +4144,9 @@ static int __init init_hv_pci_drv(void)
if (!hv_is_hyperv_initialized())
return -ENODEV;
+ if (hv_root_partition() && !hv_nested)
+ return -ENODEV;
+
ret = hv_pci_irqchip_init();
if (ret)
return ret;