From mboxrd@z Thu Jan 1 00:00:00 1970 From: m.szyprowski@samsung.com (Marek Szyprowski) Date: Tue, 15 Nov 2016 11:39:17 +0100 Subject: [PATCH] ARM: dma-mapping: preallocate DMA-debug hash tables in pure_initcall In-Reply-To: <3289056.5bg7xtivbS@wuerfel> References: <1479204295-29773-1-git-send-email-m.szyprowski@samsung.com> <3289056.5bg7xtivbS@wuerfel> Message-ID: <9470b8cc-daaf-0edc-da33-0872d9919311@samsung.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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