drm/i915/pxp: don't start pxp without mei_pxp bind
authorJuston Li <justonli@chromium.org>
Thu, 18 Aug 2022 17:42:05 +0000 (17:42 +0000)
committerDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Thu, 25 Aug 2022 22:58:09 +0000 (15:58 -0700)
commit6127b3bcd33299cdebb79ffcc9c9ca135eaf763e
treeef84ee41832d63488e18202fd145af9f34076043
parent068a0f5c8260dcc4ccbaefd2dbf21ea84162ac17
drm/i915/pxp: don't start pxp without mei_pxp bind

pxp will not start correctly until after mei_pxp bind completes and
intel_pxp_init_hw() is called.
Wait for the bind to complete before proceeding with startup.

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

Changes since v2:
- wait for pxp_component to bind instead of returning -EAGAIN (Daniele)

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@chromium.org>
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220818174205.2412730-1-justonli@chromium.org
drivers/gpu/drm/i915/pxp/intel_pxp.c