Linux-i3c Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dineshkumar Parameswaran" <Dineshkumar.Parameswaran@synopsys.com>
Cc: linux-i3c@lists.infradead.org, Frank.Li@kernel.org,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>
Subject: Re: [PATCH v3] i3c: master: dw-i3c-master: Add HDR-DDR support to Designware Controller.
Date: Wed, 11 Nov 2026 02:54:10 +0000	[thread overview]
Message-ID: <sashiko-outbox-208126@kernel.org> (raw)
In-Reply-To: <20261111021151.58380-1-parame@synopsys.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] i3c: master: dw: broken HDR-DDR direction check in
  dw_i3c_master_i3c_xfers()
--

commit e898c32aed081cceae7f567f3da1c50b825f55c6
Author: Dineshkumar Parameswaran <Dineshkumar.Parameswaran@synopsys.com>

i3c: master: dw-i3c-master: Add HDR-DDR support to Designware Controller.

This commit adds HDR-DDR private transfer support to the Synopsys
DesignWare I3C controller driver.

> diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> index 34aa8f8e1a0a2..aba27abb79272 100644
> --- a/drivers/i3c/master/dw-i3c-master.c
> +++ b/drivers/i3c/master/dw-i3c-master.c

[ ... ]

> @@ -995,28 +1006,36 @@ static int dw_i3c_master_i3c_xfers(struct i3c_dev_desc *dev,
>  	}
>  
>  	for (i = 0; i < i3c_nxfers; i++) {
> +		u32 rnw_cmd = (mode == I3C_SDR) ? i3c_xfers[i].rnw : i3c_xfers[i].cmd;
> +		bool rnw = dw_cmd_is_read(rnw_cmd, mode);
>  		struct dw_i3c_cmd *cmd = &xfer->cmds[i];
>  
>  		cmd->cmd_hi = COMMAND_PORT_ARG_DATA_LEN(i3c_xfers[i].len) |
>  			COMMAND_PORT_TRANSFER_ARG;
>  
> -		if (i3c_xfers[i].rnw) {
> +		if (rnw) {
>  			cmd->rx_buf = i3c_xfers[i].data.in;
>  			cmd->rx_len = i3c_xfers[i].len;
> -			cmd->cmd_lo = COMMAND_PORT_READ_TRANSFER |
> -				      COMMAND_PORT_SPEED(dev->info.max_read_ds);
> +			cmd->cmd_lo = COMMAND_PORT_READ_TRANSFER;
>  
>  		} else {
>  			cmd->tx_buf = i3c_xfers[i].data.out;
>  			cmd->tx_len = i3c_xfers[i].len;
> -			cmd->cmd_lo =
> -				COMMAND_PORT_SPEED(dev->info.max_write_ds);
>  		}

[Severity: High]
As reported by Frank Li on v2 [1], should the FIFO depth check loop and
the post-transfer length update loop in dw_i3c_master_i3c_xfers() also
use dw_cmd_is_read() instead of testing i3c_xfers[i].rnw directly?

In struct i3c_xfer, rnw and cmd share an anonymous union:

include/linux/i3c/device.h:
struct i3c_xfer {
	union {
		u8 rnw;
		u8 cmd;
	};

For any HDR-DDR write with a non-zero command code (0x01..0x7f),
i3c_xfers[i].rnw is non-zero even though bit 7 (HDR_DDR_CMD_READ) is
clear.  The other two loops in dw_i3c_master_i3c_xfers() still check
if (i3c_xfers[i].rnw), so HDR-DDR writes with cmd in 0x01..0x7f are
counted into nrxwords instead of ntxwords during the datafifodepth check,
and on completion their i3c_xfers[i].len is overwritten with cmd->rx_len
(0).

[1] https://lore.kernel.org/r/aukCf1reB8LWbuzq@lizhi-Precision-Tower-5810

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261111021151.58380-1-parame@synopsys.com?part=1

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

      reply	other threads:[~2026-11-11  2:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13  7:31 [PATCH] i3c: master: dw-i3c-master: Add HDR-DDR support to Designware Controller Dineshkumar Parameswaran
2026-10-13  7:42 ` sashiko-bot
2026-10-15 16:37   ` Frank Li
2026-11-01  0:52 ` [PATCH v2] " Dineshkumar Parameswaran
2026-11-01  1:06   ` sashiko-bot
2026-11-02 21:37   ` Frank Li
2026-11-11  2:11   ` [PATCH v3] " Dineshkumar Parameswaran
2026-11-11  2:54     ` sashiko-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=sashiko-outbox-208126@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Dineshkumar.Parameswaran@synopsys.com \
    --cc=Frank.Li@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-i3c@lists.infradead.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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