drivers/edac/mce_amd.c
Source file repositories/reference/linux-study-clean/drivers/edac/mce_amd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/edac/mce_amd.c- Extension
.c- Size
- 22240 bytes
- Lines
- 1027
- Domain
- Driver Families
- Bucket
- drivers/edac
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/slab.hasm/cpu.hasm/msr.hmce_amd.h
Detected Declarations
function amd_register_ecc_decoderfunction amd_unregister_ecc_decoderfunction f12h_mc0_mcefunction f10h_mc0_mcefunction k8_mc0_mcefunction cat_mc0_mcefunction f15h_mc0_mcefunction decode_mc0_mcefunction k8_mc1_mcefunction cat_mc1_mcefunction f15h_mc1_mcefunction decode_mc1_mcefunction k8_mc2_mcefunction f15h_mc2_mcefunction f16h_mc2_mcefunction decode_mc2_mcefunction decode_mc3_mcefunction decode_mc4_mcefunction decode_mc5_mcefunction decode_mc6_mcefunction decode_smca_errorfunction amd_decode_err_codefunction amd_decode_mcefunction mce_amd_initfunction mce_amd_exitexport amd_register_ecc_decoderexport amd_unregister_ecc_decoderexport pp_msgs
Annotated Snippet
switch (r4) {
case R4_DRD:
case R4_DWR:
pr_cont("Data/Tag parity error due to %s.\n",
(r4 == R4_DRD ? "load/hw prf" : "store"));
break;
case R4_EVICT:
pr_cont("Copyback parity error on a tag miss.\n");
break;
case R4_SNOOP:
pr_cont("Tag parity error during snoop.\n");
break;
default:
ret = false;
}
} else if (BUS_ERROR(ec)) {
if ((II(ec) != II_MEM && II(ec) != II_IO) || LL(ec) != LL_LG)
return false;
pr_cont("System read data error on a ");
switch (r4) {
case R4_RD:
pr_cont("TLB reload.\n");
break;
case R4_DWR:
pr_cont("store.\n");
break;
case R4_DRD:
pr_cont("load.\n");
break;
default:
ret = false;
}
} else {
ret = false;
}
return ret;
}
static bool f15h_mc0_mce(u16 ec, u8 xec)
{
bool ret = true;
if (MEM_ERROR(ec)) {
switch (xec) {
case 0x0:
pr_cont("Data Array access error.\n");
break;
case 0x1:
pr_cont("UC error during a linefill from L2/NB.\n");
break;
case 0x2:
case 0x11:
pr_cont("STQ access error.\n");
break;
case 0x3:
pr_cont("SCB access error.\n");
break;
case 0x10:
pr_cont("Tag error.\n");
break;
case 0x12:
pr_cont("LDQ access error.\n");
break;
default:
ret = false;
}
} else if (BUS_ERROR(ec)) {
if (!xec)
pr_cont("System Read Data Error.\n");
else
pr_cont(" Internal error condition type %d.\n", xec);
} else if (INT_ERROR(ec)) {
if (xec <= 0x1f)
pr_cont("Hardware Assert.\n");
else
ret = false;
} else
Annotation
- Immediate include surface: `linux/module.h`, `linux/slab.h`, `asm/cpu.h`, `asm/msr.h`, `mce_amd.h`.
- Detected declarations: `function amd_register_ecc_decoder`, `function amd_unregister_ecc_decoder`, `function f12h_mc0_mce`, `function f10h_mc0_mce`, `function k8_mc0_mce`, `function cat_mc0_mce`, `function f15h_mc0_mce`, `function decode_mc0_mce`, `function k8_mc1_mce`, `function cat_mc1_mce`.
- Atlas domain: Driver Families / drivers/edac.
- Implementation status: integration 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.