mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
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 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
503b897b45
commit
1f54ea09e3
@@ -655,7 +655,7 @@ int vgpu_fifo_force_reset_ch(struct channel_gk20a *ch,
|
||||
if (gk20a_channel_get(ch_tsg)) {
|
||||
g->ops.fifo.set_error_notifier(ch_tsg,
|
||||
err_code);
|
||||
ch_tsg->has_timedout = true;
|
||||
gk20a_channel_set_timedout(ch_tsg);
|
||||
gk20a_channel_put(ch_tsg);
|
||||
}
|
||||
}
|
||||
@@ -663,7 +663,7 @@ int vgpu_fifo_force_reset_ch(struct channel_gk20a *ch,
|
||||
nvgpu_rwsem_up_read(&tsg->ch_list_lock);
|
||||
} else {
|
||||
g->ops.fifo.set_error_notifier(ch, err_code);
|
||||
ch->has_timedout = true;
|
||||
gk20a_channel_set_timedout(ch);
|
||||
}
|
||||
|
||||
msg.cmd = TEGRA_VGPU_CMD_CHANNEL_FORCE_RESET;
|
||||
@@ -689,8 +689,8 @@ static void vgpu_fifo_set_ctx_mmu_error_ch(struct gk20a *g,
|
||||
NVGPU_ERR_NOTIFIER_FIFO_ERROR_MMU_ERR_FLT);
|
||||
|
||||
/* mark channel as faulted */
|
||||
ch->has_timedout = true;
|
||||
nvgpu_smp_wmb();
|
||||
gk20a_channel_set_timedout(ch);
|
||||
|
||||
/* unblock pending waits */
|
||||
nvgpu_cond_broadcast_interruptible(&ch->semaphore_wq);
|
||||
nvgpu_cond_broadcast_interruptible(&ch->notifier_wq);
|
||||
|
||||
Reference in New Issue
Block a user