From 7437fefa9016ab8904c79f521276f5c41e40c449 Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Tue, 20 Jun 2017 10:21:27 -0700 Subject: gpu: nvgpu: check for valid channel ctx before preempt Always check for valid channel gr_ctx before issuing channel preempt. Commands like "echo > /dev/nvhost-gpu" create channel to just power-up gpu without any valid channel context. So don't try to preempt those channels. Bug 1937331 Change-Id: I48a4bfd35728b83b27eb968e51a56b900d1fa799 Signed-off-by: seshendra Gadagottu Reviewed-on: http://git-master/r/1505783 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 1caecf3d..ef9ad731 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -294,7 +294,7 @@ void gk20a_channel_abort(struct channel_gk20a *ch, bool channel_preempt) ch->g->ops.fifo.disable_channel(ch); - if (channel_preempt) + if (channel_preempt && ch->ch_ctx.gr_ctx) ch->g->ops.fifo.preempt_channel(ch->g, ch->hw_chid); gk20a_channel_abort_clean_up(ch); -- cgit v1.2.2