فهرست منبع

disp: msm: sde: deallocate resources if TVM initalization fails

In the TUI use case, during VM acquisition, memory and IRQ
resources are transferred from the Primary VM to the Trusted VM.
However, there may be situations where the resource
initialization on the Trusted VM fails, causing the atomic check
to fail while it still holds the resources. During VM release,
this scenario causes resource reclamation to fail on the Primary
VM. This change ensures that the acquired resources are released
if the Trusted VM resource initialization fails.

Change-Id: I5f1cfe63a3c6580e4dc3f10f36ff15d5d2432adf
Signed-off-by: Akash Gajjar <[email protected]>
Akash Gajjar 1 سال پیش
والد
کامیت
437760d19d
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      msm/sde/sde_kms.c

+ 4 - 1
msm/sde/sde_kms.c

@@ -3058,8 +3058,11 @@ static int _sde_kms_validate_vm_request(struct drm_atomic_state *state, struct s
 			return rc;
 		}
 
-		if (vm_ops->vm_resource_init)
+		if (vm_ops->vm_resource_init) {
 			rc = vm_ops->vm_resource_init(sde_kms, state);
+			if (rc && vm_ops->vm_release)
+				rc = vm_ops->vm_release(sde_kms);
+		}
 	}
 
 	return rc;