Shutting down VGA emulation when it was never activated
Simon Richter
Simon.Richter at hogyros.de
Mon Mar 10 07:04:59 UTC 2025
Hi,
it seems I've been bitten by
https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1824
as well: driver startup reads from a VGA register, and falls over.
Even though I have a weird platform (POWER9), I'm not convinced this is
a porting issue, but instead an invalid assumption made by the driver
that whatever is decoding the legacy VGA ports belongs to the card that
is being initialized.
This will be wrong in a lot more cases:
- There is a BMC with VGA emulation
- There is an onboard GPU that is used as primary display
- There is more than one card
- The VGA driver has never started up
Instinctively, checking whether the Expansion ROM is enabled should
already give us a good heuristic, but that deep into the call stack
we've long since forgotten that this is a PCI device, and there is also
no interface to test whether the expansion ROM is currently enabled --
the closest thing we can do is get the ROM resource from the PCI device
struct resource *res = &pdev->resource[PCI_ROM_RESOURCE];
and look at the flags on that resource.
The other question is whether there are scenarios where we'd want to
perform this access anyway -- this seems to be some workaround for an
interrupt being repeatedly triggered after deactivating the VGA
emulation(?), so it may still be needed sometimes.
Simon
More information about the Intel-xe
mailing list