[PATCH] ARM: dma-mapping: preallocate DMA-debug hash tables in pure_initcall
Marek Szyprowski
m.szyprowski at samsung.com
Tue Nov 15 02:39:17 PST 2016
On 2016-11-15 11:31, Arnd Bergmann wrote:
> On Tuesday, November 15, 2016 11:04:55 AM CET Marek Szyprowski wrote:
>> fs_initcall is definitely too late to initialize DMA-debug hash tables,
>> because some drivers might get probed and use DMA mapping framework
>> already in core_initcall. Late initialization of DMA-debug results in
>> false warning about accessing memory, that was not allocated, like this
>> one:
> To ask the obvious question: what driver does DMA allocations in a
> core_initcall, and have you tried to change that first?
See the attached stack trace.
Exynos IOMMU driver does that in its domain_alloc implementation (to
allocate
first level of PTE) and I see no easy way to avoid that, as iommu
domains are
allocated very early (as well as the whole IOMMU initialization and
attaching
to the devices). Exynos IOMMU driver has to use DMA-mapping API for PTE
management, because the IOMMU controllers are not coherent with system
CPU and
there is no other way to ensure proper CPU cache management.
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
More information about the linux-arm-kernel
mailing list