From: Arun Iyengar <[email protected]>
panfrost_reset() masks the job interrupts without setting
PANFROST_COMP_BIT_JOB, so a running IRQ thread unmasks them. Use
panfrost_jm_suspend_irq(), and mask again after its synchronize_irq()
for a thread that tested the bit just before.
Fixes: 1d0cab5461d7 ("drm/panfrost: Make sure job interrupts are masked before
resetting")
Cc: [email protected]
Reported-by: Sashiko <[email protected]>
Closes:
https://sashiko.dev/#/patchset/[email protected]?part=8
Signed-off-by: Arun Iyengar <[email protected]>
---
v4: new (Sashiko on v3 08/14 and 13/14). Tested with a test-only hold
in the IRQ thread: JOB_INT_MASK read 0x70007 before, 0 after.
---
drivers/gpu/drm/panfrost/panfrost_job.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c
b/drivers/gpu/drm/panfrost/panfrost_job.c
index 74cc3dd02..7a2503f4e 100644
--- a/drivers/gpu/drm/panfrost/panfrost_job.c
+++ b/drivers/gpu/drm/panfrost/panfrost_job.c
@@ -459,6 +459,7 @@ void panfrost_jm_suspend_irq(struct panfrost_device *pfdev)
job_write(pfdev, JOB_INT_MASK, 0);
synchronize_irq(pfdev->js->irq);
+ job_write(pfdev, JOB_INT_MASK, 0);
}
static void panfrost_job_handle_err(struct panfrost_device *pfdev,
@@ -696,8 +697,7 @@ panfrost_reset(struct panfrost_device *pfdev,
/* Mask job interrupts and synchronize to make sure we won't be
* interrupted during our reset.
*/
- job_write(pfdev, JOB_INT_MASK, 0);
- synchronize_irq(pfdev->js->irq);
+ panfrost_jm_suspend_irq(pfdev);
spin_lock(&pfdev->js->job_lock);
for (i = 0; i < NUM_JOB_SLOTS; i++) {
--
2.55.0