Commit 78600df8 authored by Daniele Ceraolo Spurio's avatar Daniele Ceraolo Spurio Committed by Lucas De Marchi
Browse files

drm/xe/pxp: do not queue unneeded terminations from debugfs

The PXP terminate debugfs currently unconditionally simulates a
termination, no matter what the HW status is. This is unneeded if PXP is
not in use and can cause errors if the HW init hasn't completed yet.
To solve these issues, we can simply limit the terminations to the cases
where PXP is fully initialized and in use.

v2: s/pxp_status/ready/ to avoid confusion with pxp->status (John)

Fixes: 385a8015 ("drm/xe/pxp: Add PXP debugfs support")
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/4749


Signed-off-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
Link: https://lore.kernel.org/r/20250416201622.1295369-1-daniele.ceraolospurio@intel.com


(cherry picked from commit ba1f62a0)
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
parent 25583ad4
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -66,9 +66,18 @@ static int pxp_terminate(struct seq_file *m, void *data)
{
	struct xe_pxp *pxp = node_to_pxp(m->private);
	struct drm_printer p = drm_seq_file_printer(m);
	int ready = xe_pxp_get_readiness_status(pxp);

	if (!xe_pxp_is_enabled(pxp))
		return -ENODEV;
	if (ready < 0)
		return ready; /* disabled or error occurred */
	else if (!ready)
		return -EBUSY; /* init still in progress */

	/* no need for a termination if PXP is not active */
	if (pxp->status != XE_PXP_ACTIVE) {
		drm_printf(&p, "PXP not active\n");
		return 0;
	}

	/* simulate a termination interrupt */
	spin_lock_irq(&pxp->xe->irq.lock);