gpu: nvgpu: use explicit timeout to wait for SM lock down

gv11b_gr_wait_for_sm_lock_down() uses nvgpu_get_poll_timeout() to
get timeout value for polling of SM lock down status.
nvgpu_get_poll_timeout() returns -1 if timeouts are disabled by
debugger, and if SM lock down fails, nvgpu lands in an infinite loop.

Use g->poll_timeout_default instead of nvgpu_get_poll_timeout() so
that explicit timeout value is always used. This also means that
timeout value of ULONG_MAX will still be used on simulation platforms.

Bug 200676073

Change-Id: I5777e98efcd63f24ade244384cf7b157dcea991d
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2478255
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Mikhail Filimonov <mfilimonov@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Deepak Nibade
2021-02-01 15:52:46 +05:30
committed by mobile promotions
parent 52b33022e7
commit ce206826f2

View File

@@ -1,7 +1,7 @@
/*
* GV11b GPU GR
*
* Copyright (c) 2016-2020, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -1260,7 +1260,7 @@ int gv11b_gr_wait_for_sm_lock_down(struct gk20a *g,
nvgpu_log(g, gpu_dbg_intr | gpu_dbg_gpu_dbg,
"GPC%d TPC%d: locking down SM%d", gpc, tpc, sm);
err = nvgpu_timeout_init(g, &timeout, nvgpu_get_poll_timeout(g),
err = nvgpu_timeout_init(g, &timeout, g->poll_timeout_default,
NVGPU_TIMER_CPU_TIMER);
if (err != 0) {
nvgpu_err(g, "timeout_init failed: %d", err);