drivers/accel/ivpu/ivpu_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/accel/ivpu/ivpu_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/accel/ivpu/ivpu_debugfs.c- Extension
.c- Size
- 13466 bytes
- Lines
- 525
- 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.
- 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/debugfs.hlinux/fault-inject.hdrm/drm_debugfs.hdrm/drm_file.hdrm/drm_print.huapi/drm/ivpu_accel.hivpu_debugfs.hivpu_drv.hivpu_fw.hivpu_fw_log.hivpu_gem.hivpu_hw.hivpu_jsm_msg.hivpu_pm.hvpu_boot_api.h
Detected Declarations
function Copyrightfunction bo_list_showfunction fw_name_showfunction fw_version_showfunction fw_trace_capability_showfunction fw_trace_config_showfunction last_bootmode_showfunction reset_counter_showfunction reset_pending_showfunction firewall_irq_counter_showfunction engine_reset_counter_showfunction dvfs_mode_getfunction dvfs_mode_setfunction fw_dyndbg_fops_writefunction fw_log_showfunction fw_log_fops_openfunction fw_log_fops_writefunction fw_profiling_freq_fops_writefunction fw_trace_destination_mask_fops_writefunction fw_trace_hw_comp_mask_fops_writefunction fw_trace_level_fops_writefunction ivpu_force_recovery_fnfunction ivpu_reset_engine_fnfunction ivpu_resume_engine_fnfunction dct_active_getfunction dct_active_setfunction print_priority_bandfunction priority_bands_showfunction priority_bands_fops_openfunction priority_bands_fops_writefunction ivpu_debugfs_init
Annotated Snippet
static const struct file_operations fw_dyndbg_fops = {
.owner = THIS_MODULE,
.open = simple_open,
.write = fw_dyndbg_fops_write,
};
static int fw_log_show(struct seq_file *s, void *v)
{
struct ivpu_device *vdev = s->private;
struct drm_printer p = drm_seq_file_printer(s);
ivpu_fw_log_print(vdev, true, &p);
return 0;
}
static int fw_log_fops_open(struct inode *inode, struct file *file)
{
return single_open(file, fw_log_show, inode->i_private);
}
static ssize_t
fw_log_fops_write(struct file *file, const char __user *user_buf, size_t size, loff_t *pos)
{
struct seq_file *s = file->private_data;
struct ivpu_device *vdev = s->private;
if (!size)
return -EINVAL;
ivpu_fw_log_mark_read(vdev);
return size;
}
static const struct file_operations fw_log_fops = {
.owner = THIS_MODULE,
.open = fw_log_fops_open,
.write = fw_log_fops_write,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static ssize_t
fw_profiling_freq_fops_write(struct file *file, const char __user *user_buf,
size_t size, loff_t *pos)
{
struct ivpu_device *vdev = file->private_data;
bool enable;
int ret;
ret = kstrtobool_from_user(user_buf, size, &enable);
if (ret < 0)
return ret;
ivpu_hw_profiling_freq_drive(vdev, enable);
ret = pci_try_reset_function(to_pci_dev(vdev->drm.dev));
if (ret)
return ret;
return size;
}
static const struct file_operations fw_profiling_freq_fops = {
.owner = THIS_MODULE,
.open = simple_open,
.write = fw_profiling_freq_fops_write,
};
static ssize_t
fw_trace_destination_mask_fops_write(struct file *file, const char __user *user_buf,
size_t size, loff_t *pos)
{
struct ivpu_device *vdev = file->private_data;
struct ivpu_fw_info *fw = vdev->fw;
u32 trace_destination_mask;
int ret;
ret = kstrtou32_from_user(user_buf, size, 0, &trace_destination_mask);
if (ret < 0)
return ret;
fw->trace_destination_mask = trace_destination_mask;
ivpu_jsm_trace_set_config(vdev, fw->trace_level, trace_destination_mask,
fw->trace_hw_component_mask);
return size;
}
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/fault-inject.h`, `drm/drm_debugfs.h`, `drm/drm_file.h`, `drm/drm_print.h`, `uapi/drm/ivpu_accel.h`, `ivpu_debugfs.h`, `ivpu_drv.h`.
- Detected declarations: `function Copyright`, `function bo_list_show`, `function fw_name_show`, `function fw_version_show`, `function fw_trace_capability_show`, `function fw_trace_config_show`, `function last_bootmode_show`, `function reset_counter_show`, `function reset_pending_show`, `function firewall_irq_counter_show`.
- Atlas domain: Driver Families / drivers/accel.
- 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.