aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/dma-mapping.c
diff options
context:
space:
mode:
authorSricharan R <sricharan@codeaurora.org>2017-04-10 16:51:03 +0530
committerJoerg Roedel <jroedel@suse.de>2017-04-20 16:31:08 +0200
commit5a1bb638d5677053c7addcb228b56da6fccb5d68 (patch)
treebee3eb9c2c8c73f63b0cef60a67518b847147289 /drivers/base/dma-mapping.c
parentiommu: of: Handle IOMMU lookup failure with deferred probing or error (diff)
downloadlinux-dev-5a1bb638d5677053c7addcb228b56da6fccb5d68.tar.xz
linux-dev-5a1bb638d5677053c7addcb228b56da6fccb5d68.zip
drivers: acpi: Handle IOMMU lookup failure with deferred probing or error
This is an equivalent to the DT's handling of the iommu master's probe with deferred probing when the corrsponding iommu is not probed yet. The lack of a registered IOMMU can be caused by the lack of a driver for the IOMMU, the IOMMU device probe not having been performed yet, having been deferred, or having failed. The first case occurs when the firmware describes the bus master and IOMMU topology correctly but no device driver exists for the IOMMU yet or the device driver has not been compiled in. Return NULL, the caller will configure the device without an IOMMU. The second and third cases are handled by deferring the probe of the bus master device which will eventually get reprobed after the IOMMU. The last case is currently handled by deferring the probe of the bus master device as well. A mechanism to either configure the bus master device without an IOMMU or to fail the bus master device probe depending on whether the IOMMU is optional or mandatory would be a good enhancement. Tested-by: Hanjun Guo <hanjun.guo@linaro.org> Reviewed-by: Robin Murphy <robin.murphy@arm.com> [Lorenzo: Added fixes for dma_coherent_mask overflow, acpi_dma_configure called multiple times for same device] Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Sricharan R <sricharan@codeaurora.org> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/base/dma-mapping.c')
-rw-r--r--drivers/base/dma-mapping.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/dma-mapping.c b/drivers/base/dma-mapping.c
index 82bd45ced7ff..755a2b5354c5 100644
--- a/drivers/base/dma-mapping.c
+++ b/drivers/base/dma-mapping.c
@@ -368,7 +368,7 @@ int dma_configure(struct device *dev)
} else if (has_acpi_companion(dma_dev)) {
attr = acpi_get_dma_attr(to_acpi_device_node(dma_dev->fwnode));
if (attr != DEV_DMA_NOT_SUPPORTED)
- acpi_dma_configure(dev, attr);
+ ret = acpi_dma_configure(dev, attr);
}
if (bridge)