Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vfio/pci: Bypass IGD init in case of -ENODEV

Bypass the IGD initialization when -ENODEV returns,
that should be the case if opregion is not available for IGD
or within discrete graphics device's option ROM,
or host/lpc bridge is not found.

Then use of -ENODEV here means no special device resources found
which needs special care for VFIO, but we still allow other normal
device resource access.

Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: Xiong Zhang <xiong.y.zhang@intel.com>
Cc: Hang Yuan <hang.yuan@linux.intel.com>
Cc: Stuart Summers <stuart.summers@intel.com>
Signed-off-by: Fred Gao <fred.gao@intel.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>

authored by

Fred Gao and committed by
Alex Williamson
e4eccb85 bb742ad0

+1 -1
+1 -1
drivers/vfio/pci/vfio_pci.c
··· 385 385 pdev->vendor == PCI_VENDOR_ID_INTEL && 386 386 IS_ENABLED(CONFIG_VFIO_PCI_IGD)) { 387 387 ret = vfio_pci_igd_init(vdev); 388 - if (ret) { 388 + if (ret && ret != -ENODEV) { 389 389 pci_warn(pdev, "Failed to setup Intel IGD regions\n"); 390 390 goto disable_exit; 391 391 }