From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: accel/amdxdna: Handle DETACH_DEBUG_BO through config_debug_bo path
Date: Sun, 12 Apr 2026 14:24:29 +1000 [thread overview]
Message-ID: <review-patch1-20260406211403.4011988-1-lizhi.hou@amd.com> (raw)
In-Reply-To: <20260406211403.4011988-1-lizhi.hou@amd.com>
Patch Review
**Correctness: Good.** The root cause is correctly identified. Looking at `aie2_ctx.c:858-884`, when `attach` is false, `cmd.opcode` is set to `DETACH_DEBUG_BO`, which then gets submitted to the scheduler. But in `aie2_sched_job_run()` at line 358, the switch only matched `ATTACH_DEBUG_BO`, so `DETACH_DEBUG_BO` fell through to `default: ret = -EINVAL`. The handler `aie2_config_debug_bo()` in `aie2_message.c:1179` already correctly checks the opcode to decide between `DEBUG_BO_REGISTER` and `DEBUG_BO_UNREGISTER`, so routing `DETACH_DEBUG_BO` there is the right fix.
**Style nit:** The explicit `fallthrough;` annotation is unnecessary here. In kernel style, `fallthrough` is used when there is code in the preceding case before falling into the next one. When two cases simply share the same body with no intervening code, stacking the `case` labels is the standard idiom:
```c
case ATTACH_DEBUG_BO:
case DETACH_DEBUG_BO:
ret = aie2_config_debug_bo(hwctx, job, aie2_sched_drvcmd_resp_handler);
break;
```
The `fallthrough` keyword is mandated by `-Wimplicit-fallthrough` only when there are statements between the case labels. With no statements, there is no implicit fallthrough warning, and the bare stacked-case form is both idiomatic and more concise. The existing `SYNC_DEBUG_BO` case just above demonstrates this — it doesn't use `fallthrough` before its own handler. This is a minor style point and shouldn't block the patch, but it would be cleaner without it.
**Overall:** The fix is correct and important — without it, debug BO detach would always fail silently (well, with `-EINVAL`). Recommend merging with the optional style cleanup.
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-04-12 4:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-06 21:14 [PATCH V1] accel/amdxdna: Handle DETACH_DEBUG_BO through config_debug_bo path Lizhi Hou
2026-04-06 21:29 ` Mario Limonciello
2026-04-07 17:23 ` Lizhi Hou
2026-04-12 4:24 ` Claude review: " Claude Code Review Bot
2026-04-12 4:24 ` Claude Code Review Bot [this message]
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-20260406211403.4011988-1-lizhi.hou@amd.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