diff options
author | Jean-Philippe Brucker <jean-philippe.brucker@arm.com> | 2019-01-10 18:41:51 +0000 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2019-01-11 10:02:59 +0000 |
commit | c7777236dd8f587f6a8d6800c03df318fd4d2627 (patch) | |
tree | 899581bf6239c72d86a0f14f98c7843fda398907 /drivers/acpi/arm64 | |
parent | b89d82ef01b33bc50cbaa8ff05607879b40d0704 (diff) | |
download | linux-stable-c7777236dd8f587f6a8d6800c03df318fd4d2627.tar.gz linux-stable-c7777236dd8f587f6a8d6800c03df318fd4d2627.tar.bz2 linux-stable-c7777236dd8f587f6a8d6800c03df318fd4d2627.zip |
ACPI/IORT: Fix rc_dma_get_range()
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>
Diffstat (limited to 'drivers/acpi/arm64')
-rw-r--r-- | drivers/acpi/arm64/iort.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index 5d29783ee5bd..e48894e002ba 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c @@ -952,9 +952,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; |