diff options
author | Xiaolin Zhang <xiaolin.zhang@intel.com> | 2019-06-20 10:29:24 -0400 |
---|---|---|
committer | Zhenyu Wang <zhenyuw@linux.intel.com> | 2019-07-30 14:30:36 +0800 |
commit | ef5b0b444e6297d03ac0bdc0c82f65396ef4dccd (patch) | |
tree | 480b7ba3f10253732a941f16ad42c1af0ebb3832 /drivers/gpu/drm/i915/gvt/scheduler.c | |
parent | 7366aeb77cd840f3edea02c65065d40affaa7f45 (diff) | |
download | lwn-ef5b0b444e6297d03ac0bdc0c82f65396ef4dccd.tar.gz lwn-ef5b0b444e6297d03ac0bdc0c82f65396ef4dccd.zip |
drm/i915/gvt: grab runtime pm first for forcewake use
in workload_thread, it should grab runtime pm wakelock and later
uncore forcewake get will check rpm wakelock held successfully.
otherwise, sometimes, rpm wakelock not hold and print call trace below:
Call Trace:
intel_uncore_forcewake_get+0x15/0x20 [i915]
workload_thread+0x5f9/0x16f0 [i915]
? __switch_to_asm+0x34/0x70
? __switch_to_asm+0x40/0x70
? __switch_to_asm+0x34/0x70
? __switch_to_asm+0x40/0x70
? __switch_to_asm+0x34/0x70
? __switch_to+0x85/0x3f0
? __switch_to_asm+0x40/0x70
? do_wait_intr_irq+0x90/0x90
kthread+0x121/0x140
? intel_vgpu_clean_workloads+0x100/0x100 [i915]
? kthread_park+0x90/0x90
ret_from_fork+0x35/0x40
--[ end trace 86525f742a02e12c ]--
v2: adapted to use rpm structure.
Fixes: 251d46b0875c ("drm/i915/gvt: Pin the per-engine GVT shadow contexts")
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Xiaolin Zhang <xiaolin.zhang@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/gvt/scheduler.c')
-rw-r--r-- | drivers/gpu/drm/i915/gvt/scheduler.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c index 6469366c1753..196b4155a309 100644 --- a/drivers/gpu/drm/i915/gvt/scheduler.c +++ b/drivers/gpu/drm/i915/gvt/scheduler.c @@ -990,6 +990,7 @@ static int workload_thread(void *priv) int ret; bool need_force_wake = (INTEL_GEN(gvt->dev_priv) >= 9); DEFINE_WAIT_FUNC(wait, woken_wake_function); + struct intel_runtime_pm *rpm = &gvt->dev_priv->runtime_pm; kfree(p); @@ -1013,6 +1014,8 @@ static int workload_thread(void *priv) workload->ring_id, workload, workload->vgpu->id); + intel_runtime_pm_get(rpm); + gvt_dbg_sched("ring id %d will dispatch workload %p\n", workload->ring_id, workload); @@ -1042,6 +1045,7 @@ complete: intel_uncore_forcewake_put(&gvt->dev_priv->uncore, FORCEWAKE_ALL); + intel_runtime_pm_put_unchecked(rpm); if (ret && (vgpu_is_vm_unhealthy(ret))) enter_failsafe_mode(vgpu, GVT_FAILSAFE_GUEST_ERR); } |