@@ -14,6 +14,15 @@ nv_printk_(struct nvkm_object *, int, const char *, ...);
#define nv_fatal(o,f,a...) nv_printk((o), FATAL, f, ##a)
#define nv_error(o,f,a...) nv_printk((o), ERROR, f, ##a)
+#define nv_error_ratelimited(o,f,a...) \
+({ \
+ static DEFINE_RATELIMIT_STATE(_rs, \
+ DEFAULT_RATELIMIT_INTERVAL, \
+ DEFAULT_RATELIMIT_BURST); \
+ \
+ if (__ratelimit(&_rs)) \
+ nv_printk((o), ERROR, f, ##a); \
+})
#define nv_warn(o,f,a...) nv_printk((o), WARN, f, ##a)
#define nv_info(o,f,a...) nv_printk((o), INFO, f, ##a)
#define nv_debug(o,f,a...) nv_printk((o), DEBUG, f, ##a)
@@ -523,7 +523,7 @@ gf100_fifo_intr_sched(struct gf100_fifo_priv *priv)
if (!en)
snprintf(enunk, sizeof(enunk), "UNK%02x", code);
- nv_error(priv, "SCHED_ERROR [ %s ]\n", en ? en->name : enunk);
+ nv_error_ratelimited(priv, "SCHED_ERROR [ %s ]\n", en ? en->name : enunk);
switch (code) {
case 0x0a:
@@ -576,7 +576,7 @@ gk104_fifo_intr_sched(struct gk104_fifo_priv *priv)
if (!en)
snprintf(enunk, sizeof(enunk), "UNK%02x", code);
- nv_error(priv, "SCHED_ERROR [ %s ]\n", en ? en->name : enunk);
+ nv_error_ratelimited(priv, "SCHED_ERROR [ %s ]\n", en ? en->name : enunk);
switch (code) {
case 0x0a:
When things go badly, the log is flooded with SCHED_ERROR messages, which is less than useful. Instead lets ratelimit these so we can still find the traces leading up to the problems. Signed-off-by: Rob Clark <robdclark@gmail.com> --- drivers/gpu/drm/nouveau/include/nvkm/core/printk.h | 9 +++++++++ drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-)