From 1f28443889a17d4c3a40e4931ec55437664a8351 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Fri, 22 May 2020 14:13:05 -0500 Subject: [PATCH] gpu: nvgpu: Disable platform debug spew by default Disable the somewhat non-useful syncpoint debug spew in the nvgpu debug spew. The GPU has it's own snapshot view of syncpoints so visibility into other syncpoint data is often not very helpful. However, there are plausibly times where this would be necessary. For example debugging a sync issue between the GPU and some other SoC engine. Therefore, the syncpoint debug spew can be enabled again at runtime if necessary. JIRA NVGPU-5541 Change-Id: I7028e2d6027e41835b2fed4f2bbb366c16b99967 Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2349185 Tested-by: mobile promotions Reviewed-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/debug.c | 7 +++++-- drivers/gpu/nvgpu/os/linux/os_linux.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/os/linux/debug.c b/drivers/gpu/nvgpu/os/linux/debug.c index 559e534ec..de7bd2ced 100644 --- a/drivers/gpu/nvgpu/os/linux/debug.c +++ b/drivers/gpu/nvgpu/os/linux/debug.c @@ -113,6 +113,7 @@ static int gk20a_gr_debug_show(struct seq_file *s, void *unused) void gk20a_debug_dump(struct gk20a *g) { struct gk20a_platform *platform = gk20a_get_platform(dev_from_gk20a(g)); + struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); struct nvgpu_debug_context o = { .fn = gk20a_debug_write_printk, .ctx = g, @@ -122,7 +123,7 @@ void gk20a_debug_dump(struct gk20a *g) if (g->ops.debug.show_dump) g->ops.debug.show_dump(g, &o); - if (platform->dump_platform_dependencies) + if (platform->dump_platform_dependencies && l->enable_platform_dbg) platform->dump_platform_dependencies(dev_from_gk20a(g)); } @@ -361,8 +362,10 @@ void gk20a_debug_init(struct gk20a *g, const char *debugfs_symlink) debugfs_create_u32("ch_wdt_init_limit_ms", S_IRUGO|S_IWUSR, l->debugfs, &g->ch_wdt_init_limit_ms); - debugfs_create_bool("disable_syncpoints", S_IRUGO, + debugfs_create_bool("disable_syncpoints", S_IRUGO|S_IWUSR, l->debugfs, &l->disable_syncpoints); + debugfs_create_bool("enable_platform_dbg", S_IRUGO|S_IWUSR, + l->debugfs, &l->enable_platform_dbg); /* New debug logging API. */ debugfs_create_u64("log_mask", S_IRUGO|S_IWUSR, diff --git a/drivers/gpu/nvgpu/os/linux/os_linux.h b/drivers/gpu/nvgpu/os/linux/os_linux.h index 4d39172c9..dab169cca 100644 --- a/drivers/gpu/nvgpu/os/linux/os_linux.h +++ b/drivers/gpu/nvgpu/os/linux/os_linux.h @@ -174,6 +174,7 @@ struct nvgpu_os_linux { /** Debugfs knob for forcing syncpt support off in runtime. */ bool disable_syncpoints; + bool enable_platform_dbg; }; static inline struct nvgpu_os_linux *nvgpu_os_linux_from_gk20a(struct gk20a *g)