From 5a08b515597fa2638146a4f202ec2cba5ca50678 Mon Sep 17 00:00:00 2001 From: Peter Daifuku Date: Thu, 25 Jul 2019 20:55:39 -0700 Subject: [PATCH] nvgpu: check if unbound tsg in timeslice/interleave in set_timeslice/set_interleave, the TSG may not have been bound yet; if so, just return after saving the new values. Bug 2661079 Change-Id: I4fb915674d2bc45c062dbd10b942408800f6f2a5 Signed-off-by: Peter Daifuku Reviewed-on: https://git-master.nvidia.com/r/2161683 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra GVS: Gerrit_Virtual_Submit Reviewed-by: Thomas Fleury Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/fifo/tsg.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/nvgpu/common/fifo/tsg.c b/drivers/gpu/nvgpu/common/fifo/tsg.c index 0a4b6532a..604842b74 100644 --- a/drivers/gpu/nvgpu/common/fifo/tsg.c +++ b/drivers/gpu/nvgpu/common/fifo/tsg.c @@ -553,6 +553,11 @@ int nvgpu_tsg_set_interleave(struct nvgpu_tsg *tsg, u32 level) tsg->interleave_level = level; + /* TSG may not be bound yet */ + if (tsg->runlist_id == NVGPU_INVALID_RUNLIST_ID) { + return 0; + } + return g->ops.runlist.reload(g, tsg->runlist_id, true, true); } @@ -570,6 +575,11 @@ int nvgpu_tsg_set_timeslice(struct nvgpu_tsg *tsg, u32 timeslice_us) tsg->timeslice_us = timeslice_us; + /* TSG may not be bound yet */ + if (tsg->runlist_id == NVGPU_INVALID_RUNLIST_ID) { + return 0; + } + return g->ops.runlist.reload(g, tsg->runlist_id, true, true); }