Re: [PATCH v4 1/3] i3c: master: dw: Report actual GET CCC payload length on success

From: NG, TZE YEE

Date: Fri Jul 03 2026 - 05:16:16 EST


On 1/7/2026 6:37 pm, Alexandre Mergnat wrote:
> [You don't often get email from amergnat@xxxxxxxxxxxx. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> On Tue, 30 Jun 2026 06:20:25 -0700, tze.yee.ng@xxxxxxxxxx <tze.yee.ng@xxxxxxxxxx> wrote:
>> diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
>> index a7593d6efac5..4a984a5be264 100644
>> --- a/drivers/i3c/master/dw-i3c-master.c
>> +++ b/drivers/i3c/master/dw-i3c-master.c
>> @@ -742,7 +742,10 @@ static int dw_i3c_ccc_set(struct dw_i3c_master *master,
>> dw_i3c_master_dequeue_xfer(master, xfer);
>>
>> ret = xfer->ret;
>> - if (xfer->cmds[0].error == RESPONSE_ERROR_IBA_NACK)
>> + cmd = &xfer->cmds[0];
>> + if (!ret)
>> + ccc->dests[0].payload.actual_len = cmd->rx_len;
>
> In v3 this assignment lived in dw_i3c_ccc_get(); in v4 it has moved into
> dw_i3c_ccc_set(), the write (SET) path. GET CCCs are dispatched to
> dw_i3c_ccc_get() (dw_i3c_master_send_ccc_cmd() calls dw_i3c_ccc_get()
> when ccc->rnw is set), so as it stands actual_len is only written for
> writes - where cmd->rx_len is the count of un-sent bytes, normally 0 -
> and stays 0 for the GET CCCs this commit targets (patch 2 later moves it
> back into dw_i3c_ccc_get()). Was there a reason for moving it in v4?
> As-is it reads like a regression; keeping it in dw_i3c_ccc_get() would
> make the patch match its title and work on its own.
>
> --
> Alexandre Mergnat <amergnat@xxxxxxxxxxxx>

Hi Alexandre,

You are right — that was an unintentional regression in v4, not a
deliberate move. actual_len belongs only in dw_i3c_ccc_get(); putting it
in dw_i3c_ccc_set() left GET CCCs with actual_len == 0. v5 moves it back
to dw_i3c_ccc_get() so patch 2 matches its title and works on its own.
Thanks for pointing it out.

Tze Yee