drivers/gpu/drm/xe/xe_sriov_pf_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_sriov_pf_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_sriov_pf_debugfs.c- Extension
.c- Size
- 10814 bytes
- Lines
- 393
- Domain
- Driver Families
- Bucket
- drivers/gpu
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hdrm/drm_debugfs.hxe_device.hxe_device_types.hxe_pm.hxe_sriov_pf.hxe_sriov_pf_control.hxe_sriov_pf_debugfs.hxe_sriov_pf_helpers.hxe_sriov_pf_migration.hxe_sriov_pf_provision.hxe_sriov_pf_service.hxe_tile_sriov_pf_debugfs.h
Detected Declarations
function extract_vfidfunction from_file_write_to_xe_callfunction xe_sriov_pf_restore_auto_provisioningfunction lockdown_vfs_enabling_openfunction lockdown_vfs_enabling_releasefunction pf_populate_rootfunction simple_showfunction pf_populate_pffunction from_file_read_to_vf_callfunction from_file_write_to_vf_callfunction data_writefunction data_readfunction size_readfunction pf_populate_vffunction pf_populate_with_tilesfunction xe_sriov_pf_debugfs_register
Annotated Snippet
static const struct file_operations lockdown_vfs_enabling_fops = {
.owner = THIS_MODULE,
.open = lockdown_vfs_enabling_open,
.release = lockdown_vfs_enabling_release,
};
static void pf_populate_root(struct xe_device *xe, struct dentry *dent)
{
debugfs_create_file("restore_auto_provisioning", 0200, dent, xe,
&restore_auto_provisioning_fops);
debugfs_create_file("lockdown_vfs_enabling", 0400, dent, xe,
&lockdown_vfs_enabling_fops);
}
static int simple_show(struct seq_file *m, void *data)
{
struct drm_printer p = drm_seq_file_printer(m);
struct drm_info_node *node = m->private;
struct dentry *parent = node->dent->d_parent;
struct xe_device *xe = parent->d_inode->i_private;
void (*print)(struct xe_device *, struct drm_printer *) = node->info_ent->data;
print(xe, &p);
return 0;
}
static const struct drm_info_list debugfs_list[] = {
{ .name = "vfs", .show = simple_show, .data = xe_sriov_pf_print_vfs_summary },
{ .name = "versions", .show = simple_show, .data = xe_sriov_pf_service_print_versions },
};
static void pf_populate_pf(struct xe_device *xe, struct dentry *pfdent)
{
struct drm_minor *minor = xe->drm.primary;
drm_debugfs_create_files(debugfs_list, ARRAY_SIZE(debugfs_list), pfdent, minor);
}
/*
* /sys/kernel/debug/dri/BDF/
* ├── sriov
* │ ├── vf1
* │ │ ├── migration_data
* │ │ ├── pause
* │ │ ├── reset
* │ │ ├── resume
* │ │ ├── stop
* │ │ ├── save
* │ │ ├── restore
* │ │ :
* │ ├── vf2
* │ │ ├── ...
*/
static int from_file_read_to_vf_call(struct seq_file *s,
int (*call)(struct xe_device *, unsigned int))
{
struct dentry *dent = file_dentry(s->file)->d_parent;
struct xe_device *xe = extract_xe(dent);
unsigned int vfid = extract_vfid(dent);
int ret;
xe_pm_runtime_get(xe);
ret = call(xe, vfid);
xe_pm_runtime_put(xe);
if (ret < 0)
return ret;
return 0;
}
static ssize_t from_file_write_to_vf_call(struct file *file, const char __user *userbuf,
size_t count, loff_t *ppos,
int (*call)(struct xe_device *, unsigned int))
{
struct dentry *dent = file_dentry(file)->d_parent;
struct xe_device *xe = extract_xe(dent);
unsigned int vfid = extract_vfid(dent);
bool yes;
int ret;
if (*ppos)
return -EINVAL;
ret = kstrtobool_from_user(userbuf, count, &yes);
if (ret < 0)
return ret;
if (yes) {
guard(xe_pm_runtime)(xe);
ret = call(xe, vfid);
Annotation
- Immediate include surface: `linux/debugfs.h`, `drm/drm_debugfs.h`, `xe_device.h`, `xe_device_types.h`, `xe_pm.h`, `xe_sriov_pf.h`, `xe_sriov_pf_control.h`, `xe_sriov_pf_debugfs.h`.
- Detected declarations: `function extract_vfid`, `function from_file_write_to_xe_call`, `function xe_sriov_pf_restore_auto_provisioning`, `function lockdown_vfs_enabling_open`, `function lockdown_vfs_enabling_release`, `function pf_populate_root`, `function simple_show`, `function pf_populate_pf`, `function from_file_read_to_vf_call`, `function from_file_write_to_vf_call`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: pattern 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.