From 6de92de60b284266922ea151e1818d237cb5ac3e Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Tue, 10 Oct 2017 00:33:23 -0700 Subject: gpu: nvgpu: fix channel status verify sequence While unbindin a channel from TSG, we first disable all the channels, then examine the status of channel being removed in gk20a_fifo_tsg_unbind_channel_verify_status(), and if this API fails we re-enable all the channel and kill whole TSG And in gk20a_fifo_tsg_unbind_channel_verify_status() we first check ctx_reload and fault status and then check NEXT status If channel has NEXT set we bail out But since we have already changed the TSG ctx_reload status re-enabling all channels in TSG might cause issues Hence fix this by correcting sequence so that we first ensure that NEXT is not set on channel and then only alter the status Bug 200327095 Change-Id: I4f0786bc507fad5462d4cdd8d0ca91ea611ee3b5 Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/1575905 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 848e5123..6544a652 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -1912,18 +1912,18 @@ int gk20a_fifo_tsg_unbind_channel_verify_status(struct channel_gk20a *ch) { struct gk20a *g = ch->g; - if (g->ops.fifo.tsg_verify_status_ctx_reload) - g->ops.fifo.tsg_verify_status_ctx_reload(ch); - - if (g->ops.fifo.tsg_verify_status_faulted) - g->ops.fifo.tsg_verify_status_faulted(ch); - if (gk20a_fifo_channel_status_is_next(g, ch->chid)) { nvgpu_err(g, "Channel %d to be removed from TSG %d has NEXT set!", ch->chid, ch->tsgid); return -EINVAL; } + if (g->ops.fifo.tsg_verify_status_ctx_reload) + g->ops.fifo.tsg_verify_status_ctx_reload(ch); + + if (g->ops.fifo.tsg_verify_status_faulted) + g->ops.fifo.tsg_verify_status_faulted(ch); + return 0; } -- cgit v1.2.2