drm/xe/vf: Update pause/unpause() helpers with VF naming

Now that pause/unpause() helpers have been updated for VF migration
usecase, update their naming to match the functionality and while at it,
add IS_SRIOV_VF() assert to make sure they are not abused.

v7: Add IS_SRIOV_VF() assert (Matthew Brost)
    Use "vf" suffix (Michal)

Suggested-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Link: https://patch.msgid.link/20251030122357.128825-2-raag.jadav@intel.com
This commit is contained in:
Raag Jadav 2025-10-30 17:53:54 +05:30 committed by Ashutosh Dixit
parent 8e2610d9a5
commit 99234edab8
3 changed files with 16 additions and 12 deletions

View File

@ -1128,7 +1128,7 @@ static bool vf_post_migration_shutdown(struct xe_gt *gt)
spin_unlock_irq(&gt->sriov.vf.migration.lock);
xe_guc_ct_flush_and_stop(&gt->uc.guc.ct);
xe_guc_submit_pause(&gt->uc.guc);
xe_guc_submit_pause_vf(&gt->uc.guc);
xe_tlb_inval_reset(&gt->tlb_inval);
return false;
@ -1163,12 +1163,12 @@ static int vf_post_migration_fixups(struct xe_gt *gt)
static void vf_post_migration_rearm(struct xe_gt *gt)
{
xe_guc_ct_restart(&gt->uc.guc.ct);
xe_guc_submit_unpause_prepare(&gt->uc.guc);
xe_guc_submit_unpause_prepare_vf(&gt->uc.guc);
}
static void vf_post_migration_kickstart(struct xe_gt *gt)
{
xe_guc_submit_unpause(&gt->uc.guc);
xe_guc_submit_unpause_vf(&gt->uc.guc);
}
static void vf_post_migration_abort(struct xe_gt *gt)

View File

@ -2169,14 +2169,15 @@ static void guc_exec_queue_pause(struct xe_guc *guc, struct xe_exec_queue *q)
}
/**
* xe_guc_submit_pause - Stop further runs of submission tasks on given GuC.
* xe_guc_submit_pause_vf - Stop further runs of submission tasks for VF.
* @guc: the &xe_guc struct instance whose scheduler is to be disabled
*/
void xe_guc_submit_pause(struct xe_guc *guc)
void xe_guc_submit_pause_vf(struct xe_guc *guc)
{
struct xe_exec_queue *q;
unsigned long index;
xe_gt_assert(guc_to_gt(guc), IS_SRIOV_VF(guc_to_xe(guc)));
xe_gt_assert(guc_to_gt(guc), vf_recovery(guc));
mutex_lock(&guc->submission_state.lock);
@ -2267,14 +2268,15 @@ static void guc_exec_queue_unpause_prepare(struct xe_guc *guc,
}
/**
* xe_guc_submit_unpause_prepare - Prepare unpause submission tasks on given GuC.
* xe_guc_submit_unpause_prepare_vf - Prepare unpause submission tasks for VF.
* @guc: the &xe_guc struct instance whose scheduler is to be prepared for unpause
*/
void xe_guc_submit_unpause_prepare(struct xe_guc *guc)
void xe_guc_submit_unpause_prepare_vf(struct xe_guc *guc)
{
struct xe_exec_queue *q;
unsigned long index;
xe_gt_assert(guc_to_gt(guc), IS_SRIOV_VF(guc_to_xe(guc)));
xe_gt_assert(guc_to_gt(guc), vf_recovery(guc));
mutex_lock(&guc->submission_state.lock);
@ -2342,14 +2344,16 @@ static void guc_exec_queue_unpause(struct xe_guc *guc, struct xe_exec_queue *q)
}
/**
* xe_guc_submit_unpause - Allow further runs of submission tasks on given GuC.
* xe_guc_submit_unpause_vf - Allow further runs of submission tasks for VF.
* @guc: the &xe_guc struct instance whose scheduler is to be enabled
*/
void xe_guc_submit_unpause(struct xe_guc *guc)
void xe_guc_submit_unpause_vf(struct xe_guc *guc)
{
struct xe_exec_queue *q;
unsigned long index;
xe_gt_assert(guc_to_gt(guc), IS_SRIOV_VF(guc_to_xe(guc)));
mutex_lock(&guc->submission_state.lock);
xa_for_each(&guc->submission_state.exec_queue_lookup, index, q) {
/*

View File

@ -20,10 +20,10 @@ int xe_guc_submit_reset_prepare(struct xe_guc *guc);
void xe_guc_submit_reset_wait(struct xe_guc *guc);
void xe_guc_submit_stop(struct xe_guc *guc);
int xe_guc_submit_start(struct xe_guc *guc);
void xe_guc_submit_pause(struct xe_guc *guc);
void xe_guc_submit_unpause(struct xe_guc *guc);
void xe_guc_submit_unpause_prepare(struct xe_guc *guc);
void xe_guc_submit_pause_abort(struct xe_guc *guc);
void xe_guc_submit_pause_vf(struct xe_guc *guc);
void xe_guc_submit_unpause_vf(struct xe_guc *guc);
void xe_guc_submit_unpause_prepare_vf(struct xe_guc *guc);
void xe_guc_submit_wedge(struct xe_guc *guc);
int xe_guc_read_stopped(struct xe_guc *guc);