diff options
| author | Robin Murphy <robin.murphy@arm.com> | 2018-07-23 18:16:11 -0400 |
|---|---|---|
| committer | Christoph Hellwig <hch@lst.de> | 2018-07-27 13:01:06 -0400 |
| commit | 6757cdae44449dec2af68cd4db0a5f9a30e66b38 (patch) | |
| tree | 261295beb90a0c9994e253dfbe46007a6c08974f | |
| parent | 03bfdc31176cbe21e456f889ccbbf67568831149 (diff) | |
ACPI/IORT: Don't set default coherent DMA mask
Now that we can track upstream DMA constraints properly with
bus_dma_mask instead of trying (and failing) to maintain it in
coherent_dma_mask, it doesn't make much sense for the firmware code to
be touching the latter at all. It's merely papering over bugs wherein a
driver has failed to call dma_set_coherent_mask() *and* the bus code has
not initialised any default value.
We don't really want to encourage more drivers coercing dma_mask so
we'll continue to fix that up if necessary, but add a warning to help
flush out any such buggy bus code that remains.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
| -rw-r--r-- | drivers/acpi/arm64/iort.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index bc51cff5505e..08f26db2da7e 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c | |||
| @@ -978,20 +978,20 @@ void iort_dma_setup(struct device *dev, u64 *dma_addr, u64 *dma_size) | |||
| 978 | int ret, msb; | 978 | int ret, msb; |
| 979 | 979 | ||
| 980 | /* | 980 | /* |
| 981 | * Set default coherent_dma_mask to 32 bit. Drivers are expected to | 981 | * If @dev is expected to be DMA-capable then the bus code that created |
| 982 | * setup the correct supported mask. | 982 | * it should have initialised its dma_mask pointer by this point. For |
| 983 | * now, we'll continue the legacy behaviour of coercing it to the | ||
| 984 | * coherent mask if not, but we'll no longer do so quietly. | ||
| 983 | */ | 985 | */ |
| 984 | if (!dev->coherent_dma_mask) | 986 | if (!dev->dma_mask) { |
| 985 | dev->coherent_dma_mask = DMA_BIT_MASK(32); | 987 | dev_warn(dev, "DMA mask not set\n"); |
| 986 | |||
| 987 | /* | ||
| 988 | * Set it to coherent_dma_mask by default if the architecture | ||
| 989 | * code has not set it. | ||
| 990 | */ | ||
| 991 | if (!dev->dma_mask) | ||
| 992 | dev->dma_mask = &dev->coherent_dma_mask; | 988 | dev->dma_mask = &dev->coherent_dma_mask; |
| 989 | } | ||
| 993 | 990 | ||
| 994 | size = max(dev->coherent_dma_mask, dev->coherent_dma_mask + 1); | 991 | if (dev->coherent_dma_mask) |
| 992 | size = max(dev->coherent_dma_mask, dev->coherent_dma_mask + 1); | ||
| 993 | else | ||
| 994 | size = 1ULL << 32; | ||
| 995 | 995 | ||
| 996 | if (dev_is_pci(dev)) { | 996 | if (dev_is_pci(dev)) { |
| 997 | ret = acpi_dma_get_range(dev, &dmaaddr, &offset, &size); | 997 | ret = acpi_dma_get_range(dev, &dmaaddr, &offset, &size); |
