Skip to content

Commit 6a9c4b3

Browse files
Rui Guodanvet
Rui Guo
authored andcommitted
drm/i915: Fix PCH detect with multiple ISA bridges in VM
In some virtualized environments (e.g. XEN), there is irrelevant ISA bridge in the system. To work reliably, we should scan trhough all the ISA bridge devices and check for the first match, instead of only checking the first one. Signed-off-by: Rui Guo <[email protected]> [danvet: Fixup conflict with the num_pch_pll removal. And add subsystem header to the commit message headline.] Signed-off-by: Daniel Vetter <[email protected]>
1 parent 73845ad commit 6a9c4b3

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

drivers/gpu/drm/i915/i915_drv.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,15 @@ void intel_detect_pch(struct drm_device *dev)
465465
* make graphics device passthrough work easy for VMM, that only
466466
* need to expose ISA bridge to let driver know the real hardware
467467
* underneath. This is a requirement from virtualization team.
468+
*
469+
* In some virtualized environments (e.g. XEN), there is irrelevant
470+
* ISA bridge in the system. To work reliably, we should scan trhough
471+
* all the ISA bridge devices and check for the first match, instead
472+
* of only checking the first one.
468473
*/
469474
pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL);
470-
if (pch) {
475+
while (pch) {
476+
struct pci_dev *curr = pch;
471477
if (pch->vendor == PCI_VENDOR_ID_INTEL) {
472478
unsigned short id;
473479
id = pch->device & INTEL_PCH_DEVICE_ID_MASK;
@@ -496,10 +502,18 @@ void intel_detect_pch(struct drm_device *dev)
496502
DRM_DEBUG_KMS("Found LynxPoint LP PCH\n");
497503
WARN_ON(!IS_HASWELL(dev));
498504
WARN_ON(!IS_ULT(dev));
505+
} else {
506+
goto check_next;
499507
}
508+
pci_dev_put(pch);
509+
break;
500510
}
501-
pci_dev_put(pch);
511+
check_next:
512+
pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, curr);
513+
pci_dev_put(curr);
502514
}
515+
if (!pch)
516+
DRM_DEBUG_KMS("No PCH found?\n");
503517
}
504518

505519
bool i915_semaphore_is_enabled(struct drm_device *dev)

0 commit comments

Comments
 (0)