Linux-i3c Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: tze.yee.ng@altera.com
Cc: Frank.Li@kernel.org, linux-i3c@lists.infradead.org
Subject: Re: [PATCH v2 3/3] i3c: master: Validate GET CCC payload length and retry M0/M2 once
Date: Tue, 09 Jun 2026 10:30:29 +0000	[thread overview]
Message-ID: <20260609103029.994891F00893@smtp.kernel.org> (raw)
In-Reply-To: <352ed29363b12d1d145ffd44316564bd8e33444c.1780999511.git.tze.yee.ng@altera.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Address NACKs are incorrectly mapped to -EINVAL instead of a hardware error code (-EIO or -ENXIO), breaking standard subsystem error reporting conventions for standard transfers.
--

commit f0f1354839be36f55ac51ec9d8d9c182653a6497
Author: Adrian Ng Ho Yin <adrian.ho.yin.ng@altera.com>

i3c: master: Validate GET CCC payload length and retry M0/M2 once

Validate GET CCC payload length after a successful transfer. Treat a
short read as I3C_ERROR_M0 and return -EIO. Retry GET CCCs once on
retriable errors.

[ ... ]
> diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> index c4004f87c6857..a8b5ebabd3508 100644
> --- a/drivers/i3c/master/dw-i3c-master.c
> +++ b/drivers/i3c/master/dw-i3c-master.c
> @@ -493,7 +493,6 @@ static void dw_i3c_master_end_xfer_locked(struct dw_i3c_master *master, u32 isr)
>  			break;
>  		case RESPONSE_ERROR_PARITY:
>  		case RESPONSE_ERROR_IBA_NACK:
> -		case RESPONSE_ERROR_ADDRESS_NACK:
>  		case RESPONSE_ERROR_TRANSF_ABORT:
>  		case RESPONSE_ERROR_CRC:
>  		case RESPONSE_ERROR_FRAME:
> @@ -503,6 +502,7 @@ static void dw_i3c_master_end_xfer_locked(struct dw_i3c_master *master, u32 isr)
>  			ret = -ENOSPC;
>  			break;
>  		case RESPONSE_ERROR_I2C_W_NACK_ERR:
> +		case RESPONSE_ERROR_ADDRESS_NACK:
>  		default:
>  			ret = -EINVAL;
>  			break;

[Severity: High]
Does moving RESPONSE_ERROR_ADDRESS_NACK to the default case incorrectly map
address NACKs to -EINVAL instead of a hardware error code like -EIO or
-ENXIO?

This function serves as the generic completion handler for all transfers,
including standard I3C and I2C private reads and writes. An address NACK
usually indicates an absent, disconnected, or busy device.

Returning -EINVAL for a hardware NACK during a data transfer diverges from
subsystem conventions. Can this cause userspace tools like i2cdetect or
core probing logic to misinterpret an absent device as a fatal invalid
parameter error, rather than allowing graceful fallbacks?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1780999511.git.tze.yee.ng@altera.com?part=3

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

  reply	other threads:[~2026-06-09 10:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09 10:18 [PATCH v2 0/3] i3c: Improve CCC reliability for DesignWare master tze.yee.ng
2026-06-09 10:18 ` [PATCH v2 1/3] i3c: master: dw: Report actual GET CCC payload length on success tze.yee.ng
2026-06-09 10:34   ` sashiko-bot
2026-06-09 10:18 ` [PATCH v2 2/3] i3c: master: dw: Map CCC hardware errors to I3C M0/M2 tze.yee.ng
2026-06-09 10:32   ` sashiko-bot
2026-06-09 10:18 ` [PATCH v2 3/3] i3c: master: Validate GET CCC payload length and retry M0/M2 once tze.yee.ng
2026-06-09 10:30   ` sashiko-bot [this message]
2026-06-10  2:08     ` NG, TZE YEE

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=20260609103029.994891F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=linux-i3c@lists.infradead.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tze.yee.ng@altera.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