Skip to content

Commit 8096df7

Browse files
Tao Zhoualexdeucher
authored andcommitted
drm/amdgpu: add set/get mca debug mode operations
Record the debug mode status in RAS. Signed-off-by: Tao Zhou <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 21226f0 commit 8096df7

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3311,6 +3311,27 @@ int amdgpu_ras_reset_gpu(struct amdgpu_device *adev)
33113311
return 0;
33123312
}
33133313

3314+
void amdgpu_ras_set_mca_debug_mode(struct amdgpu_device *adev, bool enable)
3315+
{
3316+
struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
3317+
3318+
if (con)
3319+
con->is_mca_debug_mode = enable;
3320+
}
3321+
3322+
bool amdgpu_ras_get_mca_debug_mode(struct amdgpu_device *adev)
3323+
{
3324+
struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
3325+
const struct amdgpu_mca_smu_funcs *mca_funcs = adev->mca.mca_funcs;
3326+
3327+
if (!con)
3328+
return false;
3329+
3330+
if (mca_funcs && mca_funcs->mca_set_debug_mode)
3331+
return con->is_mca_debug_mode;
3332+
else
3333+
return true;
3334+
}
33143335

33153336
/* Register each ip ras block into amdgpu ras */
33163337
int amdgpu_ras_register_ras_block(struct amdgpu_device *adev,

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,8 @@ struct amdgpu_ras {
434434

435435
/* Indicates smu whether need update bad channel info */
436436
bool update_channel_flag;
437+
/* Record status of smu mca debug mode */
438+
bool is_mca_debug_mode;
437439

438440
/* Record special requirements of gpu reset caller */
439441
uint32_t gpu_reset_flags;
@@ -768,6 +770,9 @@ struct amdgpu_ras* amdgpu_ras_get_context(struct amdgpu_device *adev);
768770

769771
int amdgpu_ras_set_context(struct amdgpu_device *adev, struct amdgpu_ras *ras_con);
770772

773+
void amdgpu_ras_set_mca_debug_mode(struct amdgpu_device *adev, bool enable);
774+
bool amdgpu_ras_get_mca_debug_mode(struct amdgpu_device *adev);
775+
771776
int amdgpu_ras_register_ras_block(struct amdgpu_device *adev,
772777
struct amdgpu_ras_block_object *ras_block_obj);
773778
void amdgpu_ras_interrupt_fatal_error_handler(struct amdgpu_device *adev);

0 commit comments

Comments
 (0)