瀏覽代碼

disp: msm: sde: update atomic check for VM_REQ_ACQUIRE state

Following is the sequence during which issue is observed:

1) HAL sends a commit with VM_REQ_RELEASE property set
indicating transition from primary vm to trusted vm.

2) Before the transition commit ends, there is atomic check
for next commit from HAL with VM_REQ_ACQUIRE property
indicating transition from trusted vm to primary vm.

3) Since the HW is currently owned by the primary vm, it
performs a early return during check phase. After this,
transition has occurred from primary to trusted and when
the next commit is scheduled on primary, it results in
crash since it is currently not the owner.

This change adds necessary to check avoid commit with
VM_REQ_ACQUIRE state before the transition.

Change-Id: I4650305a95ef6bc495375a21a799522e67a61883
Signed-off-by: Yashwanth <[email protected]>
Yashwanth 3 年之前
父節點
當前提交
c5ed579309
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      msm/sde/sde_vm_common.c

+ 2 - 1
msm/sde/sde_vm_common.c

@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -318,7 +319,7 @@ int sde_vm_request_valid(struct sde_kms *sde_kms,
 			rc = -EINVAL;
 		break;
 	case VM_REQ_ACQUIRE:
-		if (old_state != VM_REQ_RELEASE)
+		if ((old_state != VM_REQ_RELEASE) || vm_owns_hw)
 			rc = -EINVAL;
 		break;
 	default: