Skip to content

Commit 8ae2723

Browse files
aalteresjohnharr-intel
authored andcommitted
drm/i915/pxp/mtl: Update pxp-firmware response timeout
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> Reviewed-by: Vivaik Balasubrawmanian <vivaik.balasubrawmanian@intel.com> Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230917211933.1407559-2-alan.previn.teres.alexis@intel.com
1 parent 4d938bb commit 8ae2723

4 files changed

Lines changed: 29 additions & 9 deletions

File tree

drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,17 @@ int intel_gsc_uc_heci_cmd_submit_packet(struct intel_gsc_uc *gsc, u64 addr_in,
8181

8282
i915_request_add(rq);
8383

84-
if (!err && i915_request_wait(rq, 0, msecs_to_jiffies(500)) < 0)
85-
err = -ETIME;
84+
if (!err) {
85+
/*
86+
* Start timeout for i915_request_wait only after considering one possible
87+
* pending GSC-HECI submission cycle on the other (non-privileged) path.
88+
*/
89+
if (wait_for(i915_request_started(rq), GSC_HECI_REPLY_LATENCY_MS))
90+
drm_dbg(&gsc_uc_to_gt(gsc)->i915->drm,
91+
"Delay in gsc-heci-priv submission to gsccs-hw");
92+
if (i915_request_wait(rq, 0, msecs_to_jiffies(GSC_HECI_REPLY_LATENCY_MS)) < 0)
93+
err = -ETIME;
94+
}
8695

8796
i915_request_put(rq);
8897

@@ -186,6 +195,13 @@ intel_gsc_uc_heci_cmd_submit_nonpriv(struct intel_gsc_uc *gsc,
186195
i915_request_add(rq);
187196

188197
if (!err) {
198+
/*
199+
* Start timeout for i915_request_wait only after considering one possible
200+
* pending GSC-HECI submission cycle on the other (privileged) path.
201+
*/
202+
if (wait_for(i915_request_started(rq), GSC_HECI_REPLY_LATENCY_MS))
203+
drm_dbg(&gsc_uc_to_gt(gsc)->i915->drm,
204+
"Delay in gsc-heci-non-priv submission to gsccs-hw");
189205
if (i915_request_wait(rq, I915_WAIT_INTERRUPTIBLE,
190206
msecs_to_jiffies(timeout_ms)) < 0)
191207
err = -ETIME;

drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ struct i915_vma;
1212
struct intel_context;
1313
struct intel_gsc_uc;
1414

15+
#define GSC_HECI_REPLY_LATENCY_MS 500
16+
/*
17+
* Max FW response time is 500ms, but this should be counted from the time the
18+
* command has hit the GSC-CS hardware, not the preceding handoff to GuC CTB.
19+
*/
20+
1521
struct intel_gsc_mtl_header {
1622
u32 validity_marker;
1723
#define GSC_HECI_VALIDITY_MARKER 0xA578875A

drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ gsccs_send_message(struct intel_pxp *pxp,
111111

112112
ret = intel_gsc_uc_heci_cmd_submit_nonpriv(&gt->uc.gsc,
113113
exec_res->ce, &pkt, exec_res->bb_vaddr,
114-
GSC_REPLY_LATENCY_MS);
114+
GSC_HECI_REPLY_LATENCY_MS);
115115
if (ret) {
116116
drm_err(&i915->drm, "failed to send gsc PXP msg (%d)\n", ret);
117117
goto unlock;

drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@
88

99
#include <linux/types.h>
1010

11+
#include "gt/uc/intel_gsc_uc_heci_cmd_submit.h"
12+
1113
struct intel_pxp;
1214

13-
#define GSC_REPLY_LATENCY_MS 210
14-
/*
15-
* Max FW response time is 200ms, to which we add 10ms to account for overhead
16-
* such as request preparation, GuC submission to hw and pipeline completion times.
17-
*/
1815
#define GSC_PENDING_RETRY_MAXCOUNT 40
1916
#define GSC_PENDING_RETRY_PAUSE_MS 50
20-
#define GSCFW_MAX_ROUND_TRIP_LATENCY_MS (GSC_PENDING_RETRY_MAXCOUNT * GSC_PENDING_RETRY_PAUSE_MS)
17+
#define GSCFW_MAX_ROUND_TRIP_LATENCY_MS (GSC_HECI_REPLY_LATENCY_MS + \
18+
(GSC_PENDING_RETRY_MAXCOUNT * GSC_PENDING_RETRY_PAUSE_MS))
2119

2220
#ifdef CONFIG_DRM_I915_PXP
2321
void intel_pxp_gsccs_fini(struct intel_pxp *pxp);

0 commit comments

Comments
 (0)