mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: move defer reset functions to engines and channel
Renamed and moved from fifo_gk20a.c to common/fifo/engines.c gk20a_fifo_should_defer_engine_reset -> nvgpu_engine_should_defer_reset Renamed and moved from fifo_gk20a.c to common/fifo/channel.c gk20a_fifo_deferred_reset -> nvgpu_channel_deferred_reset_engines JIRA NVGPU-1314 Change-Id: Ifc32ff4dde398143b83c2c1b6fab896142574240 Signed-off-by: Seema Khowala <seemaj@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2093910 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
ca628dfd6e
commit
59bf3919e2
@@ -901,3 +901,44 @@ u32 nvgpu_engine_get_runlist_busy_engines(struct gk20a *g, u32 runlist_id)
|
||||
|
||||
return eng_bitmask;
|
||||
}
|
||||
|
||||
bool nvgpu_engine_should_defer_reset(struct gk20a *g, u32 engine_id,
|
||||
u32 engine_subid, bool fake_fault)
|
||||
{
|
||||
enum nvgpu_fifo_engine engine_enum = NVGPU_ENGINE_INVAL_GK20A;
|
||||
struct fifo_engine_info_gk20a *engine_info;
|
||||
|
||||
if (g == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
engine_info = nvgpu_engine_get_active_eng_info(g, engine_id);
|
||||
|
||||
if (engine_info != NULL) {
|
||||
engine_enum = engine_info->engine_enum;
|
||||
}
|
||||
|
||||
if (engine_enum == NVGPU_ENGINE_INVAL_GK20A) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* channel recovery is only deferred if an sm debugger
|
||||
* is attached and has MMU debug mode is enabled
|
||||
*/
|
||||
if (!g->ops.gr.sm_debugger_attached(g) ||
|
||||
!g->ops.fb.is_debug_mode_enabled(g)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* if this fault is fake (due to RC recovery), don't defer recovery */
|
||||
if (fake_fault) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (engine_enum != NVGPU_ENGINE_GR_GK20A) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return g->ops.engine.is_fault_engine_subid_gpc(g, engine_subid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user