Re: [PATCH] dma-debug: don't report false positives with DMA_BOUNCE_UNALIGNED_KMALLOC

From: Marek Szyprowski
Date: Fri Oct 10 2025 - 13:24:46 EST


On 10.10.2025 12:40, Catalin Marinas wrote:
> On Thu, Oct 09, 2025 at 04:15:08PM +0200, Marek Szyprowski wrote:
>> @@ -594,7 +595,9 @@ static void add_dma_entry(struct dma_debug_entry *entry, unsigned long attrs)
>> if (rc == -ENOMEM) {
>> pr_err_once("cacheline tracking ENOMEM, dma-debug disabled\n");
>> global_disable = true;
>> - } else if (rc == -EEXIST && !(attrs & DMA_ATTR_SKIP_CPU_SYNC)) {
>> + } else if (rc == -EEXIST && !(attrs & DMA_ATTR_SKIP_CPU_SYNC) &&
>> + !(IS_ENABLED(CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC) &&
>> + is_swiotlb_allocated())) {
> Maybe use is_swiotlb_active(entry->dev) instead for completeness. Either
> way:
>
> Reviewed-by: Catalin Marinas <catalin.marinas@xxxxxxx>

Thanks for suggestion. is_swiotlb_active() looks a bit more appropriate
in this context.

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland