public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/imagination: Synchronize interrupts before suspending the GPU
Date: Mon, 25 May 2026 18:34:26 +1000	[thread overview]
Message-ID: <review-patch1-20260522-sync-irqs-6-12-v1-1-b0ecc9675078@imgtec.com> (raw)
In-Reply-To: <20260522-sync-irqs-6-12-v1-1-b0ecc9675078@imgtec.com>

Patch Review

**Correctness of the fix:**

The core change is sound. Adding `synchronize_irq()` between the firmware power-off request and `pvr_fw_stop()` ensures any in-flight threaded IRQ handler completes before the GPU is actually stopped:

```c
+	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);
```

`synchronize_irq()` waits for both hardirq and threaded IRQ handlers to complete, which is exactly what's needed given the crash trace shows `pvr_device_irq_thread_handler` as the offending function.

**Placement is correct:** The call is placed after `pvr_power_request_pwr_off()` (which tells the firmware to stop generating new interrupts) but before `pvr_fw_stop()` (which actually powers off the GPU). This ordering ensures: (1) no new IRQs will be generated by the firmware, and (2) any already-in-flight handler finishes before hardware access is revoked.

**Boolean parameter addition:**

```c
-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)
```

The two call sites are updated correctly:
- `pvr_power_device_suspend()` passes `true` — this is the runtime PM path that needs synchronization
- `pvr_power_reset()` passes `false` — this path already handles IRQs differently (via `disable_irq`/`disable_irq_nosync` earlier in the reset sequence, which on 6.12 would be just `disable_irq`)

**Minor observation — `synchronize_irq()` vs upstream's `disable_irq()`:**

The upstream drm-next version uses `disable_irq()` instead of `synchronize_irq()`, which is strictly stronger — it both synchronizes *and* prevents new IRQs from being delivered while the GPU is off. This backport's use of `synchronize_irq()` alone leaves a small theoretical window: a new IRQ could arrive (e.g., a spurious interrupt or shared IRQ line) after `synchronize_irq()` returns but before `pvr_fw_stop()` completes. In practice this is unlikely to be a problem since: (1) the firmware has already been told to power off, so it shouldn't generate new IRQs, and (2) the IRQ handler should handle spurious interrupts gracefully. The comment in the patch description acknowledges that this is a subset of the upstream fix, which is acceptable for a minimal stable backport.

**Commit message quality:** Good. Clearly explains the race condition, why it's different from the upstream commit, and provides a concrete crash signature. The `Fixes:` tag and `Cc: stable` are appropriate.

**No issues found.** The patch is a clean, minimal, and correct stable backport.

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-05-25  8:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-22 13:15 [PATCH 6.12.y] drm/imagination: Synchronize interrupts before suspending the GPU Alessio Belle
2026-05-24 12:09 ` Sasha Levin
2026-05-25  8:34 ` Claude review: " Claude Code Review Bot
2026-05-25  8:34 ` Claude Code Review Bot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-05-26  8:13 [PATCH 6.12.y v2] " Alessio Belle
2026-05-27  5:07 ` Claude review: " Claude Code Review Bot
2026-05-27  5:07 ` Claude Code Review Bot
2026-03-10 11:41 [PATCH 0/2] drm/imagination: Drain " Alessio Belle
2026-03-10 11:41 ` [PATCH 1/2] drm/imagination: Synchronize " Alessio Belle
2026-03-11  3:25   ` Claude review: " Claude Code Review Bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=review-patch1-20260522-sync-irqs-6-12-v1-1-b0ecc9675078@imgtec.com \
    --to=claude-review@example.com \
    --cc=dri-devel-reviews@example.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox