drivers/gpu/drm/imagination/pvr_power.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
commit 2d7f05cddf4c268cc36256a2476946041dbdd36d upstream.
The runtime PM suspend callback doesn't know whether the IRQ handler is
in progress on a different CPU core and doesn't wait for it to finish.
Depending on timing, the IRQ handler could be running while the GPU is
suspended, leading to it being killed when trying to access GPU
registers. See example signature below.
In a power off sequence initiated by the runtime PM suspend callback,
wait for any IRQ handlers in progress on other CPU cores to finish, by
calling synchronize_irq().
This version of the patch contains only the part of the upstream commit
that applies to 6.12; the rest was a revert of code added in 6.16.
The second paragraph above is different because on 6.12 this kind of bug
doesn't seem to crash the entire kernel, only the IRQ handler, leaving
the driver unusable in practice.
The crash signature below is also different, both because of the above,
and because there was no support for TI AM68 SK in 6.12.
Example signature on a TI AM62 SK platform:
[ 7827.189088] Internal error: synchronous external abort: 0000000096000010 [#1] PREEMPT SMP
[ 7827.197311] Modules linked in:
[ 7827.222015] CPU: 0 UID: 0 PID: 461 Comm: irq/405-gpu Tainted: G M 6.12.90 #5
[ 7827.230461] Tainted: [M]=MACHINE_CHECK
[ 7827.234203] Hardware name: Texas Instruments AM625 SK (DT)
[ 7827.239682] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 7827.246637] pc : pvr_device_irq_thread_handler+0x64/0x180 [powervr]
[ 7827.252941] lr : irq_thread_fn+0x2c/0xa8
[ 7827.256872] sp : ffff800082d8bd50
[ 7827.260179] x29: ffff800082d8bd70 x28: ffff8000800ce374 x27: ffff800081829cc0
[ 7827.267328] x26: ffff000004701e80 x25: ffff000005b884ac x24: ffff000005bd5780
[ 7827.274472] x23: ffff00000da40bc0 x22: ffff00000da40ba0 x21: ffff800082d8bd58
[ 7827.281614] x20: ffff00000da40000 x19: ffff000004701e80 x18: 08000000c6af9003
[ 7827.288750] x17: 0000000000000010 x16: 0000000000000068 x15: 0df234008df66400
[ 7827.295886] x14: 0000000000000000 x13: 000005c68f6e7191 x12: 000000000000025e
[ 7827.303020] x11: 00000000000000c0 x10: 0000000000000ac0 x9 : ffff800082d8bd00
[ 7827.310157] x8 : ffff000005bd62a0 x7 : ffff000077261380 x6 : 00000000000005c6
[ 7827.317292] x5 : 000000000000425e x4 : 0000000000000000 x3 : 0000000000000000
[ 7827.324428] x2 : 00000000000008a8 x1 : ffff800082d608a8 x0 : ffff000005bd5780
[ 7827.331568] Call trace:
[ 7827.334011] pvr_device_irq_thread_handler+0x64/0x180 [powervr]
[ 7827.339954] irq_thread_fn+0x2c/0xa8
[ 7827.343530] irq_thread+0x16c/0x2f4
[ 7827.347019] kthread+0x110/0x114
[ 7827.350248] ret_from_fork+0x10/0x20
[ 7827.353834] Code: f9446682 f943c281 b9404442 8b020021 (b9400021)
[ 7827.359921] ---[ end trace 0000000000000000 ]---
[ 7827.364820] genirq: exiting task "irq/405-gpu" (461) is an active IRQ thread (irq 405)
[ 8011.230278] powervr fd00000.gpu: Job timeout
[ 8011.230350] powervr fd00000.gpu: Job timeout
[ 8011.230426] powervr fd00000.gpu: Job timeout
Fixes: cc1aeedb98ad ("drm/imagination: Implement firmware infrastructure and META FW support")
Cc: stable@vger.kernel.org
Signed-off-by: Alessio Belle <alessio.belle@imgtec.com>
---
This is a backport of the parts relevant to 6.12 of [1].
[1] https://lore.kernel.org/all/20260310-drain-irqs-before-suspend-v1-0-bf4f9ed68e75@imgtec.com/
---
drivers/gpu/drm/imagination/pvr_power.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/imagination/pvr_power.c b/drivers/gpu/drm/imagination/pvr_power.c
index bf4cf8426f91..077d2651798c 100644
--- a/drivers/gpu/drm/imagination/pvr_power.c
+++ b/drivers/gpu/drm/imagination/pvr_power.c
@@ -84,7 +84,7 @@ pvr_power_request_pwr_off(struct pvr_device *pvr_dev)
}
static int
-pvr_power_fw_disable(struct pvr_device *pvr_dev, bool hard_reset)
+pvr_power_fw_disable(struct pvr_device *pvr_dev, bool hard_reset, bool rpm_suspend)
{
if (!hard_reset) {
int err;
@@ -100,6 +100,11 @@ pvr_power_fw_disable(struct pvr_device *pvr_dev, bool hard_reset)
return err;
}
+ if (rpm_suspend) {
+ /* Wait for late processing of GPU or firmware IRQs in other cores */
+ synchronize_irq(pvr_dev->irq);
+ }
+
return pvr_fw_stop(pvr_dev);
}
@@ -243,7 +248,7 @@ pvr_power_device_suspend(struct device *dev)
return -EIO;
if (pvr_dev->fw_dev.booted) {
- err = pvr_power_fw_disable(pvr_dev, false);
+ err = pvr_power_fw_disable(pvr_dev, false, true);
if (err)
goto err_drm_dev_exit;
}
@@ -425,7 +430,7 @@ pvr_power_reset(struct pvr_device *pvr_dev, bool hard_reset)
queues_disabled = true;
}
- err = pvr_power_fw_disable(pvr_dev, hard_reset);
+ err = pvr_power_fw_disable(pvr_dev, hard_reset, false);
if (!err) {
if (hard_reset) {
pvr_dev->fw_dev.booted = false;
---
base-commit: 2538fbeff8a94ee2b54eb09d92209e24a1e650d4
change-id: 20260522-sync-irqs-6-12-f14d5b26a84e
Best regards,
--
Alessio Belle <alessio.belle@imgtec.com>
> commit 2d7f05cddf4c268cc36256a2476946041dbdd36d upstream.
>
> The runtime PM suspend callback doesn't know whether the IRQ handler is
> in progress on a different CPU core and doesn't wait for it to finish.
> [...]
> This version of the patch contains only the part of the upstream commit
> that applies to 6.12; the rest was a revert of code added in 6.16.
The diff itself is fine and the synchronize_irq() portion is exactly
what we want on 6.12.y. However, the backport drops several trailers
from the upstream commit that we'd like to preserve verbatim on
stable:
- Reviewed-by: Matt Coster <matt.coster@imgtec.com>
- Link: https://patch.msgid.link/... (the upstream Link: trailer)
- Signed-off-by: Matthew Brost (the upstream maintainer SoB that
landed the patch upstream)
The upstream Fixes: tag also lists two entries:
Fixes: cc1aeedb98ad ("drm/imagination: Implement firmware ...")
Fixes: 96822d38ff57 ("drm/imagination: Implement Rogue safety event IRQs")
Your backport keeps only the first. I agree the second Fixes: refers
to code that doesn't exist on 6.12, but please keep it in the commit
message anyway so the trailers match upstream verbatim; stable
convention is to preserve the upstream trailer block unchanged.
Could you send a v2 with the upstream trailers (Reviewed-by, Link,
SoB, both Fixes:) restored?
--
Thanks,
Sasha
© 2016 - 2026 Red Hat, Inc.