drivers/dma/idxd/sysfs.c
Source file repositories/reference/linux-study-clean/drivers/dma/idxd/sysfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/dma/idxd/sysfs.c- Extension
.c- Size
- 50209 bytes
- Lines
- 2009
- Domain
- Driver Families
- Bucket
- drivers/dma
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/init.hlinux/kernel.hlinux/module.hlinux/pci.hlinux/device.hlinux/io-64-nonatomic-lo-hi.huapi/linux/idxd.hregisters.hidxd.h
Detected Declarations
function engine_group_id_showfunction engine_group_id_storefunction idxd_conf_engine_releasefunction idxd_set_free_rdbufsfunction group_read_buffers_reserved_showfunction group_tokens_reserved_showfunction group_read_buffers_reserved_storefunction group_tokens_reserved_storefunction group_read_buffers_allowed_showfunction group_tokens_allowed_showfunction group_read_buffers_allowed_storefunction group_tokens_allowed_storefunction group_use_read_buffer_limit_showfunction group_use_token_limit_showfunction group_use_read_buffer_limit_storefunction group_use_token_limit_storefunction group_engines_showfunction group_work_queues_showfunction group_traffic_class_a_showfunction group_traffic_class_a_storefunction group_traffic_class_b_showfunction group_traffic_class_b_storefunction group_desc_progress_limit_showfunction group_desc_progress_limit_storefunction group_batch_progress_limit_showfunction group_batch_progress_limit_storefunction idxd_group_attr_progress_limit_invisiblefunction idxd_group_attr_read_buffers_invisiblefunction idxd_group_attr_visiblefunction idxd_conf_group_releasefunction wq_clients_showfunction wq_state_showfunction wq_group_id_showfunction wq_group_id_storefunction wq_mode_showfunction wq_mode_storefunction wq_size_showfunction total_claimed_wq_sizefunction wq_size_storefunction wq_priority_showfunction wq_priority_storefunction wq_block_on_fault_showfunction wq_block_on_fault_storefunction wq_threshold_showfunction wq_threshold_storefunction wq_type_showfunction wq_type_storefunction wq_name_show
Annotated Snippet
rc = device_add(engine_confdev(engine));
if (rc < 0)
goto cleanup;
}
return 0;
cleanup:
j = i - 1;
for (; i < idxd->max_engines; i++) {
engine = idxd->engines[i];
put_device(engine_confdev(engine));
}
while (j--) {
engine = idxd->engines[j];
device_unregister(engine_confdev(engine));
}
return rc;
}
static int idxd_register_group_devices(struct idxd_device *idxd)
{
struct idxd_group *group;
int i, j, rc;
for (i = 0; i < idxd->max_groups; i++) {
group = idxd->groups[i];
rc = device_add(group_confdev(group));
if (rc < 0)
goto cleanup;
}
return 0;
cleanup:
j = i - 1;
for (; i < idxd->max_groups; i++) {
group = idxd->groups[i];
put_device(group_confdev(group));
}
while (j--) {
group = idxd->groups[j];
device_unregister(group_confdev(group));
}
return rc;
}
static int idxd_register_wq_devices(struct idxd_device *idxd)
{
struct idxd_wq *wq;
int i, rc, j;
for (i = 0; i < idxd->max_wqs; i++) {
wq = idxd->wqs[i];
rc = device_add(wq_confdev(wq));
if (rc < 0)
goto cleanup;
}
return 0;
cleanup:
j = i - 1;
for (; i < idxd->max_wqs; i++) {
wq = idxd->wqs[i];
put_device(wq_confdev(wq));
}
while (j--) {
wq = idxd->wqs[j];
device_unregister(wq_confdev(wq));
}
return rc;
}
int idxd_register_devices(struct idxd_device *idxd)
{
struct device *dev = &idxd->pdev->dev;
int rc, i;
rc = device_add(idxd_confdev(idxd));
if (rc < 0)
return rc;
rc = idxd_register_wq_devices(idxd);
if (rc < 0) {
dev_dbg(dev, "WQ devices registering failed: %d\n", rc);
goto err_wq;
Annotation
- Immediate include surface: `linux/init.h`, `linux/kernel.h`, `linux/module.h`, `linux/pci.h`, `linux/device.h`, `linux/io-64-nonatomic-lo-hi.h`, `uapi/linux/idxd.h`, `registers.h`.
- Detected declarations: `function engine_group_id_show`, `function engine_group_id_store`, `function idxd_conf_engine_release`, `function idxd_set_free_rdbufs`, `function group_read_buffers_reserved_show`, `function group_tokens_reserved_show`, `function group_read_buffers_reserved_store`, `function group_tokens_reserved_store`, `function group_read_buffers_allowed_show`, `function group_tokens_allowed_show`.
- Atlas domain: Driver Families / drivers/dma.
- Implementation status: source 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.