From: "Balasubrawmanian, Vivaik" <vivaik.balasubrawmanian@intel.com>
To: <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH v5 1/3] drm/i915/pxp/mtl: Update pxp-firmware response timeout
Date: Thu, 14 Sep 2023 15:25:35 -0700 [thread overview]
Message-ID: <cbb8a2d2-dfa0-5658-515e-220d4cbdcdff@intel.com> (raw)
In-Reply-To: <20230909223848.427849-2-alan.previn.teres.alexis@intel.com>
On 9/9/2023 3:38 PM, Alan Previn wrote:
> Update the max GSC-fw response time to match updated internal
> fw specs. Because this response time is an SLA on the firmware,
> not inclusive of i915->GuC->HW handoff latency, when submitting
> requests to the GSC fw via intel_gsc_uc_heci_cmd_submit helpers,
> start the count after the request hits the GSC command streamer.
> Also, move GSC_REPLY_LATENCY_MS definition from pxp header to
> intel_gsc_uc_heci_cmd_submit.h since its for any GSC HECI packet.
>
> Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
> ---
> .../i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c | 20 +++++++++++++++++--
> .../i915/gt/uc/intel_gsc_uc_heci_cmd_submit.h | 6 ++++++
> drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.h | 11 ++++++----
> 3 files changed, 31 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c b/drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c
> index 89ed5ee9cded..fe6a2f78cea0 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c
> @@ -81,8 +81,17 @@ int intel_gsc_uc_heci_cmd_submit_packet(struct intel_gsc_uc *gsc, u64 addr_in,
>
> i915_request_add(rq);
>
> - if (!err && i915_request_wait(rq, 0, msecs_to_jiffies(500)) < 0)
> - err = -ETIME;
> + if (!err) {
> + /*
> + * Start timeout for i915_request_wait only after considering one possible
> + * pending GSC-HECI submission cycle on the other (non-privileged) path.
> + */
> + if (wait_for(i915_request_started(rq), GSC_HECI_REPLY_LATENCY_MS))
> + drm_dbg(&gsc_uc_to_gt(gsc)->i915->drm,
> + "Delay in gsc-heci-priv submission to gsccs-hw");
> + if (i915_request_wait(rq, 0, msecs_to_jiffies(500)) < 0)
> + err = -ETIME;
> + }
>
> i915_request_put(rq);
>
> @@ -186,6 +195,13 @@ intel_gsc_uc_heci_cmd_submit_nonpriv(struct intel_gsc_uc *gsc,
> i915_request_add(rq);
>
> if (!err) {
> + /*
> + * Start timeout for i915_request_wait only after considering one possible
> + * pending GSC-HECI submission cycle on the other (privileged) path.
> + */
> + if (wait_for(i915_request_started(rq), GSC_HECI_REPLY_LATENCY_MS))
> + drm_dbg(&gsc_uc_to_gt(gsc)->i915->drm,
> + "Delay in gsc-heci-non-priv submission to gsccs-hw");
> if (i915_request_wait(rq, I915_WAIT_INTERRUPTIBLE,
> msecs_to_jiffies(timeout_ms)) < 0)
> err = -ETIME;
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.h b/drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.h
> index 09d3fbdad05a..5ae5c5d9608b 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.h
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.h
> @@ -12,6 +12,12 @@ struct i915_vma;
> struct intel_context;
> struct intel_gsc_uc;
>
> +#define GSC_HECI_REPLY_LATENCY_MS 350
> +/*
> + * Max FW response time is 350ms, but this should be counted from the time the
> + * command has hit the GSC-CS hardware, not the preceding handoff to GuC CTB.
> + */
> +
> struct intel_gsc_mtl_header {
> u32 validity_marker;
> #define GSC_HECI_VALIDITY_MARKER 0xA578875A
> diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.h b/drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.h
> index 298ad38e6c7d..a4f17b3ea286 100644
> --- a/drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.h
> +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.h
> @@ -8,16 +8,19 @@
>
> #include <linux/types.h>
>
> +#include "gt/uc/intel_gsc_uc_heci_cmd_submit.h"
> +
> struct intel_pxp;
>
> -#define GSC_REPLY_LATENCY_MS 210
> +#define GSC_REPLY_LATENCY_MS GSC_HECI_REPLY_LATENCY_MS
> /*
> - * Max FW response time is 200ms, to which we add 10ms to account for overhead
> - * such as request preparation, GuC submission to hw and pipeline completion times.
> + * Max FW response time is 350ms, but this should be counted from the time the
> + * command has hit the GSC-CS hardware, not the preceding handoff to GuC CTB.
> */
> #define GSC_PENDING_RETRY_MAXCOUNT 40
> #define GSC_PENDING_RETRY_PAUSE_MS 50
> -#define GSCFW_MAX_ROUND_TRIP_LATENCY_MS (GSC_PENDING_RETRY_MAXCOUNT * GSC_PENDING_RETRY_PAUSE_MS)
> +#define GSCFW_MAX_ROUND_TRIP_LATENCY_MS (GSC_REPLY_LATENCY_MS + \
> + (GSC_PENDING_RETRY_MAXCOUNT * GSC_PENDING_RETRY_PAUSE_MS))
>
> #ifdef CONFIG_DRM_I915_PXP
> void intel_pxp_gsccs_fini(struct intel_pxp *pxp);
Reviewed-by: Balasubrawmanian, Vivaik
<vivaik.balasubrawmanian@intel.com>
<mailto:vivaik.balasubrawmanian@intel.com>
next prev parent reply other threads:[~2023-09-14 22:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-09 22:38 [PATCH v5 0/3] drm/i915/pxp/mtl: Update gsc-heci cmd submission to align with fw/hw spec Alan Previn
2023-09-09 22:38 ` [PATCH v5 1/3] drm/i915/pxp/mtl: Update pxp-firmware response timeout Alan Previn
2023-09-14 22:25 ` Balasubrawmanian, Vivaik [this message]
2023-09-15 17:30 ` Teres Alexis, Alan Previn
2023-09-15 17:58 ` Teres Alexis, Alan Previn
2023-09-09 22:38 ` [PATCH v5 2/3] drm/i915/pxp/mtl: Update pxp-firmware packet size Alan Previn
2023-09-15 17:28 ` Teres Alexis, Alan Previn
2023-09-15 18:02 ` Teres Alexis, Alan Previn
2023-09-09 22:38 ` [PATCH v5 3/3] drm/i915/lrc: User PXP contexts requires runalone bit in lrc Alan Previn
2023-09-14 22:51 ` Balasubrawmanian, Vivaik
2023-09-15 18:04 ` Teres Alexis, Alan Previn
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=cbb8a2d2-dfa0-5658-515e-220d4cbdcdff@intel.com \
--to=vivaik.balasubrawmanian@intel.com \
--cc=dri-devel@lists.freedesktop.org \
/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