drivers/edac/edac_pci.c
Source file repositories/reference/linux-study-clean/drivers/edac/edac_pci.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/edac/edac_pci.c- Extension
.c- Size
- 7473 bytes
- Lines
- 338
- 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.
- 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
asm/page.hlinux/uaccess.hlinux/ctype.hlinux/highmem.hlinux/init.hlinux/module.hlinux/slab.hlinux/smp.hlinux/spinlock.hlinux/sysctl.hlinux/timer.hedac_pci.hedac_module.h
Detected Declarations
struct edac_pci_gen_datafunction edac_pci_free_ctl_infofunction find_edac_pci_by_devfunction list_for_eachfunction add_edac_pci_to_global_listfunction del_edac_pci_from_global_listfunction edac_pci_workq_functionfunction edac_pci_alloc_indexfunction edac_pci_add_devicefunction edac_pci_generic_checkfunction edac_pci_release_generic_ctlexport edac_pci_alloc_ctl_infoexport edac_pci_free_ctl_infoexport edac_pci_alloc_indexexport edac_pci_add_deviceexport edac_pci_del_deviceexport edac_pci_create_generic_ctlexport edac_pci_release_generic_ctl
Annotated Snippet
struct edac_pci_gen_data {
int edac_idx;
};
struct edac_pci_ctl_info *edac_pci_create_generic_ctl(struct device *dev,
const char *mod_name)
{
struct edac_pci_ctl_info *pci;
struct edac_pci_gen_data *pdata;
pci = edac_pci_alloc_ctl_info(sizeof(*pdata), EDAC_PCI_GENCTL_NAME);
if (!pci)
return NULL;
pdata = pci->pvt_info;
pci->dev = dev;
dev_set_drvdata(pci->dev, pci);
pci->dev_name = pci_name(to_pci_dev(dev));
pci->mod_name = mod_name;
pci->ctl_name = EDAC_PCI_GENCTL_NAME;
if (edac_op_state == EDAC_OPSTATE_POLL)
pci->edac_check = edac_pci_generic_check;
pdata->edac_idx = edac_pci_idx++;
if (edac_pci_add_device(pci, pdata->edac_idx) > 0) {
edac_dbg(3, "failed edac_pci_add_device()\n");
edac_pci_free_ctl_info(pci);
return NULL;
}
return pci;
}
EXPORT_SYMBOL_GPL(edac_pci_create_generic_ctl);
void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci)
{
edac_dbg(0, "pci mod=%s\n", pci->mod_name);
edac_pci_del_device(pci->dev);
edac_pci_free_ctl_info(pci);
}
EXPORT_SYMBOL_GPL(edac_pci_release_generic_ctl);
Annotation
- Immediate include surface: `asm/page.h`, `linux/uaccess.h`, `linux/ctype.h`, `linux/highmem.h`, `linux/init.h`, `linux/module.h`, `linux/slab.h`, `linux/smp.h`.
- Detected declarations: `struct edac_pci_gen_data`, `function edac_pci_free_ctl_info`, `function find_edac_pci_by_dev`, `function list_for_each`, `function add_edac_pci_to_global_list`, `function del_edac_pci_from_global_list`, `function edac_pci_workq_function`, `function edac_pci_alloc_index`, `function edac_pci_add_device`, `function edac_pci_generic_check`.
- Atlas domain: Driver Families / drivers/edac.
- Implementation status: integration 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.