@@ -2153,7 +2153,7 @@ static void amdgpu_ras_interrupt_poison_consumption_handler(struct ras_manager *
2153
2153
/* gpu reset is fallback for failed and default cases.
2154
2154
* For RMA case, amdgpu_umc_poison_handler will handle gpu reset.
2155
2155
*/
2156
- if (poison_stat && !con -> is_rma ) {
2156
+ if (poison_stat && !amdgpu_ras_is_rma ( adev ) ) {
2157
2157
event_id = amdgpu_ras_acquire_event_id (adev , type );
2158
2158
RAS_EVENT_LOG (adev , event_id ,
2159
2159
"GPU reset for %s RAS poison consumption is issued!\n" ,
@@ -2945,7 +2945,7 @@ static void amdgpu_ras_do_page_retirement(struct work_struct *work)
2945
2945
2946
2946
amdgpu_ras_error_data_fini (& err_data );
2947
2947
2948
- if (err_cnt && con -> is_rma )
2948
+ if (err_cnt && amdgpu_ras_is_rma ( adev ) )
2949
2949
amdgpu_ras_reset_gpu (adev );
2950
2950
2951
2951
amdgpu_ras_schedule_retirement_dwork (con ,
@@ -3046,7 +3046,7 @@ static int amdgpu_ras_poison_consumption_handler(struct amdgpu_device *adev,
3046
3046
}
3047
3047
3048
3048
/* for RMA, amdgpu_ras_poison_creation_handler will trigger gpu reset */
3049
- if (reset_flags && !con -> is_rma ) {
3049
+ if (reset_flags && !amdgpu_ras_is_rma ( adev ) ) {
3050
3050
if (reset_flags & AMDGPU_RAS_GPU_RESET_MODE1_RESET )
3051
3051
reset = AMDGPU_RAS_GPU_RESET_MODE1_RESET ;
3052
3052
else if (reset_flags & AMDGPU_RAS_GPU_RESET_MODE2_RESET )
@@ -3192,7 +3192,7 @@ int amdgpu_ras_recovery_init(struct amdgpu_device *adev)
3192
3192
* This calling fails when is_rma is true or
3193
3193
* ret != 0.
3194
3194
*/
3195
- if (con -> is_rma || ret )
3195
+ if (amdgpu_ras_is_rma ( adev ) || ret )
3196
3196
goto free ;
3197
3197
3198
3198
if (con -> eeprom_control .ras_num_recs ) {
@@ -3241,7 +3241,7 @@ int amdgpu_ras_recovery_init(struct amdgpu_device *adev)
3241
3241
* Except error threshold exceeding case, other failure cases in this
3242
3242
* function would not fail amdgpu driver init.
3243
3243
*/
3244
- if (!con -> is_rma )
3244
+ if (!amdgpu_ras_is_rma ( adev ) )
3245
3245
ret = 0 ;
3246
3246
else
3247
3247
ret = - EINVAL ;
@@ -4284,7 +4284,7 @@ int amdgpu_ras_reset_gpu(struct amdgpu_device *adev)
4284
4284
struct amdgpu_ras * ras = amdgpu_ras_get_context (adev );
4285
4285
4286
4286
/* mode1 is the only selection for RMA status */
4287
- if (ras -> is_rma ) {
4287
+ if (amdgpu_ras_is_rma ( adev ) ) {
4288
4288
ras -> gpu_reset_flags = 0 ;
4289
4289
ras -> gpu_reset_flags |= AMDGPU_RAS_GPU_RESET_MODE1_RESET ;
4290
4290
}
@@ -4824,3 +4824,13 @@ void amdgpu_ras_event_log_print(struct amdgpu_device *adev, u64 event_id,
4824
4824
4825
4825
va_end (args );
4826
4826
}
4827
+
4828
+ bool amdgpu_ras_is_rma (struct amdgpu_device * adev )
4829
+ {
4830
+ struct amdgpu_ras * con = amdgpu_ras_get_context (adev );
4831
+
4832
+ if (!con )
4833
+ return false;
4834
+
4835
+ return con -> is_rma ;
4836
+ }
0 commit comments