* [PATCH RESEND] drm/amdkfd: remove duplicate ttmp11 scheduling mode definitions
@ 2026-03-03 21:29 Peter Colberg
2026-03-03 22:32 ` Claude review: " Claude Code Review Bot
2026-03-03 22:32 ` Claude Code Review Bot
0 siblings, 2 replies; 3+ messages in thread
From: Peter Colberg @ 2026-03-03 21:29 UTC (permalink / raw)
To: Felix Kuehling, Alex Deucher, Christian König, David Airlie,
Simona Vetter, Jay Cornwall, Lancelot Six
Cc: amd-gfx, dri-devel, linux-kernel, Peter Colberg
TTMP11_SCHED_MODE_* are only used if RELAXED_SCHEDULING_IN_TRAP is defined.
Fixes: bbcad5a8896b ("drm/amdkfd: gfx12.1 trap handler support for expert scheduling mode")
Signed-off-by: Peter Colberg <pcolberg@redhat.com>
---
drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx12.asm | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx12.asm b/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx12.asm
index 456db81998993803a25b32653ad75d529e35931c..3c976a4aac739669a39aebeb97bb35dfaa1af2f2 100644
--- a/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx12.asm
+++ b/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx12.asm
@@ -112,12 +112,6 @@ var BARRIER_STATE_MEMBER_OFFSET = 4
var BARRIER_STATE_MEMBER_SIZE = 7
var BARRIER_STATE_VALID_OFFSET = 0
-#if RELAXED_SCHEDULING_IN_TRAP
-var TTMP11_SCHED_MODE_SHIFT = 26
-var TTMP11_SCHED_MODE_SIZE = 2
-var TTMP11_SCHED_MODE_MASK = 0xC000000
-#endif
-
var NAMED_BARRIERS_SR_OFFSET_FROM_HWREG = 0x80
var S_BARRIER_INIT_MEMBERCNT_MASK = 0x7F0000
var S_BARRIER_INIT_MEMBERCNT_SHIFT = 0x10
@@ -134,9 +128,11 @@ var SQ_WAVE_MODE_DST_SRC0_SRC1_VGPR_MSB_SHIFT = 12
var SQ_WAVE_MODE_DST_SRC0_SRC1_VGPR_MSB_SIZE = 6
#endif
+#if RELAXED_SCHEDULING_IN_TRAP
var TTMP11_SCHED_MODE_SHIFT = 26
var TTMP11_SCHED_MODE_SIZE = 2
var TTMP11_SCHED_MODE_MASK = 0xC000000
+#endif
var TTMP11_DEBUG_TRAP_ENABLED_SHIFT = 23
var TTMP11_DEBUG_TRAP_ENABLED_MASK = 0x800000
var TTMP11_FIRST_REPLAY_SHIFT = 22
---
base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
change-id: 20260224-drm-amdkfd-ttmp11-sched-mode-a7a722d96df1
Best regards,
--
Peter Colberg <pcolberg@redhat.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Claude review: drm/amdkfd: remove duplicate ttmp11 scheduling mode definitions
2026-03-03 21:29 [PATCH RESEND] drm/amdkfd: remove duplicate ttmp11 scheduling mode definitions Peter Colberg
@ 2026-03-03 22:32 ` Claude Code Review Bot
2026-03-03 22:32 ` Claude Code Review Bot
1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-03-03 22:32 UTC (permalink / raw)
To: dri-devel-reviews
Overall Series Review
Subject: drm/amdkfd: remove duplicate ttmp11 scheduling mode definitions
Author: Peter Colberg <pcolberg@redhat.com>
Patches: 1
Reviewed: 2026-03-04T08:32:56.895305
---
This is a single-patch cleanup that removes duplicate variable definitions (`TTMP11_SCHED_MODE_SHIFT`, `TTMP11_SCHED_MODE_SIZE`, `TTMP11_SCHED_MODE_MASK`) in the GFX12 CWSR trap handler assembly file. The variables were defined twice: once inside a `#if RELAXED_SCHEDULING_IN_TRAP` guard (lines 112-117 pre-patch) and once unconditionally (lines 134-136 pre-patch). The patch removes the first (guarded) copy and wraps the second (previously unconditional) copy with the `#if RELAXED_SCHEDULING_IN_TRAP` guard.
The fix is correct, low-risk, and improves code quality. All usages of the `TTMP11_SCHED_MODE_*` variables are within `#if RELAXED_SCHEDULING_IN_TRAP` blocks, so conditionalizing the definitions is the right thing to do. The Fixes tag is appropriate since commit `bbcad5a8896b` introduced the duplication.
**Verdict: Looks good.**
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 3+ messages in thread
* Claude review: drm/amdkfd: remove duplicate ttmp11 scheduling mode definitions
2026-03-03 21:29 [PATCH RESEND] drm/amdkfd: remove duplicate ttmp11 scheduling mode definitions Peter Colberg
2026-03-03 22:32 ` Claude review: " Claude Code Review Bot
@ 2026-03-03 22:32 ` Claude Code Review Bot
1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-03-03 22:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
**Correctness: Good.** The patch correctly identifies and resolves the duplicate definitions. Before the patch, the file had:
1. Lines 112-117 (guarded):
```asm
#if RELAXED_SCHEDULING_IN_TRAP
var TTMP11_SCHED_MODE_SHIFT = 26
var TTMP11_SCHED_MODE_SIZE = 2
var TTMP11_SCHED_MODE_MASK = 0xC000000
#endif
```
2. Lines ~136-138 (unconditional):
```asm
var TTMP11_SCHED_MODE_SHIFT = 26
var TTMP11_SCHED_MODE_SIZE = 2
var TTMP11_SCHED_MODE_MASK = 0xC000000
```
The patch removes the first block and wraps the second with the `#if RELAXED_SCHEDULING_IN_TRAP` / `#endif` guard. I verified that all usages of these three variables (at lines 241, 242, 329, 330, 1379 post-patch) are within `#if RELAXED_SCHEDULING_IN_TRAP` guards, confirming that making them conditional is safe and correct.
**Placement:** The surviving definitions are grouped with the other `TTMP11_*` variables (`TTMP11_DEBUG_TRAP_ENABLED_*`, `TTMP11_FIRST_REPLAY_*`, `TTMP11_REPLAY_W64H_*`, `TTMP11_FXPTR_*`), which is a sensible location.
**Minor observation:** The variables immediately following the `#endif` (e.g., `TTMP11_DEBUG_TRAP_ENABLED_SHIFT` at line 136) are not guarded by any conditional. This is fine — those are used unconditionally elsewhere and are not part of this patch's scope.
**Commit message:** Clear, concise, and accurate. The Fixes tag correctly identifies the commit that introduced the duplication. The Signed-off-by is present.
**Reviewed-by: No issues found.**
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-03 22:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-03 21:29 [PATCH RESEND] drm/amdkfd: remove duplicate ttmp11 scheduling mode definitions Peter Colberg
2026-03-03 22:32 ` Claude review: " Claude Code Review Bot
2026-03-03 22:32 ` Claude Code Review Bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox