mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
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 <seemaj@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1574481 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
7bbbacee21
commit
bf8dca77ae
@@ -1911,10 +1911,15 @@ static int gk20a_perfbuf_map(struct dbg_session_gk20a *dbg_s,
|
|||||||
struct mm_gk20a *mm = &g->mm;
|
struct mm_gk20a *mm = &g->mm;
|
||||||
int err;
|
int err;
|
||||||
u32 virt_size;
|
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);
|
nvgpu_mutex_acquire(&g->dbg_sessions_lock);
|
||||||
|
|
||||||
|
big_page_size = g->ops.mm.get_default_big_page_size();
|
||||||
|
|
||||||
if (g->perfbuf.owner) {
|
if (g->perfbuf.owner) {
|
||||||
nvgpu_mutex_release(&g->dbg_sessions_lock);
|
nvgpu_mutex_release(&g->dbg_sessions_lock);
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
@@ -2015,6 +2020,9 @@ static int gk20a_perfbuf_unmap(struct dbg_session_gk20a *dbg_s,
|
|||||||
struct gk20a *g = dbg_s->g;
|
struct gk20a *g = dbg_s->g;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
if (!g->ops.dbg_session_ops.perfbuffer_disable)
|
||||||
|
return -ENOSYS;
|
||||||
|
|
||||||
nvgpu_mutex_acquire(&g->dbg_sessions_lock);
|
nvgpu_mutex_acquire(&g->dbg_sessions_lock);
|
||||||
if ((g->perfbuf.owner != dbg_s) ||
|
if ((g->perfbuf.owner != dbg_s) ||
|
||||||
(g->perfbuf.offset != args->offset)) {
|
(g->perfbuf.offset != args->offset)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user