Commit 56316ee9 authored by Hawking Zhang's avatar Hawking Zhang Committed by Alex Deucher
Browse files

drm/amdgpu: Include ACA error type in aca bank



ACA error types managed by driver a direct 1:1
correspondence with those managed by firmware.

To address this, for each ACA bank, include
both the ACA error type and the ACA SMU type.

This addition is useful for creating CPER records.

Signed-off-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: default avatarYang Wang <keivnyang.wang@amd.com>
Reviewed-by: default avatarTao Zhou <tao.zhou1@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 76b1f8b3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ static int aca_smu_get_valid_aca_banks(struct amdgpu_device *adev, enum aca_smu_
		if (ret)
			return ret;

		bank.type = type;
		bank.smu_err_type = type;

		aca_smu_bank_dump(adev, i, count, &bank, qctx);

+3 −1
Original line number Diff line number Diff line
@@ -108,13 +108,15 @@ enum aca_error_type {
};

enum aca_smu_type {
	ACA_SMU_TYPE_INVALID = -1,
	ACA_SMU_TYPE_UE = 0,
	ACA_SMU_TYPE_CE,
	ACA_SMU_TYPE_COUNT,
};

struct aca_bank {
	enum aca_smu_type type;
	enum aca_error_type aca_err_type;
	enum aca_smu_type smu_err_type;
	u64 regs[ACA_MAX_REGS_COUNT];
};

+2 −0
Original line number Diff line number Diff line
@@ -1123,10 +1123,12 @@ static int xgmi_v6_4_0_aca_bank_parser(struct aca_handle *handle, struct aca_ban
		if (ext_error_code != 0 && ext_error_code != 9)
			count = 0ULL;

		bank->aca_err_type = ACA_ERROR_TYPE_UE;
		ret = aca_error_cache_log_bank_error(handle, &info, ACA_ERROR_TYPE_UE, count);
		break;
	case ACA_SMU_TYPE_CE:
		count = ext_error_code == 6 ? count : 0ULL;
		bank->aca_err_type = ACA_ERROR_TYPE_CE;
		ret = aca_error_cache_log_bank_error(handle, &info, ACA_ERROR_TYPE_CE, count);
		break;
	default:
+2 −0
Original line number Diff line number Diff line
@@ -891,10 +891,12 @@ static int gfx_v9_4_3_aca_bank_parser(struct aca_handle *handle,

	switch (type) {
	case ACA_SMU_TYPE_UE:
		bank->aca_err_type = ACA_ERROR_TYPE_UE;
		ret = aca_error_cache_log_bank_error(handle, &info,
						     ACA_ERROR_TYPE_UE, 1ULL);
		break;
	case ACA_SMU_TYPE_CE:
		bank->aca_err_type = ACA_ERROR_TYPE_CE;
		ret = aca_error_cache_log_bank_error(handle, &info,
						     ACA_ERROR_TYPE_CE, ACA_REG__MISC0__ERRCNT(misc0));
		break;
+2 −0
Original line number Diff line number Diff line
@@ -1291,10 +1291,12 @@ static int jpeg_v4_0_3_aca_bank_parser(struct aca_handle *handle, struct aca_ban
	misc0 = bank->regs[ACA_REG_IDX_MISC0];
	switch (type) {
	case ACA_SMU_TYPE_UE:
		bank->aca_err_type = ACA_ERROR_TYPE_UE;
		ret = aca_error_cache_log_bank_error(handle, &info, ACA_ERROR_TYPE_UE,
						     1ULL);
		break;
	case ACA_SMU_TYPE_CE:
		bank->aca_err_type = ACA_ERROR_TYPE_CE;
		ret = aca_error_cache_log_bank_error(handle, &info, ACA_ERROR_TYPE_CE,
						     ACA_REG__MISC0__ERRCNT(misc0));
		break;
Loading