PCI: Mark shadow copy of VGA ROM as IORESOURCE_PCI_FIXED
authorBjorn Helgaas <bhelgaas@google.com>
Tue, 1 Mar 2016 17:32:29 +0000 (11:32 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 8 Mar 2016 18:14:31 +0000 (12:14 -0600)
A shadow copy of an option ROM is placed by the BIOS as a fixed address.
Set IORESOURCE_PCI_FIXED to indicate that we can't move the shadow copy.
This prevents warnings like the following when we assign resources:

  BAR 6: [??? 0x00000000 flags 0x2] has bogus alignment

This warning is emitted by pdev_sort_resources(), which already ignores
IORESOURCE_PCI_FIXED resources.

Link: http://lkml.kernel.org/r/CA+55aFyVMfTBB0oz_yx8+eQOEJnzGtCsYSj9QuhEpdZ9BHdq5A@mail.gmail.com
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
arch/ia64/pci/fixup.c
arch/x86/pci/fixup.c

index fc505d58f078ecfb55210cd3e802ed23c4b41a8e..fd9ceff2b5a5109122ef36f905d2210f7e910fb9 100644 (file)
@@ -61,7 +61,8 @@ static void pci_fixup_video(struct pci_dev *pdev)
        if (!vga_default_device() || pdev == vga_default_device()) {
                pci_read_config_word(pdev, PCI_COMMAND, &config);
                if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
-                       pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
+                       pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW |
+                               IORESOURCE_PCI_FIXED;
                        dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n");
                }
        }
index 0ae7e9fa348dfaf04de014e4e5c17b13b8c8e0b1..dac027c1adb194c4eebf2e494bf9090c43920373 100644 (file)
@@ -336,7 +336,8 @@ static void pci_fixup_video(struct pci_dev *pdev)
        if (!vga_default_device() || pdev == vga_default_device()) {
                pci_read_config_word(pdev, PCI_COMMAND, &config);
                if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
-                       pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
+                       pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW |
+                               IORESOURCE_PCI_FIXED;
                        dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n");
                }
        }