drivers/accel/habanalabs/common/debugfs.c
Source file repositories/reference/linux-study-clean/drivers/accel/habanalabs/common/debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/accel/habanalabs/common/debugfs.c- Extension
.c- Size
- 57112 bytes
- Lines
- 2251
- Domain
- Driver Families
- Bucket
- drivers/accel
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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
habanalabs.hhldio.h../include/hw_ip/mmu/mmu_general.hlinux/pci.hlinux/uaccess.hlinux/vmalloc.hlinux/iommu.h
Detected Declarations
function hl_debugfs_i2c_readfunction hl_debugfs_i2c_writefunction hl_debugfs_led_setfunction command_buffers_showfunction list_for_each_entryfunction command_submission_showfunction list_for_each_entryfunction command_submission_jobs_showfunction list_for_each_entryfunction userptr_showfunction list_for_each_entryfunction vm_showfunction list_for_each_entryfunction hash_for_eachfunction list_for_each_entryfunction idr_for_each_entryfunction list_for_each_entryfunction userptr_lookup_showfunction list_for_each_entryfunction for_each_sgtable_dma_sgfunction userptr_lookup_writefunction mmu_showfunction mmu_asid_va_writefunction mmu_ack_errorfunction mmu_ack_error_value_writefunction engines_showfunction dio_ssd2hl_showfunction dio_ssd2hl_writefunction dio_hl2ssd_showfunction dio_hl2ssd_writefunction dio_stats_showfunction dio_reset_showfunction dio_reset_writefunction hl_memory_scrubfunction hl_is_device_vafunction hl_is_device_internal_memory_vafunction device_va_to_pafunction hl_access_dev_mem_by_regionfunction hl_access_host_memfunction dump_cfg_access_entryfunction hl_debugfs_cfg_access_history_dumpfunction check_if_cfg_access_and_logfunction hl_access_memfunction hl_data_read32function hl_data_write32function hl_data_read64function hl_data_write64function hl_dma_size_write
Annotated Snippet
static const struct file_operations hl_mem_scrub_fops = {
.owner = THIS_MODULE,
.write = hl_memory_scrub,
};
static const struct file_operations hl_data32b_fops = {
.owner = THIS_MODULE,
.read = hl_data_read32,
.write = hl_data_write32
};
static const struct file_operations hl_data64b_fops = {
.owner = THIS_MODULE,
.read = hl_data_read64,
.write = hl_data_write64
};
static const struct file_operations hl_dma_size_fops = {
.owner = THIS_MODULE,
.write = hl_dma_size_write
};
static const struct file_operations hl_monitor_dump_fops = {
.owner = THIS_MODULE,
.write = hl_monitor_dump_trigger
};
static const struct file_operations hl_i2c_data_fops = {
.owner = THIS_MODULE,
.read = hl_i2c_data_read,
.write = hl_i2c_data_write
};
static const struct file_operations hl_power_fops = {
.owner = THIS_MODULE,
.read = hl_get_power_state,
.write = hl_set_power_state
};
static const struct file_operations hl_led0_fops = {
.owner = THIS_MODULE,
.write = hl_led0_write
};
static const struct file_operations hl_led1_fops = {
.owner = THIS_MODULE,
.write = hl_led1_write
};
static const struct file_operations hl_led2_fops = {
.owner = THIS_MODULE,
.write = hl_led2_write
};
static const struct file_operations hl_device_fops = {
.owner = THIS_MODULE,
.read = hl_device_read,
.write = hl_device_write
};
static const struct file_operations hl_clk_gate_fops = {
.owner = THIS_MODULE,
.read = hl_clk_gate_read,
.write = hl_clk_gate_write
};
static const struct file_operations hl_stop_on_err_fops = {
.owner = THIS_MODULE,
.read = hl_stop_on_err_read,
.write = hl_stop_on_err_write
};
static const struct file_operations hl_security_violations_fops = {
.owner = THIS_MODULE,
.read = hl_security_violations_read
};
static const struct file_operations hl_state_dump_fops = {
.owner = THIS_MODULE,
.read = hl_state_dump_read,
.write = hl_state_dump_write
};
static const struct file_operations hl_timeout_locked_fops = {
.owner = THIS_MODULE,
.read = hl_timeout_locked_read,
.write = hl_timeout_locked_write
};
static const struct file_operations hl_razwi_check_fops = {
Annotation
- Immediate include surface: `habanalabs.h`, `hldio.h`, `../include/hw_ip/mmu/mmu_general.h`, `linux/pci.h`, `linux/uaccess.h`, `linux/vmalloc.h`, `linux/iommu.h`.
- Detected declarations: `function hl_debugfs_i2c_read`, `function hl_debugfs_i2c_write`, `function hl_debugfs_led_set`, `function command_buffers_show`, `function list_for_each_entry`, `function command_submission_show`, `function list_for_each_entry`, `function command_submission_jobs_show`, `function list_for_each_entry`, `function userptr_show`.
- Atlas domain: Driver Families / drivers/accel.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.