Commit 0eec708e authored by Alan Previn's avatar Alan Previn Committed by John Harrison

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: default avatarAlan Previn <alan.previn.teres.alexis@intel.com>
Reviewed-by: default avatarVivaik Balasubrawmanian <vivaik.balasubrawmanian@intel.com>
Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231122191523.58379-1-alan.previn.teres.alexis@intel.com
parent 97137bd3
...@@ -322,6 +322,7 @@ static int i915_gsc_proxy_component_bind(struct device *i915_kdev, ...@@ -322,6 +322,7 @@ static int i915_gsc_proxy_component_bind(struct device *i915_kdev,
gsc->proxy.component = data; gsc->proxy.component = data;
gsc->proxy.component->mei_dev = mei_kdev; gsc->proxy.component->mei_dev = mei_kdev;
mutex_unlock(&gsc->proxy.mutex); mutex_unlock(&gsc->proxy.mutex);
gt_dbg(gt, "GSC proxy mei component bound\n");
return 0; return 0;
} }
...@@ -342,6 +343,7 @@ static void i915_gsc_proxy_component_unbind(struct device *i915_kdev, ...@@ -342,6 +343,7 @@ static void i915_gsc_proxy_component_unbind(struct device *i915_kdev,
with_intel_runtime_pm(&i915->runtime_pm, wakeref) with_intel_runtime_pm(&i915->runtime_pm, wakeref)
intel_uncore_rmw(gt->uncore, HECI_H_CSR(MTL_GSC_HECI2_BASE), intel_uncore_rmw(gt->uncore, HECI_H_CSR(MTL_GSC_HECI2_BASE),
HECI_H_CSR_IE | HECI_H_CSR_RST, 0); HECI_H_CSR_IE | HECI_H_CSR_RST, 0);
gt_dbg(gt, "GSC proxy mei component unbound\n");
} }
static const struct component_ops i915_gsc_proxy_component_ops = { static const struct component_ops i915_gsc_proxy_component_ops = {
......
...@@ -303,6 +303,8 @@ static int __pxp_global_teardown_final(struct intel_pxp *pxp) ...@@ -303,6 +303,8 @@ static int __pxp_global_teardown_final(struct intel_pxp *pxp)
if (!pxp->arb_is_valid) if (!pxp->arb_is_valid)
return 0; return 0;
drm_dbg(&pxp->ctrl_gt->i915->drm, "PXP: teardown for suspend/fini");
/* /*
* To ensure synchronous and coherent session teardown completion * To ensure synchronous and coherent session teardown completion
* in response to suspend or shutdown triggers, don't use a worker. * 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) ...@@ -324,6 +326,8 @@ static int __pxp_global_teardown_restart(struct intel_pxp *pxp)
if (pxp->arb_is_valid) if (pxp->arb_is_valid)
return 0; return 0;
drm_dbg(&pxp->ctrl_gt->i915->drm, "PXP: teardown for restart");
/* /*
* The arb-session is currently inactive and we are doing a reset and restart * The arb-session is currently inactive and we are doing a reset and restart
* due to a runtime event. Use the worker that was designed for this. * 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) ...@@ -332,8 +336,11 @@ static int __pxp_global_teardown_restart(struct intel_pxp *pxp)
timeout = intel_pxp_get_backend_timeout_ms(pxp); timeout = intel_pxp_get_backend_timeout_ms(pxp);
if (!wait_for_completion_timeout(&pxp->termination, msecs_to_jiffies(timeout))) if (!wait_for_completion_timeout(&pxp->termination, msecs_to_jiffies(timeout))) {
drm_dbg(&pxp->ctrl_gt->i915->drm, "PXP: restart backend timed out (%d ms)",
timeout);
return -ETIMEDOUT; return -ETIMEDOUT;
}
return 0; return 0;
} }
...@@ -414,10 +421,12 @@ int intel_pxp_start(struct intel_pxp *pxp) ...@@ -414,10 +421,12 @@ int intel_pxp_start(struct intel_pxp *pxp)
int ret = 0; int ret = 0;
ret = intel_pxp_get_readiness_status(pxp, PXP_READINESS_TIMEOUT); ret = intel_pxp_get_readiness_status(pxp, PXP_READINESS_TIMEOUT);
if (ret < 0) if (ret < 0) {
drm_dbg(&pxp->ctrl_gt->i915->drm, "PXP: tried but not-avail (%d)", ret);
return ret; return ret;
else if (ret > 1) } else if (ret > 1) {
return -EIO; /* per UAPI spec, user may retry later */ return -EIO; /* per UAPI spec, user may retry later */
}
mutex_lock(&pxp->arb_mutex); mutex_lock(&pxp->arb_mutex);
......
...@@ -40,11 +40,12 @@ void intel_pxp_irq_handler(struct intel_pxp *pxp, u16 iir) ...@@ -40,11 +40,12 @@ void intel_pxp_irq_handler(struct intel_pxp *pxp, u16 iir)
GEN12_DISPLAY_APP_TERMINATED_PER_FW_REQ_INTERRUPT)) { GEN12_DISPLAY_APP_TERMINATED_PER_FW_REQ_INTERRUPT)) {
/* immediately mark PXP as inactive on termination */ /* immediately mark PXP as inactive on termination */
intel_pxp_mark_termination_in_progress(pxp); intel_pxp_mark_termination_in_progress(pxp);
pxp->session_events |= PXP_TERMINATION_REQUEST | PXP_INVAL_REQUIRED; pxp->session_events |= PXP_TERMINATION_REQUEST | PXP_INVAL_REQUIRED |
PXP_EVENT_TYPE_IRQ;
} }
if (iir & GEN12_DISPLAY_STATE_RESET_COMPLETE_INTERRUPT) if (iir & GEN12_DISPLAY_STATE_RESET_COMPLETE_INTERRUPT)
pxp->session_events |= PXP_TERMINATION_COMPLETE; pxp->session_events |= PXP_TERMINATION_COMPLETE | PXP_EVENT_TYPE_IRQ;
if (pxp->session_events) if (pxp->session_events)
queue_work(system_unbound_wq, &pxp->session_work); queue_work(system_unbound_wq, &pxp->session_work);
......
...@@ -137,8 +137,10 @@ void intel_pxp_terminate(struct intel_pxp *pxp, bool post_invalidation_needs_res ...@@ -137,8 +137,10 @@ void intel_pxp_terminate(struct intel_pxp *pxp, bool post_invalidation_needs_res
static void pxp_terminate_complete(struct intel_pxp *pxp) static void pxp_terminate_complete(struct intel_pxp *pxp)
{ {
/* Re-create the arb session after teardown handle complete */ /* Re-create the arb session after teardown handle complete */
if (fetch_and_zero(&pxp->hw_state_invalidated)) if (fetch_and_zero(&pxp->hw_state_invalidated)) {
drm_dbg(&pxp->ctrl_gt->i915->drm, "PXP: creating arb_session after invalidation");
pxp_create_arb_session(pxp); pxp_create_arb_session(pxp);
}
complete_all(&pxp->termination); complete_all(&pxp->termination);
} }
...@@ -157,6 +159,8 @@ static void pxp_session_work(struct work_struct *work) ...@@ -157,6 +159,8 @@ static void pxp_session_work(struct work_struct *work)
if (!events) if (!events)
return; return;
drm_dbg(&gt->i915->drm, "PXP: processing event-flags 0x%08x", events);
if (events & PXP_INVAL_REQUIRED) if (events & PXP_INVAL_REQUIRED)
intel_pxp_invalidate(pxp); intel_pxp_invalidate(pxp);
......
...@@ -124,6 +124,7 @@ struct intel_pxp { ...@@ -124,6 +124,7 @@ struct intel_pxp {
#define PXP_TERMINATION_REQUEST BIT(0) #define PXP_TERMINATION_REQUEST BIT(0)
#define PXP_TERMINATION_COMPLETE BIT(1) #define PXP_TERMINATION_COMPLETE BIT(1)
#define PXP_INVAL_REQUIRED BIT(2) #define PXP_INVAL_REQUIRED BIT(2)
#define PXP_EVENT_TYPE_IRQ BIT(3)
}; };
#endif /* __INTEL_PXP_TYPES_H__ */ #endif /* __INTEL_PXP_TYPES_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment