LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v2] dma-debug: prevent an error message from causing runtime problems
@ 2021-09-10 23:53 Hamza Mahfooz
  2021-09-13 16:30 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Hamza Mahfooz @ 2021-09-10 23:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: Hamza Mahfooz, Jeremy Linton, Christoph Hellwig,
	Marek Szyprowski, Robin Murphy, iommu

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).

Link: https://lkml.kernel.org/r/fd67fbac-64bf-f0ea-01e1-5938ccfab9d0@arm.com
Reported-by: Jeremy Linton <jeremy.linton@arm.com>
Signed-off-by: Hamza Mahfooz <someguy@effective-light.com>
---
v2: use err_printk() and make some clarifications in the commit message.
---
 kernel/dma/debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c
index 6c90c69e5311..718a7f455df6 100644
--- a/kernel/dma/debug.c
+++ b/kernel/dma/debug.c
@@ -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");
 	}
 }
 
-- 
2.33.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-13 16:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10 23:53 [PATCH v2] dma-debug: prevent an error message from causing runtime problems Hamza Mahfooz
2021-09-13 16:30 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).