drivers/gpu/drm/amd/amdgpu/umc_v8_7.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/umc_v8_7.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/umc_v8_7.c- Extension
.c- Size
- 15069 bytes
- Lines
- 447
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
umc_v8_7.hamdgpu_ras.hamdgpu_umc.hamdgpu.hrsmu/rsmu_0_0_2_offset.hrsmu/rsmu_0_0_2_sh_mask.humc/umc_8_7_0_offset.humc/umc_8_7_0_sh_mask.h
Detected Declarations
function get_umc_v8_7_reg_offsetfunction umc_v8_7_ecc_info_query_correctable_error_countfunction umc_v8_7_ecc_info_querry_uncorrectable_error_countfunction umc_v8_7_ecc_info_query_ras_error_countfunction umc_v8_7_convert_error_addressfunction umc_v8_7_ecc_info_query_error_addressfunction REG_GET_FIELDfunction umc_v8_7_ecc_info_query_ras_error_addressfunction umc_v8_7_clear_error_count_per_channelfunction umc_v8_7_clear_error_countfunction LOOP_UMC_INST_AND_CHfunction umc_v8_7_query_correctable_error_countfunction umc_v8_7_querry_uncorrectable_error_countfunction umc_v8_7_query_ras_error_countfunction LOOP_UMC_INST_AND_CHfunction umc_v8_7_query_error_addressfunction REG_GET_FIELDfunction umc_v8_7_query_ras_error_addressfunction LOOP_UMC_INST_AND_CHfunction umc_v8_7_err_cnt_init_per_channelfunction umc_v8_7_err_cnt_initfunction LOOP_UMC_INST_AND_CH
Annotated Snippet
REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, UECC) == 1) {
err_addr = ras->umc_ecc.ecc[eccinfo_table_idx].mca_umc_addr;
err_addr = REG_GET_FIELD(err_addr, MCA_UMC_UMC0_MCUMC_ADDRT0, ErrorAddr);
umc_v8_7_convert_error_address(adev, err_data, err_addr,
ch_inst, umc_inst);
}
}
static void umc_v8_7_ecc_info_query_ras_error_address(struct amdgpu_device *adev,
void *ras_error_status)
{
struct ras_err_data *err_data = (struct ras_err_data *)ras_error_status;
uint32_t umc_inst = 0;
uint32_t ch_inst = 0;
/* TODO: driver needs to toggle DF Cstate to ensure
* safe access of UMC resgisters. Will add the protection
* when firmware interface is ready
*/
LOOP_UMC_INST_AND_CH(umc_inst, ch_inst) {
umc_v8_7_ecc_info_query_error_address(adev,
err_data,
ch_inst,
umc_inst);
}
}
static void umc_v8_7_clear_error_count_per_channel(struct amdgpu_device *adev,
uint32_t umc_reg_offset)
{
uint32_t ecc_err_cnt_addr;
uint32_t ecc_err_cnt_sel, ecc_err_cnt_sel_addr;
ecc_err_cnt_sel_addr =
SOC15_REG_OFFSET(UMC, 0, mmUMCCH0_0_GeccErrCntSel);
ecc_err_cnt_addr =
SOC15_REG_OFFSET(UMC, 0, mmUMCCH0_0_GeccErrCnt);
/* select the lower chip */
ecc_err_cnt_sel = RREG32_PCIE((ecc_err_cnt_sel_addr +
umc_reg_offset) * 4);
ecc_err_cnt_sel = REG_SET_FIELD(ecc_err_cnt_sel,
UMCCH0_0_GeccErrCntSel,
GeccErrCntCsSel, 0);
WREG32_PCIE((ecc_err_cnt_sel_addr + umc_reg_offset) * 4,
ecc_err_cnt_sel);
/* clear lower chip error count */
WREG32_PCIE((ecc_err_cnt_addr + umc_reg_offset) * 4,
UMC_V8_7_CE_CNT_INIT);
/* select the higher chip */
ecc_err_cnt_sel = RREG32_PCIE((ecc_err_cnt_sel_addr +
umc_reg_offset) * 4);
ecc_err_cnt_sel = REG_SET_FIELD(ecc_err_cnt_sel,
UMCCH0_0_GeccErrCntSel,
GeccErrCntCsSel, 1);
WREG32_PCIE((ecc_err_cnt_sel_addr + umc_reg_offset) * 4,
ecc_err_cnt_sel);
/* clear higher chip error count */
WREG32_PCIE((ecc_err_cnt_addr + umc_reg_offset) * 4,
UMC_V8_7_CE_CNT_INIT);
}
static void umc_v8_7_clear_error_count(struct amdgpu_device *adev)
{
uint32_t umc_inst = 0;
uint32_t ch_inst = 0;
uint32_t umc_reg_offset = 0;
LOOP_UMC_INST_AND_CH(umc_inst, ch_inst) {
umc_reg_offset = get_umc_v8_7_reg_offset(adev,
umc_inst,
ch_inst);
umc_v8_7_clear_error_count_per_channel(adev,
umc_reg_offset);
}
}
static void umc_v8_7_query_correctable_error_count(struct amdgpu_device *adev,
uint32_t umc_reg_offset,
unsigned long *error_count)
{
uint32_t ecc_err_cnt_sel, ecc_err_cnt_sel_addr;
uint32_t ecc_err_cnt, ecc_err_cnt_addr;
Annotation
- Immediate include surface: `umc_v8_7.h`, `amdgpu_ras.h`, `amdgpu_umc.h`, `amdgpu.h`, `rsmu/rsmu_0_0_2_offset.h`, `rsmu/rsmu_0_0_2_sh_mask.h`, `umc/umc_8_7_0_offset.h`, `umc/umc_8_7_0_sh_mask.h`.
- Detected declarations: `function get_umc_v8_7_reg_offset`, `function umc_v8_7_ecc_info_query_correctable_error_count`, `function umc_v8_7_ecc_info_querry_uncorrectable_error_count`, `function umc_v8_7_ecc_info_query_ras_error_count`, `function umc_v8_7_convert_error_address`, `function umc_v8_7_ecc_info_query_error_address`, `function REG_GET_FIELD`, `function umc_v8_7_ecc_info_query_ras_error_address`, `function umc_v8_7_clear_error_count_per_channel`, `function umc_v8_7_clear_error_count`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.