Commit c7777236 authored by Jean-Philippe Brucker's avatar Jean-Philippe Brucker Committed by Will Deacon
Browse files

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: 5ac65e8c

 ("ACPI/IORT: Support address size limit for root complexes")
Reported-by: default avatarEric Auger <>
Signed-off-by: Jean-Philippe Brucker's avatarJean-Philippe Brucker <>
Signed-off-by: Lorenzo Pieralisi's avatarLorenzo Pieralisi <>
Reviewed-by: default avatarEric Auger <>
Acked-by: Robin Murphy's avatarRobin Murphy <>
Cc: Will Deacon <>
Cc: Hanjun Guo <>
Cc: Sudeep Holla <>
Cc: Catalin Marinas <>
Cc: "Rafael J. Wysocki" <>
Signed-off-by: default avatarWill Deacon <>
parent b89d82ef
......@@ -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;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment