From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/panthor: Use a local iomem base for PWR registers
Date: Sun, 12 Apr 2026 09:38:16 +1000 [thread overview]
Message-ID: <review-patch6-20260410164637.549145-7-karunika.choo@arm.com> (raw)
In-Reply-To: <20260410164637.549145-7-karunika.choo@arm.com>
Patch Review
**Critical issue:**
**Regression bug in `panthor_hw.c`**: This patch changes the PWR register offsets from absolute to relative. For example:
```c
// Before (absolute):
#define PWR_L2_PRESENT PWR_CTRL_REG(0x100) // = 0x900
// After (relative):
#define PWR_L2_PRESENT 0x100
```
But `panthor_hw.c` (in `panthor_gpu_info_init`) still reads these registers using `ptdev->iomem`:
```c
ptdev->gpu_info.l2_present = gpu_read64(ptdev->iomem, PWR_L2_PRESENT);
ptdev->gpu_info.tiler_present = gpu_read64(ptdev->iomem, PWR_TILER_PRESENT);
ptdev->gpu_info.shader_present = gpu_read64(ptdev->iomem, PWR_SHADER_PRESENT);
```
After this patch, `PWR_L2_PRESENT` is `0x100` instead of `0x900`, so this code reads GPU_SHADER_PRESENT (offset 0x100) instead of PWR_L2_PRESENT (offset 0x900). Similarly, `PWR_TILER_PRESENT` (now `0x140`) would read SHADER_READY (offset 0x140), and `PWR_SHADER_PRESENT` (now `0x200`) would read SHADER_PWRTRANS (offset 0x200). **This is silent data corruption of the gpu_info fields on arch 14.x hardware.**
This must be fixed, either by:
- Adding PWR present-register read helpers in patch 3 (preferred, consistent with the series' approach)
- Updating `panthor_hw.c` in this patch to use `ptdev->pwr->iomem`
Additionally, in the IRQ base change:
```c
err = panthor_request_pwr_irq(ptdev, &pwr->irq, irq,
PWR_INTERRUPTS_MASK,
- GPU_CONTROL_BASE + PWR_CONTROL_BASE);
+ GPU_CONTROL_BASE + PWR_INT_BASE);
```
Since `PWR_INT_BASE` is `0x800` (same as `PWR_CONTROL_BASE`), this is a no-op change in practice, but it makes the intent clearer -- the IRQ registers happen to start at the base of the PWR control block.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-04-11 23:38 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-10 16:46 [PATCH 0/8] drm/panthor: Localize register access by component Karunika Choo
2026-04-10 16:46 ` [PATCH 1/8] drm/panthor: Pass an iomem pointer to GPU register access helpers Karunika Choo
2026-04-10 18:11 ` Boris Brezillon
2026-04-11 23:38 ` Claude review: " Claude Code Review Bot
2026-04-10 16:46 ` [PATCH 2/8] drm/panthor: Split register definitions by components Karunika Choo
2026-04-10 18:08 ` Boris Brezillon
2026-04-11 23:38 ` Claude review: " Claude Code Review Bot
2026-04-10 16:46 ` [PATCH 3/8] drm/panthor: Replace cross-component register accesses with helpers Karunika Choo
2026-04-10 17:55 ` Boris Brezillon
2026-04-11 23:38 ` Claude review: " Claude Code Review Bot
2026-04-10 16:46 ` [PATCH 4/8] drm/panthor: Store IRQ register base iomem pointer in panthor_irq Karunika Choo
2026-04-10 17:53 ` Boris Brezillon
2026-04-11 23:38 ` Claude review: " Claude Code Review Bot
2026-04-10 16:46 ` [PATCH 5/8] drm/panthor: Use a local iomem base for GPU registers Karunika Choo
2026-04-10 18:11 ` Boris Brezillon
2026-04-11 23:38 ` Claude review: " Claude Code Review Bot
2026-04-10 16:46 ` [PATCH 6/8] drm/panthor: Use a local iomem base for PWR registers Karunika Choo
2026-04-10 18:12 ` Boris Brezillon
2026-04-11 23:38 ` Claude Code Review Bot [this message]
2026-04-10 16:46 ` [PATCH 7/8] drm/panthor: Use a local iomem base for firmware control registers Karunika Choo
2026-04-10 18:12 ` Boris Brezillon
2026-04-11 23:38 ` Claude review: " Claude Code Review Bot
2026-04-10 16:46 ` [PATCH 8/8] drm/panthor: Use a local iomem base for MMU AS registers Karunika Choo
2026-04-10 18:13 ` Boris Brezillon
2026-04-11 23:38 ` Claude review: " Claude Code Review Bot
2026-04-11 23:38 ` Claude review: drm/panthor: Localize register access by component Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-04-12 14:29 [PATCH v2 0/8] " Karunika Choo
2026-04-12 14:29 ` [PATCH v2 6/8] drm/panthor: Use a local iomem base for PWR registers Karunika Choo
2026-04-13 9:05 ` 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-patch6-20260410164637.549145-7-karunika.choo@arm.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