diff options
author | seshendra Gadagottu <sgadagottu@nvidia.com> | 2017-06-20 13:21:27 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-20 19:24:09 -0400 |
commit | 7437fefa9016ab8904c79f521276f5c41e40c449 (patch) | |
tree | 1e88441a294d89c8d33d2e90332d6e0a52248586 /drivers/gpu/nvgpu/gk20a | |
parent | 72726c70b8839fbaf6374b4daa9799501b6b6c50 (diff) |
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 <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1505783
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
294 | 294 | ||
295 | ch->g->ops.fifo.disable_channel(ch); | 295 | ch->g->ops.fifo.disable_channel(ch); |
296 | 296 | ||
297 | if (channel_preempt) | 297 | if (channel_preempt && ch->ch_ctx.gr_ctx) |
298 | ch->g->ops.fifo.preempt_channel(ch->g, ch->hw_chid); | 298 | ch->g->ops.fifo.preempt_channel(ch->g, ch->hw_chid); |
299 | 299 | ||
300 | gk20a_channel_abort_clean_up(ch); | 300 | gk20a_channel_abort_clean_up(ch); |