diff options
| author | Tony Lindgren <tony@atomide.com> | 2021-02-15 06:41:56 +0200 |
|---|---|---|
| committer | Tony Lindgren <tony@atomide.com> | 2021-02-15 06:41:56 +0200 |
| commit | 857de6fe2f86b009df620f7cdb07c262cc17070d (patch) | |
| tree | e9718ebeeef39485a51a9f8e3c8122da18c796cf /drivers/of/device.c | |
| parent | ARM: dts: am33xx: add aliases for mmc interfaces (diff) | |
| parent | ARM: OMAP2+: Fix smartreflex init regression after dropping legacy data (diff) | |
| download | linux-857de6fe2f86b009df620f7cdb07c262cc17070d.tar.gz linux-857de6fe2f86b009df620f7cdb07c262cc17070d.zip | |
Merge branch 'fixes-v5.11' into fixes
Diffstat (limited to 'drivers/of/device.c')
| -rw-r--r-- | drivers/of/device.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/of/device.c b/drivers/of/device.c index aedfaaafd3e7..1122daa8e273 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -162,9 +162,11 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, mask = DMA_BIT_MASK(ilog2(end) + 1); dev->coherent_dma_mask &= mask; *dev->dma_mask &= mask; - /* ...but only set bus limit if we found valid dma-ranges earlier */ - if (!ret) + /* ...but only set bus limit and range map if we found valid dma-ranges earlier */ + if (!ret) { dev->bus_dma_limit = end; + dev->dma_range_map = map; + } coherent = of_dma_is_coherent(np); dev_dbg(dev, "device is%sdma coherent\n", @@ -172,6 +174,9 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, iommu = of_iommu_configure(dev, np, id); if (PTR_ERR(iommu) == -EPROBE_DEFER) { + /* Don't touch range map if it wasn't set from a valid dma-ranges */ + if (!ret) + dev->dma_range_map = NULL; kfree(map); return -EPROBE_DEFER; } @@ -181,7 +186,6 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, arch_setup_dma_ops(dev, dma_start, size, iommu, coherent); - dev->dma_range_map = map; return 0; } EXPORT_SYMBOL_GPL(of_dma_configure_id); |
