summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index 84d3f639..f6318257 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -1314,7 +1314,7 @@ struct gk20a {
1314 struct railgate_stats pstats; 1314 struct railgate_stats pstats;
1315#endif 1315#endif
1316 u32 gr_idle_timeout_default; 1316 u32 gr_idle_timeout_default;
1317 bool timeouts_enabled; 1317 bool timeouts_disabled_by_user;
1318 unsigned int ch_wdt_timeout_ms; 1318 unsigned int ch_wdt_timeout_ms;
1319 1319
1320 struct nvgpu_mutex poweron_lock; 1320 struct nvgpu_mutex poweron_lock;
@@ -1376,7 +1376,8 @@ struct gk20a {
1376 /* also prevents debug sessions from attaching until released */ 1376 /* also prevents debug sessions from attaching until released */
1377 struct nvgpu_mutex dbg_sessions_lock; 1377 struct nvgpu_mutex dbg_sessions_lock;
1378 int dbg_powergating_disabled_refcount; /*refcount for pg disable */ 1378 int dbg_powergating_disabled_refcount; /*refcount for pg disable */
1379 int dbg_timeout_disabled_refcount; /*refcount for timeout disable */ 1379 /*refcount for timeout disable */
1380 nvgpu_atomic_t timeouts_disabled_refcount;
1380 1381
1381 /* must have dbg_sessions_lock before use */ 1382 /* must have dbg_sessions_lock before use */
1382 struct nvgpu_dbg_reg_op *dbg_regops_tmp_buf; 1383 struct nvgpu_dbg_reg_op *dbg_regops_tmp_buf;
@@ -1508,9 +1509,14 @@ struct gk20a {
1508 struct nvgpu_list_node boardobjgrp_head; 1509 struct nvgpu_list_node boardobjgrp_head;
1509}; 1510};
1510 1511
1512static inline bool nvgpu_is_timeouts_enabled(struct gk20a *g)
1513{
1514 return nvgpu_atomic_read(&g->timeouts_disabled_refcount) == 0;
1515}
1516
1511static inline unsigned long gk20a_get_gr_idle_timeout(struct gk20a *g) 1517static inline unsigned long gk20a_get_gr_idle_timeout(struct gk20a *g)
1512{ 1518{
1513 return g->timeouts_enabled ? 1519 return nvgpu_is_timeouts_enabled(g) ?
1514 g->gr_idle_timeout_default : ULONG_MAX; 1520 g->gr_idle_timeout_default : ULONG_MAX;
1515} 1521}
1516 1522