diff options
| -rw-r--r-- | drivers/pci/pci.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 8479c2e1f74f..52eb3ef0f487 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -6197,6 +6197,18 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode, cmd &= ~PCI_BRIDGE_CTL_VGA; pci_write_config_word(bridge, PCI_BRIDGE_CONTROL, cmd); + + + /* + * VGA Enable may not be writable if bridge doesn't + * support it. + */ + if (decode) { + pci_read_config_word(bridge, PCI_BRIDGE_CONTROL, + &cmd); + if (!(cmd & PCI_BRIDGE_CTL_VGA)) + return -EIO; + } } bus = bus->parent; } |
