mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
drm/xe/pf: Don't resume device from restart worker
The PF's restart worker shouldn't attempt to resume the device on its own, since its goal is to finish PF and VFs reprovisioning on the recently reset GuC. Take extra RPM reference while scheduling a work and release it from the worker or when we cancel a work. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com> Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com> Link: https://lore.kernel.org/r/20250801142822.180530-4-michal.wajdeczko@intel.com
This commit is contained in:
parent
c6c86441c4
commit
9fd9f22144
|
|
@ -55,7 +55,12 @@ static void pf_init_workers(struct xe_gt *gt)
|
|||
static void pf_fini_workers(struct xe_gt *gt)
|
||||
{
|
||||
xe_gt_assert(gt, IS_SRIOV_PF(gt_to_xe(gt)));
|
||||
disable_work_sync(>->sriov.pf.workers.restart);
|
||||
|
||||
if (disable_work_sync(>->sriov.pf.workers.restart)) {
|
||||
xe_gt_sriov_dbg_verbose(gt, "pending restart disabled!\n");
|
||||
/* release an rpm reference taken on the worker's behalf */
|
||||
xe_pm_runtime_put(gt_to_xe(gt));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -207,8 +212,11 @@ static void pf_cancel_restart(struct xe_gt *gt)
|
|||
{
|
||||
xe_gt_assert(gt, IS_SRIOV_PF(gt_to_xe(gt)));
|
||||
|
||||
if (cancel_work_sync(>->sriov.pf.workers.restart))
|
||||
if (cancel_work_sync(>->sriov.pf.workers.restart)) {
|
||||
xe_gt_sriov_dbg_verbose(gt, "pending restart canceled!\n");
|
||||
/* release an rpm reference taken on the worker's behalf */
|
||||
xe_pm_runtime_put(gt_to_xe(gt));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -226,9 +234,12 @@ static void pf_restart(struct xe_gt *gt)
|
|||
{
|
||||
struct xe_device *xe = gt_to_xe(gt);
|
||||
|
||||
xe_pm_runtime_get(xe);
|
||||
xe_gt_assert(gt, !xe_pm_runtime_suspended(xe));
|
||||
|
||||
xe_gt_sriov_pf_config_restart(gt);
|
||||
xe_gt_sriov_pf_control_restart(gt);
|
||||
|
||||
/* release an rpm reference taken on our behalf */
|
||||
xe_pm_runtime_put(xe);
|
||||
|
||||
xe_gt_sriov_dbg(gt, "restart completed\n");
|
||||
|
|
@ -247,8 +258,13 @@ static void pf_queue_restart(struct xe_gt *gt)
|
|||
|
||||
xe_gt_assert(gt, IS_SRIOV_PF(xe));
|
||||
|
||||
if (!queue_work(xe->sriov.wq, >->sriov.pf.workers.restart))
|
||||
/* take an rpm reference on behalf of the worker */
|
||||
xe_pm_runtime_get_noresume(xe);
|
||||
|
||||
if (!queue_work(xe->sriov.wq, >->sriov.pf.workers.restart)) {
|
||||
xe_gt_sriov_dbg(gt, "restart already in queue!\n");
|
||||
xe_pm_runtime_put(xe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user