From: "Ceraolo Spurio, Daniele" <daniele.ceraolospurio@intel.com>
To: Juston Li <justonli@google.com>, <intel-gfx@lists.freedesktop.org>
Cc: alan.previn.teres.alexis@intel.com
Subject: Re: [Intel-gfx] [PATCH v2] drm/i915/pxp: don't start pxp without mei_pxp bind
Date: Mon, 15 Aug 2022 08:35:30 -0700 [thread overview]
Message-ID: <3dd74afe-5f2c-32b5-d24f-a7458d3859bb@intel.com> (raw)
In-Reply-To: <20220810004253.3240393-1-justonli@google.com>
On 8/9/2022 5:42 PM, Juston Li wrote:
> 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)
Sorry for the follow up, but I have reflected on this a bit more and I
was thinking that maybe it would be better to wait a bit for the
component to be bound, instead of immediately failing the call. Do you
have a measure of how long after your failure you see the component bind
complete? The wait would make sense only if relatively short (< 1s).
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)
next prev parent reply other threads:[~2022-08-15 15:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Ceraolo Spurio, Daniele [this message]
2022-08-15 16:36 ` [Intel-gfx] [PATCH v2] drm/i915/pxp: don't start pxp without mei_pxp bind Juston Li
2022-08-15 20:20 ` Juston Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3dd74afe-5f2c-32b5-d24f-a7458d3859bb@intel.com \
--to=daniele.ceraolospurio@intel.com \
--cc=alan.previn.teres.alexis@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=justonli@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox