drivers/gpu/drm/xe/xe_sriov_pf_provision.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_sriov_pf_provision.c- Extension
.c- Size
- 14560 bytes
- Lines
- 573
- Domain
- Driver Families
- Bucket
- drivers/gpu
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
xe_assert.hxe_device.hxe_gt_sriov_pf_config.hxe_gt_sriov_pf_policy.hxe_lmtt.hxe_sriov.hxe_sriov_pf_helpers.hxe_sriov_pf_provision.hxe_sriov_pf_provision_types.hxe_sriov_printk.h
Detected Declarations
function pf_auto_provisioning_modefunction pf_provision_vfsfunction for_each_gtfunction pf_unprovision_vfsfunction pf_unprovision_all_vfsfunction xe_sriov_pf_provision_vfsfunction xe_sriov_pf_unprovision_vfsfunction pf_reprovision_defaultfunction for_each_gtfunction xe_sriov_pf_reprovision_defaultfunction xe_sriov_pf_provision_set_modefunction xe_sriov_pf_provision_bulk_apply_eqfunction for_each_gtfunction xe_sriov_pf_provision_apply_vf_eqfunction for_each_gtfunction pf_report_uncleanfunction xe_sriov_pf_provision_query_vf_eqfunction for_each_gtfunction xe_sriov_pf_provision_bulk_apply_ptfunction for_each_gtfunction xe_sriov_pf_provision_apply_vf_ptfunction for_each_gtfunction xe_sriov_pf_provision_query_vf_ptfunction for_each_gtfunction xe_sriov_pf_provision_bulk_apply_priorityfunction for_each_gtfunction xe_sriov_pf_provision_apply_vf_priorityfunction for_each_gtfunction xe_sriov_pf_provision_query_vf_priorityfunction for_each_gtfunction vram_per_tilefunction xe_sriov_pf_provision_bulk_apply_vramfunction for_each_tilefunction xe_sriov_pf_provision_apply_vf_vramfunction for_each_tilefunction xe_sriov_pf_provision_query_vf_vram
Annotated Snippet
if (xe_sriov_pf_num_vfs(xe)) {
xe_sriov_dbg(xe, "can't restore %s: VFs must be disabled!\n",
mode_to_string(mode));
return -EBUSY;
}
pf_unprovision_all_vfs(xe);
}
xe_sriov_dbg(xe, "mode %s changed to %s by %ps\n",
mode_to_string(xe->sriov.pf.provision.mode),
mode_to_string(mode), __builtin_return_address(0));
xe->sriov.pf.provision.mode = mode;
return 0;
}
/**
* xe_sriov_pf_provision_bulk_apply_eq() - Change execution quantum for all VFs and PF.
* @xe: the PF &xe_device
* @eq: execution quantum in [ms] to set
*
* Change execution quantum (EQ) provisioning on all tiles/GTs.
*
* This function can only be called on PF.
*
* Return: 0 on success or a negative error code on failure.
*/
int xe_sriov_pf_provision_bulk_apply_eq(struct xe_device *xe, u32 eq)
{
struct xe_gt *gt;
unsigned int id;
int result = 0;
int err;
guard(mutex)(xe_sriov_pf_master_mutex(xe));
for_each_gt(gt, xe, id) {
err = xe_gt_sriov_pf_config_bulk_set_exec_quantum_locked(gt, eq);
result = result ?: err;
}
return result;
}
/**
* xe_sriov_pf_provision_apply_vf_eq() - Change VF's execution quantum.
* @xe: the PF &xe_device
* @vfid: the VF identifier
* @eq: execution quantum in [ms] to set
*
* Change VF's execution quantum (EQ) provisioning on all tiles/GTs.
*
* This function can only be called on PF.
*
* Return: 0 on success or a negative error code on failure.
*/
int xe_sriov_pf_provision_apply_vf_eq(struct xe_device *xe, unsigned int vfid, u32 eq)
{
struct xe_gt *gt;
unsigned int id;
int result = 0;
int err;
guard(mutex)(xe_sriov_pf_master_mutex(xe));
for_each_gt(gt, xe, id) {
err = xe_gt_sriov_pf_config_set_exec_quantum_locked(gt, vfid, eq);
result = result ?: err;
}
return result;
}
static int pf_report_unclean(struct xe_gt *gt, unsigned int vfid,
const char *what, u32 found, u32 expected)
{
char name[8];
xe_sriov_dbg(gt_to_xe(gt), "%s on GT%u has %s=%u (expected %u)\n",
xe_sriov_function_name(vfid, name, sizeof(name)),
gt->info.id, what, found, expected);
return -EUCLEAN;
}
/**
* xe_sriov_pf_provision_query_vf_eq() - Query VF's execution quantum.
* @xe: the PF &xe_device
* @vfid: the VF identifier
* @eq: placeholder for the returned execution quantum in [ms]
*
* Query VF's execution quantum (EQ) provisioning from all tiles/GTs.
Annotation
- Immediate include surface: `xe_assert.h`, `xe_device.h`, `xe_gt_sriov_pf_config.h`, `xe_gt_sriov_pf_policy.h`, `xe_lmtt.h`, `xe_sriov.h`, `xe_sriov_pf_helpers.h`, `xe_sriov_pf_provision.h`.
- Detected declarations: `function pf_auto_provisioning_mode`, `function pf_provision_vfs`, `function for_each_gt`, `function pf_unprovision_vfs`, `function pf_unprovision_all_vfs`, `function xe_sriov_pf_provision_vfs`, `function xe_sriov_pf_unprovision_vfs`, `function pf_reprovision_default`, `function for_each_gt`, `function xe_sriov_pf_reprovision_default`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source 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.