Skip to content

Commit 78600df

Browse files
dceraololucasdemarchi
authored andcommitted
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: 385a801 ("drm/xe/pxp: Add PXP debugfs support") Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/4749 Signed-off-by: Daniele Ceraolo Spurio <[email protected]> Cc: John Harrison <[email protected]> Reviewed-by: John Harrison <[email protected]> Link: https://lore.kernel.org/r/[email protected] (cherry picked from commit ba1f62a) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 25583ad commit 78600df

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

drivers/gpu/drm/xe/xe_pxp_debugfs.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,18 @@ static int pxp_terminate(struct seq_file *m, void *data)
6666
{
6767
struct xe_pxp *pxp = node_to_pxp(m->private);
6868
struct drm_printer p = drm_seq_file_printer(m);
69+
int ready = xe_pxp_get_readiness_status(pxp);
6970

70-
if (!xe_pxp_is_enabled(pxp))
71-
return -ENODEV;
71+
if (ready < 0)
72+
return ready; /* disabled or error occurred */
73+
else if (!ready)
74+
return -EBUSY; /* init still in progress */
75+
76+
/* no need for a termination if PXP is not active */
77+
if (pxp->status != XE_PXP_ACTIVE) {
78+
drm_printf(&p, "PXP not active\n");
79+
return 0;
80+
}
7281

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

0 commit comments

Comments
 (0)