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: Disable interrupts before suspending the GPU
Date: Wed, 11 Mar 2026 13:25:24 +1000	[thread overview]
Message-ID: <review-patch2-20260310-drain-irqs-before-suspend-v1-2-bf4f9ed68e75@imgtec.com> (raw)
In-Reply-To: <20260310-drain-irqs-before-suspend-v1-2-bf4f9ed68e75@imgtec.com>

Patch Review

**Correctness: Good, with a minor issue**

This patch upgrades `synchronize_irq()` to `disable_irq()` in the suspend path, which is strictly stronger: it both waits for in-progress handlers AND prevents new IRQs from being delivered. The corresponding `enable_irq()` is added to the resume path. This closes the theoretical window noted above where a new hardirq could fire after `synchronize_irq()` returns.

**IRQ disable depth accounting**: I verified the interaction with `pvr_power_reset()`, which independently calls `disable_irq()`/`enable_irq()` around its reset loop. During hard reset, it calls `pvr_power_device_suspend()` and `pvr_power_device_resume()`, but because `pvr_dev->fw_dev.booted` is set to `false` before those calls, both functions skip the `pvr_power_fw_disable()`/`pvr_power_fw_enable()` calls, avoiding double disable/enable. The accounting is correct.

**Error path in `pvr_power_fw_enable`**: The error rollback is correct — if `pvr_fw_start()` or `pvr_wait_for_fw_boot()` fails during resume, `disable_irq()` is called to re-disable the IRQ, keeping the state consistent.

**Error path in `pvr_power_fw_disable`**: Similarly, if `pvr_fw_stop()` fails during suspend, `enable_irq()` is called to restore the previous state.

**Typo in commit message**:
> disable IRQs for the while GPU at the kernel level

Should be "for the **whole** GPU".

**Minor style nit**: The `int err;` declaration is hoisted out of the `if (!hard_reset)` block to the function scope. This is necessary for the new code after the `if` block, but the `err` variable inside the `if (!hard_reset)` block is now used before the new assignment after the block. This is fine functionally, just noting the change in scoping was needed and is correct.

**Overall**: Both patches are well-motivated, correctly implemented, and the series split makes sense for backporting. The only actionable item is the "while" → "whole" typo in patch 2's commit message.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-03-11  3:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 11:41 [PATCH 0/2] drm/imagination: Drain interrupts before suspending the GPU 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
2026-03-10 11:41 ` [PATCH 2/2] drm/imagination: Disable " Alessio Belle
2026-03-11  3:25   ` Claude Code Review Bot [this message]
2026-03-11  3:25 ` Claude review: drm/imagination: Drain " 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-patch2-20260310-drain-irqs-before-suspend-v1-2-bf4f9ed68e75@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