aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci/fixup.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2014-02-18 19:02:04 -0500
committerBjorn Helgaas <bhelgaas@google.com>2014-02-18 19:02:04 -0500
commit94a5f850aead02f02f350d401a43c4bf9a9fbf3a (patch)
tree14796e071834fc90e45000de3937c7ea96b054bd /arch/x86/pci/fixup.c
parentec5130ba7907a2ad30a595c7d64fd629c69d3a66 (diff)
parent1e2571a78138361f74afeb4c5df859b9536b2d8e (diff)
Merge branch 'pci/misc' into next
* pci/misc: PCI: Enable INTx if BIOS left them disabled ia64/PCI: Set IORESOURCE_ROM_SHADOW only for the default VGA device x86/PCI: Set IORESOURCE_ROM_SHADOW only for the default VGA device PCI: Update outdated comment for pcibios_bus_report_status() PCI: Cleanup per-arch list of object files PCI: cpqphp: Fix hex vs decimal typo in cpqhpc_probe() x86/PCI: Fix function definition whitespace x86/PCI: Reword comments x86/PCI: Remove unnecessary local variable initialization PCI: Remove unnecessary list_empty(&pci_pme_list) check
Diffstat (limited to 'arch/x86/pci/fixup.c')
-rw-r--r--arch/x86/pci/fixup.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index 201833f5f1bc..94ae9ae9574f 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -313,9 +313,10 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PC1, pcie_r
313 * IORESOURCE_ROM_SHADOW is used to associate the boot video 313 * IORESOURCE_ROM_SHADOW is used to associate the boot video
314 * card with this copy. On laptops this copy has to be used since 314 * card with this copy. On laptops this copy has to be used since
315 * the main ROM may be compressed or combined with another image. 315 * the main ROM may be compressed or combined with another image.
316 * See pci_map_rom() for use of this flag. IORESOURCE_ROM_SHADOW 316 * See pci_map_rom() for use of this flag. Before marking the device
317 * is marked here since the boot video device will be the only enabled 317 * with IORESOURCE_ROM_SHADOW check if a vga_default_device is already set
318 * video device at this point. 318 * by either arch cde or vga-arbitration, if so only apply the fixup to this
319 * already determined primary video card.
319 */ 320 */
320 321
321static void pci_fixup_video(struct pci_dev *pdev) 322static void pci_fixup_video(struct pci_dev *pdev)
@@ -346,12 +347,13 @@ static void pci_fixup_video(struct pci_dev *pdev)
346 } 347 }
347 bus = bus->parent; 348 bus = bus->parent;
348 } 349 }
349 pci_read_config_word(pdev, PCI_COMMAND, &config); 350 if (!vga_default_device() || pdev == vga_default_device()) {
350 if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { 351 pci_read_config_word(pdev, PCI_COMMAND, &config);
351 pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; 352 if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
352 dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); 353 pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
353 if (!vga_default_device()) 354 dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n");
354 vga_set_default_device(pdev); 355 vga_set_default_device(pdev);
356 }
355 } 357 }
356} 358}
357DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID, 359DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,