* [PATCH] accel/ivpu: Document why full JSM message size is always used
@ 2026-05-22 9:32 Karol Wachowski
2026-05-25 7:44 ` Dawid Osuchowski
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Karol Wachowski @ 2026-05-22 9:32 UTC (permalink / raw)
To: dri-devel
Cc: oded.gabbay, jeff.hugo, andrzej.kacprowski, dawid.osuchowski,
lizhi.hou, Karol Wachowski
Firmware expects IPC messages to always carry the full fixed
sizeof(struct vpu_jsm_msg) size. Sending the full struct also
ensures unused fields are zeroed, which maintains compatibility
when existing commands are extended with new fields in the future.
Replace the misleading TODO comment with an explanation of the
actual intent.
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
---
drivers/accel/ivpu/ivpu_ipc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/accel/ivpu/ivpu_ipc.c b/drivers/accel/ivpu/ivpu_ipc.c
index f47df092bb0d..9f1ba0c57442 100644
--- a/drivers/accel/ivpu/ivpu_ipc.c
+++ b/drivers/accel/ivpu/ivpu_ipc.c
@@ -97,7 +97,11 @@ ivpu_ipc_tx_prepare(struct ivpu_device *vdev, struct ivpu_ipc_consumer *cons,
memset(tx_buf, 0, sizeof(*tx_buf));
tx_buf->ipc.data_addr = jsm_vpu_addr;
- /* TODO: Set data_size to actual JSM message size, not union of all messages */
+ /*
+ * Firmware expects full JSM message size regardless of the payload size.
+ * Unused fields must be zeroed to allow future extensions of existing
+ * commands without breaking compatibility.
+ */
tx_buf->ipc.data_size = sizeof(*req);
tx_buf->ipc.channel = cons->channel;
tx_buf->ipc.src_node = 0;
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] accel/ivpu: Document why full JSM message size is always used
2026-05-22 9:32 [PATCH] accel/ivpu: Document why full JSM message size is always used Karol Wachowski
@ 2026-05-25 7:44 ` Dawid Osuchowski
2026-05-25 8:09 ` Wachowski, Karol
2026-05-25 9:04 ` Claude review: " Claude Code Review Bot
2026-05-25 9:04 ` Claude Code Review Bot
2 siblings, 1 reply; 5+ messages in thread
From: Dawid Osuchowski @ 2026-05-25 7:44 UTC (permalink / raw)
To: Karol Wachowski, dri-devel
Cc: oded.gabbay, jeff.hugo, andrzej.kacprowski, lizhi.hou
On 2026-05-22 11:32 AM, Karol Wachowski wrote:
> Firmware expects IPC messages to always carry the full fixed
> sizeof(struct vpu_jsm_msg) size. Sending the full struct also
> ensures unused fields are zeroed, which maintains compatibility
> when existing commands are extended with new fields in the future.
>
> Replace the misleading TODO comment with an explanation of the
> actual intent.
>
> Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Reviewed-by: Dawid Osuchowski <dawid.osuchowski@linux.intel.com>
> ---
> drivers/accel/ivpu/ivpu_ipc.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/accel/ivpu/ivpu_ipc.c b/drivers/accel/ivpu/ivpu_ipc.c
> index f47df092bb0d..9f1ba0c57442 100644
> --- a/drivers/accel/ivpu/ivpu_ipc.c
> +++ b/drivers/accel/ivpu/ivpu_ipc.c
> @@ -97,7 +97,11 @@ ivpu_ipc_tx_prepare(struct ivpu_device *vdev, struct ivpu_ipc_consumer *cons,
>
> memset(tx_buf, 0, sizeof(*tx_buf));
> tx_buf->ipc.data_addr = jsm_vpu_addr;
> - /* TODO: Set data_size to actual JSM message size, not union of all messages */
> + /*
> + * Firmware expects full JSM message size regardless of the payload size.
> + * Unused fields must be zeroed to allow future extensions of existing
> + * commands without breaking compatibility.
> + */
> tx_buf->ipc.data_size = sizeof(*req);
> tx_buf->ipc.channel = cons->channel;
> tx_buf->ipc.src_node = 0;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] accel/ivpu: Document why full JSM message size is always used
2026-05-25 7:44 ` Dawid Osuchowski
@ 2026-05-25 8:09 ` Wachowski, Karol
0 siblings, 0 replies; 5+ messages in thread
From: Wachowski, Karol @ 2026-05-25 8:09 UTC (permalink / raw)
To: Dawid Osuchowski, dri-devel
Cc: oded.gabbay, jeff.hugo, andrzej.kacprowski, lizhi.hou
On 25-May-26 9:44, Dawid Osuchowski wrote:
> On 2026-05-22 11:32 AM, Karol Wachowski wrote:
>> Firmware expects IPC messages to always carry the full fixed
>> sizeof(struct vpu_jsm_msg) size. Sending the full struct also
>> ensures unused fields are zeroed, which maintains compatibility
>> when existing commands are extended with new fields in the future.
>>
>> Replace the misleading TODO comment with an explanation of the
>> actual intent.
>>
>> Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
>
> Reviewed-by: Dawid Osuchowski <dawid.osuchowski@linux.intel.com>
Thanks, applied to drm-misc-next.
>
>> ---
>> drivers/accel/ivpu/ivpu_ipc.c | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/accel/ivpu/ivpu_ipc.c b/drivers/accel/ivpu/
>> ivpu_ipc.c
>> index f47df092bb0d..9f1ba0c57442 100644
>> --- a/drivers/accel/ivpu/ivpu_ipc.c
>> +++ b/drivers/accel/ivpu/ivpu_ipc.c
>> @@ -97,7 +97,11 @@ ivpu_ipc_tx_prepare(struct ivpu_device *vdev,
>> struct ivpu_ipc_consumer *cons,
>> memset(tx_buf, 0, sizeof(*tx_buf));
>> tx_buf->ipc.data_addr = jsm_vpu_addr;
>> - /* TODO: Set data_size to actual JSM message size, not union of
>> all messages */
>> + /*
>> + * Firmware expects full JSM message size regardless of the
>> payload size.
>> + * Unused fields must be zeroed to allow future extensions of
>> existing
>> + * commands without breaking compatibility.
>> + */
>> tx_buf->ipc.data_size = sizeof(*req);
>> tx_buf->ipc.channel = cons->channel;
>> tx_buf->ipc.src_node = 0;
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Claude review: accel/ivpu: Document why full JSM message size is always used
2026-05-22 9:32 [PATCH] accel/ivpu: Document why full JSM message size is always used Karol Wachowski
2026-05-25 7:44 ` Dawid Osuchowski
@ 2026-05-25 9:04 ` Claude Code Review Bot
2026-05-25 9:04 ` Claude Code Review Bot
2 siblings, 0 replies; 5+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 9:04 UTC (permalink / raw)
To: dri-devel-reviews
Overall Series Review
Subject: accel/ivpu: Document why full JSM message size is always used
Author: Karol Wachowski <karol.wachowski@linux.intel.com>
Patches: 3
Reviewed: 2026-05-25T19:04:12.133869
---
This is a single, comment-only patch that replaces a misleading `TODO` comment with an accurate explanation of the design intent. No functional code changes are made. The patch is straightforward, well-motivated, and correct.
**Verdict: Looks good.** This is a clear improvement — it converts a stale TODO (which implied the code was wrong and should be fixed) into documentation that explains why the current behavior is intentional.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 5+ messages in thread
* Claude review: accel/ivpu: Document why full JSM message size is always used
2026-05-22 9:32 [PATCH] accel/ivpu: Document why full JSM message size is always used Karol Wachowski
2026-05-25 7:44 ` Dawid Osuchowski
2026-05-25 9:04 ` Claude review: " Claude Code Review Bot
@ 2026-05-25 9:04 ` Claude Code Review Bot
2 siblings, 0 replies; 5+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 9:04 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
**Assessment: No issues found.**
The existing code at `ivpu_ipc.c:100` has this TODO:
```c
/* TODO: Set data_size to actual JSM message size, not union of all messages */
```
This implies `sizeof(*req)` (where `req` is `struct vpu_jsm_msg *`) is a bug or technical debt to be fixed. The patch replaces it with:
```c
/*
* Firmware expects full JSM message size regardless of the payload size.
* Unused fields must be zeroed to allow future extensions of existing
* commands without breaking compatibility.
*/
```
The replacement comment is accurate and well-justified:
1. **Zeroing is handled**: `memset(tx_buf, 0, sizeof(*tx_buf))` at line 98 zeroes the entire buffer including the JSM portion, which supports the "unused fields must be zeroed" claim.
2. **`vpu_jsm_msg` is indeed a union-based struct**: Looking at the callers in `ivpu_jsm_msg.c`, every message is declared as `struct vpu_jsm_msg req = { .type = ... }` and only populates the relevant payload union member, confirming that the full struct size is always sent regardless of which command is used.
3. **The comment follows kernel multi-line comment style** (`/* ... */` block) correctly.
**Minor observation**: The commit message is well-written and self-contained — it explains both the firmware requirement and the forward-compatibility rationale without being verbose.
No concerns with this patch. It can be applied as-is.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-05-25 9:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-22 9:32 [PATCH] accel/ivpu: Document why full JSM message size is always used Karol Wachowski
2026-05-25 7:44 ` Dawid Osuchowski
2026-05-25 8:09 ` Wachowski, Karol
2026-05-25 9:04 ` Claude review: " Claude Code Review Bot
2026-05-25 9:04 ` 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