summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
diff options
context:
space:
mode:
authorSeema Khowala <seemaj@nvidia.com>2017-03-23 18:25:37 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-26 12:55:16 -0400
commitb076c349b26a471776b8c487a702f791e13fb3a4 (patch)
tree47774807b4629391a66ce4a17f982a5e857df57d /drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
parent173cf315ad43267a22a5c3265fd65960b28fcf68 (diff)
gpu: nvgpu: gv11b: fix engine context preempt completion
CTX_STATUS_SWITCH: Engine save hasn't started yet, continue to poll CTX_STATUS_INVALID: The engine context has switched off. The preemption step for this engine is complete. CTX_STATUS_VALID or CTX_STATUS_CTXSW_SAVE: check the ID field: * If ID matches the TSG for the context being torn down, the engine reset procedure can be performed, or SW can continue waiting for preempt to finish if id is not being torn down. * If ID does NOT match, the context isn't running on the engine. CTX_STATUS_LOAD: check the NEXT_ID field: * If NEXT_ID matches the TSG of the context being torn down, the engine is loading the context and reset can be performed immediately or after a delay to allow the context a chance to load and be saved off, or sw can continue waiting for preempt to finish if id is not being torn down. * If NEXT_ID does not match the TSG ID or CHID then the context is no longer on the engine. SW may alternatively wait for the CTX_STATUS to reach INVALID, but this may take longer if an unrelated context is currently on the engine or being switched to. JIRA GPUT19X-7 Change-Id: I61499f932019de32e0200084c4c41b21a7cbbd2b Signed-off-by: Seema Khowala <seemaj@nvidia.com> Reviewed-on: http://git-master/r/1327164 Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/fifo_gv11b.c')
-rw-r--r--drivers/gpu/nvgpu/gv11b/fifo_gv11b.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
index 7e310984..1bbf09ec 100644
--- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
@@ -428,27 +428,40 @@ static int gv11b_fifo_poll_eng_ctx_status(struct gk20a *g, u32 id,
428 ctx_stat == 428 ctx_stat ==
429 fifo_engine_status_ctx_status_ctxsw_save_v()) { 429 fifo_engine_status_ctx_status_ctxsw_save_v()) {
430 430
431 if (timeout_rc_type == PREEMPT_TIMEOUT_NORC) { 431 if (id == fifo_engine_status_id_v(eng_stat)) {
432 /* called from recovery, eng seems to be hung */ 432 if (timeout_rc_type == PREEMPT_TIMEOUT_NORC) {
433 if (id == fifo_engine_status_id_v(eng_stat)) { 433 /* called from recovery, eng seems to be hung */
434 *reset_eng_bitmask |= BIT(engine_idx); 434 *reset_eng_bitmask |= BIT(engine_idx);
435 ret = 0; 435 ret = 0;
436 break; 436 break;
437 } else {
438 gk20a_dbg_info("wait preempt engine. "
439 "ctx_status (valid/save)=%u", ctx_stat);
437 } 440 }
441 } else {
442 /* context is not running on the engine */
443 ret = 0;
444 break;
438 } 445 }
439 446
440 } else if (ctx_stat == 447 } else if (ctx_stat ==
441 fifo_engine_status_ctx_status_ctxsw_load_v()) { 448 fifo_engine_status_ctx_status_ctxsw_load_v()) {
442 449
443 if (timeout_rc_type == PREEMPT_TIMEOUT_NORC) { 450 if (id == fifo_engine_status_next_id_v(eng_stat)) {
444 /* called from recovery, eng seems to be hung */
445 if (id ==
446 fifo_engine_status_next_id_v(eng_stat)) {
447 451
452 if (timeout_rc_type == PREEMPT_TIMEOUT_NORC) {
453 /* called from recovery, eng seems to be hung */
448 *reset_eng_bitmask |= BIT(engine_idx); 454 *reset_eng_bitmask |= BIT(engine_idx);
449 ret = 0; 455 ret = 0;
450 break; 456 break;
457 } else {
458 gk20a_dbg_info("wait preempt engine. "
459 "ctx_status (load)=%u", ctx_stat);
451 } 460 }
461 } else {
462 /* context is not running on the engine */
463 ret = 0;
464 break;
452 } 465 }
453 466
454 } else { 467 } else {