Merge tag 'pci-v5.17-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 21 Jan 2022 07:10:46 +0000 (09:10 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 21 Jan 2022 07:10:46 +0000 (09:10 +0200)
Pull pci fix from Bjorn Helgaas:

 - Reserve "stolen memory" for integrated Intel GPU, even if it's not
   the first GPU to be enumerated (Lucas De Marchi)

* tag 'pci-v5.17-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
  x86/gpu: Reserve stolen memory for first integrated Intel GPU

1  2 
arch/x86/kernel/early-quirks.c

@@@ -515,6 -515,7 +515,7 @@@ static const struct intel_early_ops gen
        .stolen_size = gen9_stolen_size,
  };
  
+ /* Intel integrated GPUs for which we need to reserve "stolen memory" */
  static const struct pci_device_id intel_early_ids[] __initconst = {
        INTEL_I830_IDS(&i830_early_ops),
        INTEL_I845G_IDS(&i845_early_ops),
        INTEL_RKL_IDS(&gen11_early_ops),
        INTEL_ADLS_IDS(&gen11_early_ops),
        INTEL_ADLP_IDS(&gen11_early_ops),
 +      INTEL_RPLS_IDS(&gen11_early_ops),
  };
  
  struct resource intel_graphics_stolen_res __ro_after_init = DEFINE_RES_MEM(0, 0);
@@@ -592,6 -592,13 +593,13 @@@ static void __init intel_graphics_quirk
        u16 device;
        int i;
  
+       /*
+        * Reserve "stolen memory" for an integrated GPU.  If we've already
+        * found one, there's nothing to do for other (discrete) GPUs.
+        */
+       if (resource_size(&intel_graphics_stolen_res))
+               return;
        device = read_pci_config_16(num, slot, func, PCI_DEVICE_ID);
  
        for (i = 0; i < ARRAY_SIZE(intel_early_ids); i++) {
@@@ -704,7 -711,7 +712,7 @@@ static struct chipset early_qrk[] __ini
        { PCI_VENDOR_ID_INTEL, 0x3406, PCI_CLASS_BRIDGE_HOST,
          PCI_BASE_CLASS_BRIDGE, 0, intel_remapping_check },
        { PCI_VENDOR_ID_INTEL, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA, PCI_ANY_ID,
-         QFLAG_APPLY_ONCE, intel_graphics_quirks },
+         0, intel_graphics_quirks },
        /*
         * HPET on the current version of the Baytrail platform has accuracy
         * problems: it will halt in deep idle state - so we disable it.