From d99b72974d06d4b3bc577bae8dc721b7b8f3cde9 Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Wed, 8 Nov 2017 15:59:31 -0800 Subject: gpu: nvgpu: gv11b: clear channel status After unbinding channel, following fields in channel status needs to be cleared manually: ccsr_channel_enable_clr_true ccsr_channel_pbdma_faulted_reset ccsr_channel_eng_faulted_reset Unbinding channel expected to clear all other channel status fields. Bug 1972365 Change-Id: Ibfd84df2f41adc2eb437a026acde3f3d618d7758 Signed-off-by: seshendra Gadagottu Reviewed-on: https://git-master.nvidia.com/r/1594671 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/fifo_gv11b.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu') diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c index 4c3b1186..a3cb9292 100644 --- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c @@ -260,9 +260,20 @@ void gv11b_userd_gp_put(struct gk20a *g, struct channel_gk20a *c) void channel_gv11b_unbind(struct channel_gk20a *ch) { + struct gk20a *g = ch->g; + gk20a_dbg_fn(""); - gk20a_fifo_channel_unbind(ch); + if (nvgpu_atomic_cmpxchg(&ch->bound, true, false)) { + gk20a_writel(g, ccsr_channel_inst_r(ch->chid), + ccsr_channel_inst_ptr_f(0) | + ccsr_channel_inst_bind_false_f()); + + gk20a_writel(g, ccsr_channel_r(ch->chid), + ccsr_channel_enable_clr_true_f() | + ccsr_channel_pbdma_faulted_reset_f() | + ccsr_channel_eng_faulted_reset_f()); + } } u32 gv11b_fifo_get_num_fifos(struct gk20a *g) -- cgit v1.2.2