]> git.ipfire.org Git - thirdparty/linux.git/commit
PCI/VGA: Fail pci_set_vga_state() if VGA decoding not supported
authorSimon Richter <Simon.Richter@hogyros.de>
Sat, 7 Mar 2026 17:35:37 +0000 (02:35 +0900)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 30 Mar 2026 15:44:50 +0000 (10:44 -0500)
commit5b6471fc72a42e6110adca54f46fd2c287dc49d4
tree2286668f9eb3c4fffdb47e0c61f520cff66e50a2
parent94555ea9a0488c5c1bba90242cfa149a84a8928d
PCI/VGA: Fail pci_set_vga_state() if VGA decoding not supported

PCI bridges are allowed to refuse activating VGA decoding, by simply
ignoring attempts to set the bit that enables it, so after setting the bit,
read it back to verify.

One example of such a bridge is the root bridge in IBM PowerNV, but this is
also useful for GPU passthrough into virtual machines, where it is
difficult to set up routing for legacy IO through IOMMU.

Signed-off-by: Simon Richter <Simon.Richter@hogyros.de>
[bhelgaas: subject, add comment about VGA Enable writability]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260307173538.763188-5-Simon.Richter@hogyros.de
drivers/pci/pci.c