summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
diff options
context:
space:
mode:
authorSeema Khowala <seemaj@nvidia.com>2018-10-19 15:08:46 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2019-02-13 16:19:37 -0500
commit220860d04383489a8e75684802a2ced1323831df (patch)
tree123e92d8b1781afa6de32bc2615ae5835b389f4d /drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
parent18643ac1357a845d204d6dabd98359a0ab0509a7 (diff)
gpu: nvgpu: rename has_timedout and make it thread safe
Currently has_timedout variable is protected by wmb at places where it is being set and there is no correspoding rmb whenever has_timedout variable is read. This is prone to errors for concurrent execution. This change is supposed to fix this issue. Rename has_timedout variable of channel struct to ch_timedout. Also to avoid rmb every time ch_timedout is read, ch_timedout_spinlock is added to protect ch_timedout variable for taking care of concurrent execution. Bug 2404865 Bug 2092051 Change-Id: I0bee9f50af0a48720aa8b54cbc3af97ef9f6df00 Signed-off-by: Seema Khowala <seemaj@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1930935 Signed-off-by: Debarshi Dutta <ddutta@nvidia.com> (cherry picked from commit 1f54ea09e3445d9ca3cf7a69b4967849cc9defc8 in dev-kernel) Reviewed-on: https://git-master.nvidia.com/r/2016975 GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/fifo_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/fifo_vgpu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
index 234f6fd4..4055d5af 100644
--- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
@@ -651,7 +651,7 @@ int vgpu_fifo_force_reset_ch(struct channel_gk20a *ch,
651 if (gk20a_channel_get(ch_tsg)) { 651 if (gk20a_channel_get(ch_tsg)) {
652 g->ops.fifo.set_error_notifier(ch_tsg, 652 g->ops.fifo.set_error_notifier(ch_tsg,
653 err_code); 653 err_code);
654 ch_tsg->has_timedout = true; 654 gk20a_channel_set_timedout(ch_tsg);
655 gk20a_channel_put(ch_tsg); 655 gk20a_channel_put(ch_tsg);
656 } 656 }
657 } 657 }
@@ -659,7 +659,7 @@ int vgpu_fifo_force_reset_ch(struct channel_gk20a *ch,
659 nvgpu_rwsem_up_read(&tsg->ch_list_lock); 659 nvgpu_rwsem_up_read(&tsg->ch_list_lock);
660 } else { 660 } else {
661 g->ops.fifo.set_error_notifier(ch, err_code); 661 g->ops.fifo.set_error_notifier(ch, err_code);
662 ch->has_timedout = true; 662 gk20a_channel_set_timedout(ch);
663 } 663 }
664 664
665 msg.cmd = TEGRA_VGPU_CMD_CHANNEL_FORCE_RESET; 665 msg.cmd = TEGRA_VGPU_CMD_CHANNEL_FORCE_RESET;
@@ -685,8 +685,8 @@ static void vgpu_fifo_set_ctx_mmu_error_ch(struct gk20a *g,
685 NVGPU_ERR_NOTIFIER_FIFO_ERROR_MMU_ERR_FLT); 685 NVGPU_ERR_NOTIFIER_FIFO_ERROR_MMU_ERR_FLT);
686 686
687 /* mark channel as faulted */ 687 /* mark channel as faulted */
688 ch->has_timedout = true; 688 gk20a_channel_set_timedout(ch);
689 nvgpu_smp_wmb(); 689
690 /* unblock pending waits */ 690 /* unblock pending waits */
691 nvgpu_cond_broadcast_interruptible(&ch->semaphore_wq); 691 nvgpu_cond_broadcast_interruptible(&ch->semaphore_wq);
692 nvgpu_cond_broadcast_interruptible(&ch->notifier_wq); 692 nvgpu_cond_broadcast_interruptible(&ch->notifier_wq);