[PATCH v5 3/5] i3c: master: dw: Map CCC hardware errors to I3C M0/M2
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Fri Jul 3 03:59:30 PDT 2026
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dw_i3c_ccc_set() fails to use dw_i3c_ccc_map_err(), resulting in inconsistent M0 error mapping for CCC SET commands
--
commit 0ce229b1e86f48f8bc79433bee08c7da0909bad8
Author: Adrian Ng Ho Yin <adrian.ho.yin.ng at altera.com>
i3c: master: dw: Map CCC hardware errors to I3C M0/M2
This commit maps DesignWare I3C master CCC hardware errors to I3C M0/M2 error
codes. It introduces a new mapping function to handle this translation and
updates CCC commands to use it.
> diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> --- a/drivers/i3c/master/dw-i3c-master.c
> +++ b/drivers/i3c/master/dw-i3c-master.c
[ ... ]
> @@ -781,10 +800,9 @@ static int dw_i3c_ccc_get(struct dw_i3c_master *master, struct i3c_ccc_cmd *ccc)
>
> ret = xfer->ret;
> cmd = &xfer->cmds[0];
> + ccc->err = dw_i3c_ccc_map_err(cmd->error);
> if (!ret)
> ccc->dests[0].payload.actual_len = cmd->rx_len;
> - if (cmd->error == RESPONSE_ERROR_IBA_NACK)
> - ccc->err = I3C_ERROR_M2;
[Severity: Medium]
Should dw_i3c_ccc_set() also be updated to use the new dw_i3c_ccc_map_err()
function?
It looks like dw_i3c_ccc_get() was updated to map M0/M2 errors, but
dw_i3c_ccc_set() retains the legacy hardcoded check:
drivers/i3c/master/dw-i3c-master.c:dw_i3c_ccc_set() {
...
ret = xfer->ret;
if (xfer->cmds[0].error == RESPONSE_ERROR_IBA_NACK)
ccc->err = I3C_ERROR_M2;
...
}
Without using the new mapping function here, hardware errors (like CRC,
Parity, or Frame errors) during CCC SET commands will not be mapped to
I3C_ERROR_M0, resulting in inconsistent error handling compared to GET
commands.
>
> return ret;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1783074850.git.tze.yee.ng@altera.com?part=3
More information about the linux-i3c
mailing list