Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:27 +0100
committerJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:37 +0100
commit2e83537aaf61449afcef4ecf7cd4431b9dee8e17 (patch)
tree4baeff7bdc08131c8e1cd179a9b27862b53cb7ba
parent36fcf65983df89c0bbe7586ff74026b5060e2f41 (diff)
ACPI/IORT: Fix rc_dma_get_range() (bnc#1012628).
-rw-r--r--patches.kernel.org/4.20.3-033-ACPI-IORT-Fix-rc_dma_get_range.patch53
-rw-r--r--series.conf1
2 files changed, 54 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.3-033-ACPI-IORT-Fix-rc_dma_get_range.patch b/patches.kernel.org/4.20.3-033-ACPI-IORT-Fix-rc_dma_get_range.patch
new file mode 100644
index 0000000000..8a09a5bd3f
--- /dev/null
+++ b/patches.kernel.org/4.20.3-033-ACPI-IORT-Fix-rc_dma_get_range.patch
@@ -0,0 +1,53 @@
+From: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
+Date: Thu, 10 Jan 2019 18:41:51 +0000
+Subject: [PATCH] ACPI/IORT: Fix rc_dma_get_range()
+References: bnc#1012628
+Patch-mainline: 4.20.3
+Git-commit: c7777236dd8f587f6a8d6800c03df318fd4d2627
+
+commit c7777236dd8f587f6a8d6800c03df318fd4d2627 upstream.
+
+When executed for a PCI_ROOT_COMPLEX type, iort_match_node_callback()
+expects the opaque pointer argument to be a PCI bus device. At the
+moment rc_dma_get_range() passes the PCI endpoint instead of the bus,
+and we've been lucky to have pci_domain_nr(ptr) return 0 instead of
+crashing. Pass the bus device to iort_scan_node().
+
+Fixes: 5ac65e8c8941 ("ACPI/IORT: Support address size limit for root complexes")
+Reported-by: Eric Auger <eric.auger@redhat.com>
+Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
+Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+Reviewed-by: Eric Auger <eric.auger@redhat.com>
+Acked-by: Robin Murphy <robin.murphy@arm.com>
+Cc: stable@vger.kernel.org
+Cc: Will Deacon <will.deacon@arm.com>
+Cc: Hanjun Guo <hanjun.guo@linaro.org>
+Cc: Sudeep Holla <sudeep.holla@arm.com>
+Cc: Catalin Marinas <catalin.marinas@arm.com>
+Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
+Signed-off-by: Will Deacon <will.deacon@arm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/acpi/arm64/iort.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
+index 70f4e80b9246..a1a22e9c0328 100644
+--- a/drivers/acpi/arm64/iort.c
++++ b/drivers/acpi/arm64/iort.c
+@@ -951,9 +951,10 @@ static int rc_dma_get_range(struct device *dev, u64 *size)
+ {
+ struct acpi_iort_node *node;
+ struct acpi_iort_root_complex *rc;
++ struct pci_bus *pbus = to_pci_dev(dev)->bus;
+
+ node = iort_scan_node(ACPI_IORT_NODE_PCI_ROOT_COMPLEX,
+- iort_match_node_callback, dev);
++ iort_match_node_callback, &pbus->dev);
+ if (!node || node->revision < 1)
+ return -ENODEV;
+
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 3b91c28645..a541c5a723 100644
--- a/series.conf
+++ b/series.conf
@@ -270,6 +270,7 @@
patches.kernel.org/4.20.3-030-mm-memcg-fix-reclaim-deadlock-with-writeback.patch
patches.kernel.org/4.20.3-031-ACPI-power-Skip-duplicate-power-resource-refer.patch
patches.kernel.org/4.20.3-032-ACPI-PMIC-xpower-Fix-TS-pin-current-source-han.patch
+ patches.kernel.org/4.20.3-033-ACPI-IORT-Fix-rc_dma_get_range.patch
########################################################
# Build fixes that apply to the vanilla kernel too.