Skip to content

Commit 0eec708

Browse files
aalteresjohnharr-intel
authored andcommitted
drm/i915/pxp: Add drm_dbgs for critical PXP events.
Debugging PXP issues can't even begin without understanding precedding sequence of important events. Add drm_dbg into the most important PXP events. v5 : - rebase. v4 : - rebase. v3 : - move gt_dbg to after mutex block in function i915_gsc_proxy_component_bind. (Vivaik) v2 : - remove __func__ since drm_dbg covers that (Jani). - add timeout dbg of the restart from front-end (Alan). 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/20231122191523.58379-1-alan.previn.teres.alexis@intel.com
1 parent 97137bd commit 0eec708

5 files changed

Lines changed: 23 additions & 6 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ static int i915_gsc_proxy_component_bind(struct device *i915_kdev,
322322
gsc->proxy.component = data;
323323
gsc->proxy.component->mei_dev = mei_kdev;
324324
mutex_unlock(&gsc->proxy.mutex);
325+
gt_dbg(gt, "GSC proxy mei component bound\n");
325326

326327
return 0;
327328
}
@@ -342,6 +343,7 @@ static void i915_gsc_proxy_component_unbind(struct device *i915_kdev,
342343
with_intel_runtime_pm(&i915->runtime_pm, wakeref)
343344
intel_uncore_rmw(gt->uncore, HECI_H_CSR(MTL_GSC_HECI2_BASE),
344345
HECI_H_CSR_IE | HECI_H_CSR_RST, 0);
346+
gt_dbg(gt, "GSC proxy mei component unbound\n");
345347
}
346348

347349
static const struct component_ops i915_gsc_proxy_component_ops = {

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,8 @@ static int __pxp_global_teardown_final(struct intel_pxp *pxp)
303303

304304
if (!pxp->arb_is_valid)
305305
return 0;
306+
307+
drm_dbg(&pxp->ctrl_gt->i915->drm, "PXP: teardown for suspend/fini");
306308
/*
307309
* To ensure synchronous and coherent session teardown completion
308310
* in response to suspend or shutdown triggers, don't use a worker.
@@ -324,6 +326,8 @@ static int __pxp_global_teardown_restart(struct intel_pxp *pxp)
324326

325327
if (pxp->arb_is_valid)
326328
return 0;
329+
330+
drm_dbg(&pxp->ctrl_gt->i915->drm, "PXP: teardown for restart");
327331
/*
328332
* The arb-session is currently inactive and we are doing a reset and restart
329333
* due to a runtime event. Use the worker that was designed for this.
@@ -332,8 +336,11 @@ static int __pxp_global_teardown_restart(struct intel_pxp *pxp)
332336

333337
timeout = intel_pxp_get_backend_timeout_ms(pxp);
334338

335-
if (!wait_for_completion_timeout(&pxp->termination, msecs_to_jiffies(timeout)))
339+
if (!wait_for_completion_timeout(&pxp->termination, msecs_to_jiffies(timeout))) {
340+
drm_dbg(&pxp->ctrl_gt->i915->drm, "PXP: restart backend timed out (%d ms)",
341+
timeout);
336342
return -ETIMEDOUT;
343+
}
337344

338345
return 0;
339346
}
@@ -414,10 +421,12 @@ int intel_pxp_start(struct intel_pxp *pxp)
414421
int ret = 0;
415422

416423
ret = intel_pxp_get_readiness_status(pxp, PXP_READINESS_TIMEOUT);
417-
if (ret < 0)
424+
if (ret < 0) {
425+
drm_dbg(&pxp->ctrl_gt->i915->drm, "PXP: tried but not-avail (%d)", ret);
418426
return ret;
419-
else if (ret > 1)
427+
} else if (ret > 1) {
420428
return -EIO; /* per UAPI spec, user may retry later */
429+
}
421430

422431
mutex_lock(&pxp->arb_mutex);
423432

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ void intel_pxp_irq_handler(struct intel_pxp *pxp, u16 iir)
4040
GEN12_DISPLAY_APP_TERMINATED_PER_FW_REQ_INTERRUPT)) {
4141
/* immediately mark PXP as inactive on termination */
4242
intel_pxp_mark_termination_in_progress(pxp);
43-
pxp->session_events |= PXP_TERMINATION_REQUEST | PXP_INVAL_REQUIRED;
43+
pxp->session_events |= PXP_TERMINATION_REQUEST | PXP_INVAL_REQUIRED |
44+
PXP_EVENT_TYPE_IRQ;
4445
}
4546

4647
if (iir & GEN12_DISPLAY_STATE_RESET_COMPLETE_INTERRUPT)
47-
pxp->session_events |= PXP_TERMINATION_COMPLETE;
48+
pxp->session_events |= PXP_TERMINATION_COMPLETE | PXP_EVENT_TYPE_IRQ;
4849

4950
if (pxp->session_events)
5051
queue_work(system_unbound_wq, &pxp->session_work);

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ void intel_pxp_terminate(struct intel_pxp *pxp, bool post_invalidation_needs_res
137137
static void pxp_terminate_complete(struct intel_pxp *pxp)
138138
{
139139
/* Re-create the arb session after teardown handle complete */
140-
if (fetch_and_zero(&pxp->hw_state_invalidated))
140+
if (fetch_and_zero(&pxp->hw_state_invalidated)) {
141+
drm_dbg(&pxp->ctrl_gt->i915->drm, "PXP: creating arb_session after invalidation");
141142
pxp_create_arb_session(pxp);
143+
}
142144

143145
complete_all(&pxp->termination);
144146
}
@@ -157,6 +159,8 @@ static void pxp_session_work(struct work_struct *work)
157159
if (!events)
158160
return;
159161

162+
drm_dbg(&gt->i915->drm, "PXP: processing event-flags 0x%08x", events);
163+
160164
if (events & PXP_INVAL_REQUIRED)
161165
intel_pxp_invalidate(pxp);
162166

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ struct intel_pxp {
124124
#define PXP_TERMINATION_REQUEST BIT(0)
125125
#define PXP_TERMINATION_COMPLETE BIT(1)
126126
#define PXP_INVAL_REQUIRED BIT(2)
127+
#define PXP_EVENT_TYPE_IRQ BIT(3)
127128
};
128129

129130
#endif /* __INTEL_PXP_TYPES_H__ */

0 commit comments

Comments
 (0)