Re: [PATCH] drm/i915/pxp: don't start pxp without mei_pxp bind

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 8/9/2022 3:57 PM, Juston Li wrote:
pxp will not start correctly until after mei_pxp bind completes and
intel_pxp_init_hw() is called.

Signed-off-by: Juston Li <justonli@xxxxxxxxxx>
---
  drivers/gpu/drm/i915/pxp/intel_pxp.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp.c b/drivers/gpu/drm/i915/pxp/intel_pxp.c
index 15311eaed848..3ef9e4e1870b 100644
--- a/drivers/gpu/drm/i915/pxp/intel_pxp.c
+++ b/drivers/gpu/drm/i915/pxp/intel_pxp.c
@@ -184,7 +184,7 @@ int intel_pxp_start(struct intel_pxp *pxp)
  {
  	int ret = 0;
- if (!intel_pxp_is_enabled(pxp))
+	if (!intel_pxp_is_enabled(pxp) || !pxp->pxp_component_added)

pxp_component_added being true only indicates that we've called component_add and not if the component is currently bound. For checking the current state of the component you can look at the pxp->pxp_component pointer, which is set/cleared on component bind/unbind. Note that pxp_component has to be accessed under pxp->tee_mutex.

Are you actually seeing a scenario where the user manages to submit before the bind is complete? the bind is async to i915, but I've always seen it complete before control was given to the user to start submitting.

Daniele

  		return -ENODEV;
mutex_lock(&pxp->arb_mutex);




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux