drivers/edac/i7core_edac.c
Source file repositories/reference/linux-study-clean/drivers/edac/i7core_edac.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/edac/i7core_edac.c- Extension
.c- Size
- 62690 bytes
- Lines
- 2391
- Domain
- Driver Families
- Bucket
- drivers/edac
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/init.hlinux/pci.hlinux/pci_ids.hlinux/slab.hlinux/delay.hlinux/dmi.hlinux/edac.hlinux/mmzone.hlinux/smp.hasm/mce.hasm/processor.hasm/div64.hedac_module.h
Detected Declarations
struct i7core_infostruct i7core_injectstruct i7core_channelstruct pci_id_descrstruct pci_id_tablestruct i7core_devstruct i7core_pvtstruct memdev_dmi_entryfunction numdimmsfunction numrankfunction numbankfunction numrowfunction numcolfunction list_for_each_entryfunction free_i7core_devfunction get_dimm_configfunction disable_injectfunction i7core_inject_section_storefunction i7core_inject_section_showfunction i7core_inject_type_storefunction i7core_inject_type_showfunction errorfunction i7core_inject_eccmask_showfunction write_and_testfunction i7core_inject_enable_storefunction i7core_inject_enable_showfunction addrmatch_releasefunction all_channel_counts_releasefunction i7core_create_sysfs_devicesfunction i7core_delete_sysfs_devicesfunction i7core_put_devicesfunction i7core_put_all_devicesfunction list_for_each_entry_safefunction i7core_xeon_pci_fixupfunction i7core_pci_lastbusfunction i7core_get_onedevicefunction PCI_FUNCfunction i7core_get_all_devicesfunction mci_bind_devsfunction i7core_rdimm_update_ce_countfunction i7core_rdimm_check_mc_ecc_errfunction i7core_udimm_check_mc_ecc_errfunction i7core_mce_output_errorfunction i7core_check_errorfunction i7core_mce_check_errorfunction decode_dclkfunction get_dclk_freqfunction set_sdram_scrub_rate
Annotated Snippet
static struct pci_driver i7core_driver = {
.name = "i7core_edac",
.probe = i7core_probe,
.remove = i7core_remove,
.id_table = i7core_pci_tbl,
};
/*
* i7core_init Module entry function
* Try to initialize this module for its devices
*/
static int __init i7core_init(void)
{
int pci_rc;
edac_dbg(2, "\n");
/* Ensure that the OPSTATE is set correctly for POLL or NMI */
opstate_init();
if (use_pci_fixup)
i7core_xeon_pci_fixup(pci_dev_table);
pci_rc = pci_register_driver(&i7core_driver);
if (pci_rc >= 0) {
mce_register_decode_chain(&i7_mce_dec);
return 0;
}
i7core_printk(KERN_ERR, "Failed to register device with error %d.\n",
pci_rc);
return pci_rc;
}
/*
* i7core_exit() Module exit function
* Unregister the driver
*/
static void __exit i7core_exit(void)
{
edac_dbg(2, "\n");
pci_unregister_driver(&i7core_driver);
mce_unregister_decode_chain(&i7_mce_dec);
}
module_init(i7core_init);
module_exit(i7core_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Mauro Carvalho Chehab");
MODULE_AUTHOR("Red Hat Inc. (https://www.redhat.com)");
MODULE_DESCRIPTION("MC Driver for Intel i7 Core memory controllers - "
I7CORE_REVISION);
module_param(edac_op_state, int, 0444);
MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI");
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/pci.h`, `linux/pci_ids.h`, `linux/slab.h`, `linux/delay.h`, `linux/dmi.h`, `linux/edac.h`.
- Detected declarations: `struct i7core_info`, `struct i7core_inject`, `struct i7core_channel`, `struct pci_id_descr`, `struct pci_id_table`, `struct i7core_dev`, `struct i7core_pvt`, `struct memdev_dmi_entry`, `function numdimms`, `function numrank`.
- Atlas domain: Driver Families / drivers/edac.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.