drivers/cxl/core/region_pmem.c
Source file repositories/reference/linux-study-clean/drivers/cxl/core/region_pmem.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/cxl/core/region_pmem.c- Extension
.c- Size
- 4858 bytes
- Lines
- 192
- Domain
- Driver Families
- Bucket
- drivers/cxl
- 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.
- 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/device.hlinux/slab.hcxlmem.hcxl.hcore.h
Detected Declarations
function cxl_pmem_region_releasefunction is_cxl_pmem_regionfunction cxl_pmem_region_allocfunction cxlr_pmem_unregisterfunction cxlr_release_nvdimmfunction scoped_guardfunction devm_cxl_add_pmem_regionfunction scoped_guard
Annotated Snippet
rc = device_add(dev);
if (rc)
goto err;
dev_dbg(&cxlr->dev, "%s: register %s\n", dev_name(dev->parent),
dev_name(dev));
scoped_guard(device, &cxl_nvb->dev) {
if (cxl_nvb->dev.driver)
rc = devm_add_action_or_reset(&cxl_nvb->dev,
cxlr_pmem_unregister,
cxlr_pmem);
else
rc = -ENXIO;
}
if (rc)
goto err_bridge;
/* @cxlr carries a reference on @cxl_nvb until cxlr_release_nvdimm */
return devm_add_action_or_reset(&cxlr->dev, cxlr_release_nvdimm, cxlr);
err:
put_device(dev);
err_bridge:
put_device(&cxl_nvb->dev);
cxlr->cxl_nvb = NULL;
return rc;
}
Annotation
- Immediate include surface: `linux/device.h`, `linux/slab.h`, `cxlmem.h`, `cxl.h`, `core.h`.
- Detected declarations: `function cxl_pmem_region_release`, `function is_cxl_pmem_region`, `function cxl_pmem_region_alloc`, `function cxlr_pmem_unregister`, `function cxlr_release_nvdimm`, `function scoped_guard`, `function devm_cxl_add_pmem_region`, `function scoped_guard`.
- Atlas domain: Driver Families / drivers/cxl.
- 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.