Home Home > GIT Browse > openSUSE-15.1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-05-15 11:47:34 +0200
committerTakashi Iwai <tiwai@suse.de>2019-05-15 11:47:34 +0200
commit1ae87848d545bb308a1eb62a61450d949a6ee10f (patch)
tree702eda2457529ecfe31809e4265d1223a03e144f
parent38352aa2bc499ec26563357d136b770984018bac (diff)
PCI: Init PCIe feature bits for managed host bridge alloc
(bsc#1111666).
-rw-r--r--patches.drivers/PCI-Init-PCIe-feature-bits-for-managed-host-bridge-a.patch77
-rw-r--r--series.conf1
2 files changed, 78 insertions, 0 deletions
diff --git a/patches.drivers/PCI-Init-PCIe-feature-bits-for-managed-host-bridge-a.patch b/patches.drivers/PCI-Init-PCIe-feature-bits-for-managed-host-bridge-a.patch
new file mode 100644
index 0000000000..5dc50903bf
--- /dev/null
+++ b/patches.drivers/PCI-Init-PCIe-feature-bits-for-managed-host-bridge-a.patch
@@ -0,0 +1,77 @@
+From 6302bf3ef78dd210b5ff4a922afcb7d8eff8a211 Mon Sep 17 00:00:00 2001
+From: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
+Date: Mon, 18 Mar 2019 16:07:18 +0000
+Subject: [PATCH] PCI: Init PCIe feature bits for managed host bridge alloc
+Git-commit: 6302bf3ef78dd210b5ff4a922afcb7d8eff8a211
+Patch-mainline: v5.2-rc1
+References: bsc#1111666
+
+Two functions allocate a host bridge: devm_pci_alloc_host_bridge() and
+pci_alloc_host_bridge(). At the moment, only the unmanaged one initializes
+the PCIe feature bits, which prevents from using features such as hotplug
+or AER on some systems, when booting with device tree. Make the
+initialization code common.
+
+Fixes: 02bfeb484230 ("PCI/portdrv: Simplify PCIe feature permission checking")
+Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Cc: stable@vger.kernel.org # v4.17+
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/pci/probe.c | 23 ++++++++++++++---------
+ 1 file changed, 14 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
+index 2ec0df04e0dc..012250a78da7 100644
+--- a/drivers/pci/probe.c
++++ b/drivers/pci/probe.c
+@@ -586,16 +586,9 @@ static void pci_release_host_bridge_dev(struct device *dev)
+ kfree(to_pci_host_bridge(dev));
+ }
+
+-struct pci_host_bridge *pci_alloc_host_bridge(size_t priv)
++static void pci_init_host_bridge(struct pci_host_bridge *bridge)
+ {
+- struct pci_host_bridge *bridge;
+-
+- bridge = kzalloc(sizeof(*bridge) + priv, GFP_KERNEL);
+- if (!bridge)
+- return NULL;
+-
+ INIT_LIST_HEAD(&bridge->windows);
+- bridge->dev.release = pci_release_host_bridge_dev;
+
+ /*
+ * We assume we can manage these PCIe features. Some systems may
+@@ -608,6 +601,18 @@ struct pci_host_bridge *pci_alloc_host_bridge(size_t priv)
+ bridge->native_shpc_hotplug = 1;
+ bridge->native_pme = 1;
+ bridge->native_ltr = 1;
++}
++
++struct pci_host_bridge *pci_alloc_host_bridge(size_t priv)
++{
++ struct pci_host_bridge *bridge;
++
++ bridge = kzalloc(sizeof(*bridge) + priv, GFP_KERNEL);
++ if (!bridge)
++ return NULL;
++
++ pci_init_host_bridge(bridge);
++ bridge->dev.release = pci_release_host_bridge_dev;
+
+ return bridge;
+ }
+@@ -622,7 +627,7 @@ struct pci_host_bridge *devm_pci_alloc_host_bridge(struct device *dev,
+ if (!bridge)
+ return NULL;
+
+- INIT_LIST_HEAD(&bridge->windows);
++ pci_init_host_bridge(bridge);
+ bridge->dev.release = devm_pci_release_host_bridge_dev;
+
+ return bridge;
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index e23bfde570..eac33ad071 100644
--- a/series.conf
+++ b/series.conf
@@ -45678,6 +45678,7 @@
patches.drivers/ALSA-hda-realtek-Support-low-power-consumption-for-A.patch
patches.drivers/ALSA-hda-realtek-Support-low-power-consumption-ALC256.patch
patches.fixes/overflow-Fix-Wtype-limits-compilation-warnings.patch
+ patches.drivers/PCI-Init-PCIe-feature-bits-for-managed-host-bridge-a.patch
# davem/net-next
patches.drivers/ibmvnic-Report-actual-backing-device-speed-and-duple.patch