From bf8dca77aee16b98a89e8ef5491907f2a791f1ff Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Fri, 6 Oct 2017 10:49:21 -0700 Subject: gpu: nvgpu: add null check for perfbuffer enable and disable dbg ops This is needed to disable/enable features on new chips Bug 200352825 Change-Id: I02eb58e6fdd554ed20866fe8a8553a667541f512 Signed-off-by: Seema Khowala Reviewed-on: https://git-master.nvidia.com/r/1574481 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c index d1eff233..c3cb0f4c 100644 --- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c @@ -1911,10 +1911,15 @@ static int gk20a_perfbuf_map(struct dbg_session_gk20a *dbg_s, struct mm_gk20a *mm = &g->mm; int err; u32 virt_size; - u32 big_page_size = g->ops.mm.get_default_big_page_size(); + u32 big_page_size; + + if (!g->ops.dbg_session_ops.perfbuffer_enable) + return -ENOSYS; nvgpu_mutex_acquire(&g->dbg_sessions_lock); + big_page_size = g->ops.mm.get_default_big_page_size(); + if (g->perfbuf.owner) { nvgpu_mutex_release(&g->dbg_sessions_lock); return -EBUSY; @@ -2015,6 +2020,9 @@ static int gk20a_perfbuf_unmap(struct dbg_session_gk20a *dbg_s, struct gk20a *g = dbg_s->g; int err; + if (!g->ops.dbg_session_ops.perfbuffer_disable) + return -ENOSYS; + nvgpu_mutex_acquire(&g->dbg_sessions_lock); if ((g->perfbuf.owner != dbg_s) || (g->perfbuf.offset != args->offset)) { -- cgit v1.2.2