drm/i915/gvt: do not deliver a workload if its creation fails
PATCH v2 1/2 drm/i915/gvt: do not deliver a workload if its creation fails
in workload creation routine, if any failure occurs, do not queue this workload for delivery. if this failure is fatal, enter into failsafe mode.
v2: add fixes tag and cc stable kernel (zhenyu wang)
scheduler.c")
--- drivers/gpu/drm/i915/gvt/scheduler.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gvt/scheduler.c +3 -2
@@ -1503,8 +1503,9 @@ intel_vgpu_create_workload(struct intel_vgpu *vgpu, int ring_id,intel_runtime_pm_put_unchecked (dev_priv); } -if (ret && (vgpu_is_vm_unhealthy (ret))) { -enter_failsafe_mode (vgpu,GVT_FAILSAFE_GUEST_ERR ); +if (ret) { +if (vgpu_is_vm_unhealthy (ret)) +enter_failsafe_mode (vgpu,GVT_FAILSAFE_GUEST_ERR );intel_vgpu_destroy_workload (workload);return ERR_PTR (ret); }
Signature · 1 line
2.17.1
PATCH v2 2/2 drm/i915/gvt: do not let pin count of shadow mm go negative
shadow mm's pin count got increased in workload preparation phase, which is after workload scanning.
it will get decreased in complete_current_workload() anyway after workload completion.
Sometimes, if a workload meets a scanning error, its shadow mm pin count will not get increased but will get decreased in the end. This patch lets shadow mm's pin count not go below 0.
v2: add fixes tag and cc stable kernel (zhenyu wang)
--- drivers/gpu/drm/i915/gvt/gtt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/gvt/gtt.c +1 -1
@@ -1946,7 +1946,7 @@ void _intel_vgpu_mm_release(struct kref *mm_ref)*/ void intel_vgpu_unpin_mm (struct intel_vgpu_mm *mm) { -atomic_dec (&mm->pincount); +atomic_dec_if_positive (&mm->pincount); }/**
Signature · 1 line
2.17.1