Skip to content

Commit 663a50c

Browse files
yanzhao56zhenyw
authored andcommitted
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. Fixes: 2707e44 ("drm/i915/gvt: vGPU graphics memory virtualization") Cc: [email protected] Cc: [email protected] #4.14+ Signed-off-by: Yan Zhao <[email protected]> Signed-off-by: Zhenyu Wang <[email protected]>
1 parent dade58e commit 663a50c

File tree

1 file changed

+1
-1
lines changed
  • drivers/gpu/drm/i915/gvt

1 file changed

+1
-1
lines changed

drivers/gpu/drm/i915/gvt/gtt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1946,7 +1946,7 @@ void _intel_vgpu_mm_release(struct kref *mm_ref)
19461946
*/
19471947
void intel_vgpu_unpin_mm(struct intel_vgpu_mm *mm)
19481948
{
1949-
atomic_dec(&mm->pincount);
1949+
atomic_dec_if_positive(&mm->pincount);
19501950
}
19511951

19521952
/**

0 commit comments

Comments
 (0)