]> git.proxmox.com Git - pve-kernel.git/blobdiff - patches/kernel/0003-pci-Enable-overrides-for-missing-ACS-capabilities-4..patch
import Ubuntu-5.15.0-40.43 and update patches
[pve-kernel.git] / patches / kernel / 0003-pci-Enable-overrides-for-missing-ACS-capabilities-4..patch
index f9115d3235dc0f0e99065e55e3171e8f4ed5b9c2..128b1aac4bd6573a4cb211463783b59f3ffe4008 100644 (file)
@@ -1,7 +1,7 @@
 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Mark Weiman <mark.weiman@markzz.com>
-Date: Sat, 29 Jul 2017 09:15:32 -0400
-Subject: [PATCH] pci: Enable overrides for missing ACS capabilities (4.12+)
+Date: Wed, 7 Feb 2018 16:04:03 -0500
+Subject: [PATCH] pci: Enable overrides for missing ACS capabilities (4.15)
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
@@ -48,37 +48,38 @@ capability.  Please contact me to have your devices added and save
 your customers the hassle of this boot option.
 
 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
+Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
 ---
Documentation/admin-guide/kernel-parameters.txt |   9 +++
- drivers/pci/quirks.c                            | 102 ++++++++++++++++++++++++
.../admin-guide/kernel-parameters.txt         |   9 ++
+ drivers/pci/quirks.c                          | 102 ++++++++++++++++++
  2 files changed, 111 insertions(+)
 
 diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
-index ce24cb1e8f46..0cc1d4200c24 100644
+index c73168dbb050..754fa5793a4d 100644
 --- a/Documentation/admin-guide/kernel-parameters.txt
 +++ b/Documentation/admin-guide/kernel-parameters.txt
-@@ -2938,6 +2938,15 @@
-               nomsi           [MSI] If the PCI_MSI kernel config parameter is
-                               enabled, this kernel boot option can be used to
-                               disable the use of MSI interrupts system-wide.
+@@ -3943,6 +3943,15 @@
+                               Also, it enforces the PCI Local Bus spec
+                               rule that those bits should be 0 in system reset
+                               events (useful for kexec/kdump cases).
 +              pci_acs_override =
-+                                      [PCIE] Override missing PCIe ACS support for:
++                              [PCIE] Override missing PCIe ACS support for:
 +                              downstream
 +                                      All downstream ports - full ACS capabilities
-+                              multfunction
-+                                      All multifunction devices - multifunction ACS subset
++                              multifunction
++                                      Add multifunction devices - multifunction ACS subset
 +                              id:nnnn:nnnn
-+                                      Specfic device - full ACS capabilities
++                                      Specific device - full ACS capabilities
 +                                      Specified as vid:did (vendor/device ID) in hex
                noioapicquirk   [APIC] Disable all boot interrupt quirks.
                                Safety option to keep boot IRQs enabled. This
                                should never be necessary.
 diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
-index 9dcd5ed5a05b..8882b8d38d7d 100644
+index 1c566b0cbee9..d49c54c579bb 100644
 --- a/drivers/pci/quirks.c
 +++ b/drivers/pci/quirks.c
-@@ -3694,6 +3694,107 @@ static int __init pci_apply_final_quirks(void)
+@@ -193,6 +193,106 @@ static int __init pci_apply_final_quirks(void)
+ }
  fs_initcall_sync(pci_apply_final_quirks);
  
 +static bool acs_on_downstream;
@@ -121,7 +122,6 @@ index 9dcd5ed5a05b..8882b8d38d7d 100644
 +                              goto next;
 +                      }
 +                      acs_on_ids[max_acs_id].vendor = val;
-+
 +                      p += strcspn(p, ":");
 +                      if (*p != ':') {
 +                              pr_warn("PCIe ACS invalid ID\n");
@@ -166,30 +166,31 @@ index 9dcd5ed5a05b..8882b8d38d7d 100644
 +                              return 1;
 +
 +      switch (pci_pcie_type(dev)) {
-+      case PCI_EXP_TYPE_DOWNSTREAM:
-+      case PCI_EXP_TYPE_ROOT_PORT:
-+              if (acs_on_downstream)
-+                      return 1;
-+              break;
-+      case PCI_EXP_TYPE_ENDPOINT:
-+      case PCI_EXP_TYPE_UPSTREAM:
-+      case PCI_EXP_TYPE_LEG_END:
-+      case PCI_EXP_TYPE_RC_END:
-+              if (acs_on_multifunction && dev->multifunction)
-+                      return 1;
++              case PCI_EXP_TYPE_DOWNSTREAM:
++              case PCI_EXP_TYPE_ROOT_PORT:
++                      if (acs_on_downstream)
++                              return 1;
++                      break;
++              case PCI_EXP_TYPE_ENDPOINT:
++              case PCI_EXP_TYPE_UPSTREAM:
++              case PCI_EXP_TYPE_LEG_END:
++              case PCI_EXP_TYPE_RC_END:
++                      if (acs_on_multifunction && dev->multifunction)
++                              return 1;
 +      }
 +
 +      return -ENOTTY;
 +}
 +
  /*
-  * Following are device-specific reset methods which can be used to
-  * reset a single function if other methods (e.g. FLR, PM D0->D3) are
-@@ -4536,6 +4637,7 @@ static const struct pci_dev_acs_enabled {
-       { 0x10df, 0x720, pci_quirk_mf_endpoint_acs }, /* Emulex Skyhawk-R */
-       /* Cavium ThunderX */
-       { PCI_VENDOR_ID_CAVIUM, PCI_ANY_ID, pci_quirk_cavium_acs },
+  * Decoding should be disabled for a PCI device during BAR sizing to avoid
+  * conflict. But doing so may cause problems on host bridge and perhaps other
+@@ -4927,6 +5027,8 @@ static const struct pci_dev_acs_enabled {
+       { PCI_VENDOR_ID_CAVIUM, 0xA060, pci_quirk_mf_endpoint_acs },
+       /* APM X-Gene */
+       { PCI_VENDOR_ID_AMCC, 0xE004, pci_quirk_xgene_acs },
++      /* Enable overrides for missing ACS capabilities */
 +      { PCI_ANY_ID, PCI_ANY_ID, pcie_acs_overrides },
-       { 0 }
- };
+       /* Ampere Computing */
+       { PCI_VENDOR_ID_AMPERE, 0xE005, pci_quirk_xgene_acs },
+       { PCI_VENDOR_ID_AMPERE, 0xE006, pci_quirk_xgene_acs },