Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH v2] drm/i915/pxp: don't start pxp without mei_pxp bind
@ 2022-08-10  0:42 Juston Li
  2022-08-10  1:21 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/pxp: don't start pxp without mei_pxp bind (rev2) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Juston Li @ 2022-08-10  0:42 UTC (permalink / raw)
  To: intel-gfx; +Cc: alan.previn.teres.alexis

pxp will not start correctly until after mei_pxp bind completes and
intel_pxp_init_hw() is called.

This fixes a race condition during bootup where we observed a small
window for pxp commands to be sent before mei_pxp bind completed.

Changes since v1:
- check pxp_component instead of pxp_component_added (Daniele)
- pxp_component needs tee_mutex (Daniele)
- return -EAGAIN so caller knows to retry (Daniele)

Signed-off-by: Juston Li <justonli@google.com>
---
 drivers/gpu/drm/i915/pxp/intel_pxp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp.c b/drivers/gpu/drm/i915/pxp/intel_pxp.c
index 15311eaed848..8b395ebc430a 100644
--- a/drivers/gpu/drm/i915/pxp/intel_pxp.c
+++ b/drivers/gpu/drm/i915/pxp/intel_pxp.c
@@ -187,6 +187,14 @@ int intel_pxp_start(struct intel_pxp *pxp)
 	if (!intel_pxp_is_enabled(pxp))
 		return -ENODEV;
 
+	mutex_lock(&pxp->tee_mutex);
+	/* check if mei_pxp is bound */
+	if (!pxp->pxp_component) {
+		mutex_unlock(&pxp->tee_mutex);
+		return -EAGAIN;
+	}
+	mutex_unlock(&pxp->tee_mutex);
+
 	mutex_lock(&pxp->arb_mutex);
 
 	if (pxp->arb_is_valid)
-- 
2.37.1.559.g78731f0fdb-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-15 23:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-10  0:42 [Intel-gfx] [PATCH v2] drm/i915/pxp: don't start pxp without mei_pxp bind Juston Li
2022-08-10  1:21 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/pxp: don't start pxp without mei_pxp bind (rev2) Patchwork
2022-08-10  4:35 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-08-15 15:35 ` [Intel-gfx] [PATCH v2] drm/i915/pxp: don't start pxp without mei_pxp bind Ceraolo Spurio, Daniele
2022-08-15 16:36   ` Juston Li
2022-08-15 20:20   ` Juston Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox