Skip to contentSkip to conversation

dma-debug: prevent an error message from causing runtime problems

PATCH In review Hamza Mahfooz 2 participants 2 messages Sep 10, 2021 – Sep 13, 2021 DMA mapping helpers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dma-debug: prevent an error message from causing runtime problems

For some drivers, that use the DMA API. This error message can be reached several millions of times per second, causing spam to the kernel's printk buffer and bringing the CPU usage up to 100% (so, it should be rate limited). However, since there is at least one driver that is in the mainline and suffers from the error condition, it is more useful to err_printk() here instead of just rate limiting the error message (in hopes that it will make it easier for other drivers that suffer from this issue to be spotted).

---
v2: use err_printk() and make some clarifications in the commit message.

---
 kernel/dma/debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/dma/debug.c +2 -1
index 6c90c69e5311..718a7f455df6 100644
@@ -567,7 +567,8 @@ static void add_dma_entry(struct dma_debug_entry *entry)
 		pr_err("cacheline tracking ENOMEM, dma-debug disabled\n");
 		global_disable = true;
 	} else if (rc == -EEXIST) {
-		pr_err("cacheline tracking EEXIST, overlapping mappings aren't supported\n");
+		err_printk(entry->dev, entry, "cacheline tracking EEXIST, "
+			   "overlapping mappings aren't supported\n");
 	}
 }
 
Signature · 1 line
2.33.0