]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI: hv: Don't load the driver for baremetal root partition
authorMukesh Rathor <mrathor@linux.microsoft.com>
Thu, 3 Jul 2025 22:44:32 +0000 (15:44 -0700)
committerWei Liu <wei.liu@kernel.org>
Wed, 9 Jul 2025 23:47:07 +0000 (23:47 +0000)
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>

drivers/pci/controller/pci-hyperv.c

index ef5d655a0052c3d6586c5461592721cc767b9c14..275b23af3de29dad48490c0b3635c3bf5834eb45 100644 (file)
@@ -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;