Commit 9277b756 authored by Lucas De Marchi's avatar Lucas De Marchi

drm: Stop spamming log with drm_cache message

Only x86 and in some cases PPC have support added in drm_cache.c for the
clflush class of functions. However warning once is sufficient to taint
the log instead of spamming it with "Architecture has no drm_cache.c
support" every few millisecond. Switch to WARN_ONCE() so we still get
the log message, but only once, together with the warning. E.g:

	------------[ cut here ]------------
	Architecture has no drm_cache.c support
	WARNING: CPU: 80 PID: 888 at drivers/gpu/drm/drm_cache.c:139 drm_clflush_sg+0x40/0x50 [drm]
	...

v2 (Jani): use WARN_ONCE() and keep the message previously on pr_err()

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
Acked-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220131165926.3230642-2-lucas.demarchi@intel.com
parent dca384a3
...@@ -112,8 +112,7 @@ drm_clflush_pages(struct page *pages[], unsigned long num_pages) ...@@ -112,8 +112,7 @@ drm_clflush_pages(struct page *pages[], unsigned long num_pages)
kunmap_atomic(page_virtual); kunmap_atomic(page_virtual);
} }
#else #else
pr_err("Architecture has no drm_cache.c support\n"); WARN_ONCE(1, "Architecture has no drm_cache.c support\n");
WARN_ON_ONCE(1);
#endif #endif
} }
EXPORT_SYMBOL(drm_clflush_pages); EXPORT_SYMBOL(drm_clflush_pages);
...@@ -143,8 +142,7 @@ drm_clflush_sg(struct sg_table *st) ...@@ -143,8 +142,7 @@ drm_clflush_sg(struct sg_table *st)
if (wbinvd_on_all_cpus()) if (wbinvd_on_all_cpus())
pr_err("Timed out waiting for cache flush\n"); pr_err("Timed out waiting for cache flush\n");
#else #else
pr_err("Architecture has no drm_cache.c support\n"); WARN_ONCE(1, "Architecture has no drm_cache.c support\n");
WARN_ON_ONCE(1);
#endif #endif
} }
EXPORT_SYMBOL(drm_clflush_sg); EXPORT_SYMBOL(drm_clflush_sg);
...@@ -177,8 +175,7 @@ drm_clflush_virt_range(void *addr, unsigned long length) ...@@ -177,8 +175,7 @@ drm_clflush_virt_range(void *addr, unsigned long length)
if (wbinvd_on_all_cpus()) if (wbinvd_on_all_cpus())
pr_err("Timed out waiting for cache flush\n"); pr_err("Timed out waiting for cache flush\n");
#else #else
pr_err("Architecture has no drm_cache.c support\n"); WARN_ONCE(1, "Architecture has no drm_cache.c support\n");
WARN_ON_ONCE(1);
#endif #endif
} }
EXPORT_SYMBOL(drm_clflush_virt_range); EXPORT_SYMBOL(drm_clflush_virt_range);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment