gpu: nvgpu: preempt before adjusting fences
authorDeepak Nibade <dnibade@nvidia.com>
Thu, 10 Dec 2015 08:58:32 +0000 (13:58 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Fri, 19 Feb 2016 20:27:26 +0000 (12:27 -0800)
commite1ef3a2411f48eed8e05e0f5265095743eadb476
tree6ffdbaf82b3c0426e6fbf3b4c92864888844b76e
parentde4f4b18a1e3188880949d41056e659ef2e377ff
gpu: nvgpu: preempt before adjusting fences

Current sequence in gk20a_disable_channel() is
- disable channel in gk20a_channel_abort()
- adjust pending fence in gk20a_channel_abort()
- preempt channel

But this leads to scenarios where syncpoint has
min > max value

Hence to fix this, make sequence in gk20a_disable_channel()
- disable channel in gk20a_channel_abort()
- preempt channel in gk20a_channel_abort()
- adjust pending fence in gk20a_channel_abort()

If gk20a_channel_abort() is called from other API where
preemption is not needed, then use channel_preempt
flag and do not preempt channel in those cases

Bug 1683059

Change-Id: I4d46d4294cf8597ae5f05f79dfe1b95c4187f2e3
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/921290
(cherry picked from commit a174139ec383ba6d2ede096743192066e8582684)
Reviewed-on: http://git-master/r/1012165
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/gpu/nvgpu/gk20a/channel_gk20a.c
drivers/gpu/nvgpu/gk20a/channel_gk20a.h
drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
drivers/gpu/nvgpu/vgpu/fifo_vgpu.c