]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
Merge branch 'pci/resource' into next
authorBjorn Helgaas <bhelgaas@google.com>
Sun, 2 Jul 2017 23:49:49 +0000 (18:49 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Sun, 2 Jul 2017 23:49:49 +0000 (18:49 -0500)
* pci/resource:
  PCI: Work around poweroff & suspend-to-RAM issue on Macbook Pro 11
  PCI: Do not disregard parent resources starting at 0x0

Conflicts:
arch/x86/pci/fixup.c

1  2 
arch/x86/pci/fixup.c
drivers/pci/pci.c

index 2259acdcede5f4112673544c1f9e046e52f9c235,20fa7c84109d5ddff278b993cd0bb9de709dba00..11e407489db0fa76f5105cbd9db4122ea87720f4
@@@ -572,17 -572,34 +572,49 @@@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_I
  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6fa0, pci_invalid_bar);
  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6fc0, pci_invalid_bar);
  
 +/*
 + * Device [1022:7808]
 + * 23. USB Wake on Connect/Disconnect with Low Speed Devices
 + * https://support.amd.com/TechDocs/46837.pdf
 + * Appendix A2
 + * https://support.amd.com/TechDocs/42413.pdf
 + */
 +static void pci_fixup_amd_ehci_pme(struct pci_dev *dev)
 +{
 +      dev_info(&dev->dev, "PME# does not work under D3, disabling it\n");
 +      dev->pme_support &= ~((PCI_PM_CAP_PME_D3 | PCI_PM_CAP_PME_D3cold)
 +              >> PCI_PM_CAP_PME_SHIFT);
 +}
 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x7808, pci_fixup_amd_ehci_pme);
++
+ /*
+  * Apple MacBook Pro: Avoid [mem 0x7fa00000-0x7fbfffff]
+  *
+  * Using the [mem 0x7fa00000-0x7fbfffff] region, e.g., by assigning it to
+  * the 00:1c.0 Root Port, causes a conflict with [io 0x1804], which is used
+  * for soft poweroff and suspend-to-RAM.
+  *
+  * As far as we know, this is related to the address space, not to the Root
+  * Port itself.  Attaching the quirk to the Root Port is a convenience, but
+  * it could probably also be a standalone DMI quirk.
+  *
+  * https://bugzilla.kernel.org/show_bug.cgi?id=103211
+  */
+ static void quirk_apple_mbp_poweroff(struct pci_dev *pdev)
+ {
+       struct device *dev = &pdev->dev;
+       struct resource *res;
+       if ((!dmi_match(DMI_PRODUCT_NAME, "MacBookPro11,4") &&
+            !dmi_match(DMI_PRODUCT_NAME, "MacBookPro11,5")) ||
+           pdev->bus->number != 0 || pdev->devfn != PCI_DEVFN(0x1c, 0))
+               return;
+       res = request_mem_region(0x7fa00000, 0x200000,
+                                "MacBook Pro poweroff workaround");
+       if (res)
+               dev_info(dev, "claimed %s %pR\n", res->name, res);
+       else
+               dev_info(dev, "can't work around MacBook Pro poweroff issue\n");
+ }
+ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x8c10, quirk_apple_mbp_poweroff);
Simple merge