diff options
| author | Breno Leitao <leitao@debian.org> | 2025-12-22 07:28:55 -0800 |
|---|---|---|
| committer | Will Deacon <will@kernel.org> | 2026-01-22 11:20:29 +0000 |
| commit | 53f45f045cbe89024d2b71c145c782bb6a82a602 (patch) | |
| tree | 22177be51c97c8da40df5b73bed6c0fa43c5d480 | |
| parent | f22c81bebf8bda6e54dc132df0ed54f6bf8756f9 (diff) | |
arm64: mm: warn once for ioremap attempts on RAM mappings
Replace WARN_ON with WARN_ONCE when detecting attempts to ioremap
RAM. This prevents log spam when a misbehaving driver repeatedly tries
to map RAM via ioremap.
A single warning is more than enough to show the broken code path, and
extra reports don't add extra information.
Warning floods have been seen in production environments where broken
external drivers hit this code path thousand of times, causing
unnecessary messages to be printed and pressure on the serial console.
Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
| -rw-r--r-- | arch/arm64/mm/ioremap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm64/mm/ioremap.c b/arch/arm64/mm/ioremap.c index 10e246f11271..b12cbed9b5ad 100644 --- a/arch/arm64/mm/ioremap.c +++ b/arch/arm64/mm/ioremap.c @@ -24,7 +24,8 @@ void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size, return NULL; /* Don't allow RAM to be mapped. */ - if (WARN_ON(pfn_is_map_memory(__phys_to_pfn(phys_addr)))) + if (WARN_ONCE(pfn_is_map_memory(__phys_to_pfn(phys_addr)), + "ioremap attempted on RAM pfn\n")) return NULL; /* |
