public inbox for cip-dev@lists.cip-project.org
 help / color / mirror / Atom feed
From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
To: Pavel Machek <pavel@nabladev.com>
Cc: cip-dev@lists.cip-project.org,
	Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	tomm.merciai@gmail.com
Subject: Re: [cip-dev] [PATCH 6.1.y-cip 04/22] i3c: master: Add basic driver for the Renesas I3C controller
Date: Fri, 9 Jan 2026 12:58:30 +0100	[thread overview]
Message-ID: <aWDtZhy_vCiwVYuS@tom-desktop> (raw)
In-Reply-To: <aWDW8tT9BNp3Cz+L@duo.ucw.cz>

Hi Pavel,
Thanks for your review!


On Fri, Jan 09, 2026 at 11:22:42AM +0100, Pavel Machek wrote:
> Hi!
> 
> Some comments and questions are below.
> 
> > Add a basic driver for the I3C controller found in Renesas RZ/G3S and
> > G3E SoCs. Support I3C pure busses (tested with two targets) and mixed
> > busses (two I3C devices plus various I2C targets). DAA and communication
> > with temperature sensors worked reliably at various speeds.
> > 
> > Missing features such as IBI, HotJoin, and target mode will be added
> > incrementally.
> > 
> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > Reviewed-by: Frank Li <Frank.Li@nxp.com>
> > Link: https://lore.kernel.org/r/20250724094146.6443-5-wsa+renesas@sang-engineering.com
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > [tommaso.merciai:
> >  - Removed  __counted_by(ncmds) from struct renesas_i3c_cmd cmds[]
> >  - Added struct reset_control *tresetn, *presetn into struct
> >    renesas_i3c
> >  - Use devm_reset_control_get_optional_exclusive() into probe function +
> >    reset_control_deassert() and devm_add_action_or_reset() for tresetn,
> >    presetn error path.
> >  - Fixed renesas_i3c_remove() from static void to static int]
> > Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> 
> > diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
> > new file mode 100644
> > index 000000000000..432be328a4e4
> > --- /dev/null
> > +++ b/drivers/i3c/master/renesas-i3c.c
> ...
> > +	/* Initialize Queue/Buffer threshold */
> > +	renesas_writel(i3c->regs, NQTHCTL, NQTHCTL_IBIDSSZ(6) |
> > +					     NQTHCTL_CMDQTH(1));
> > +
> > +	/* The only supported configuration is two entries*/
> 
> Add a space before */.

Ack, thanks.

> 
> ...
> > +	/* Hot-Join Acknowlege setting. */
> > +	renesas_set_bit(i3c->regs, BCTL, BCTL_HJACKCTL);
> 
> I would not mind consistency in the dots at the end of comment. Normal
> convention is not to have them unless comment is a sentence.

Oks, thanks.

> 
> 
> > +static int renesas_i3c_priv_xfers(struct i3c_dev_desc *dev, struct i3c_priv_xfer *i3c_xfers,
> > +					 int i3c_nxfers)
> > +{
> > +	struct i3c_master_controller *m = i3c_dev_get_master(dev);
> > +	struct renesas_i3c *i3c = to_renesas_i3c(m);
> > +	struct renesas_i3c_i2c_dev_data *data = i3c_dev_get_master_data(dev);
> > +	struct renesas_i3c_xfer *xfer;
> > +	int i;
> > +
> > +	/* Enable I3C bus. */
> > +	renesas_i3c_bus_enable(m, true);
> > +
> > +	xfer = renesas_i3c_alloc_xfer(i3c, 1);
> > +	if (!xfer)
> > +		return -ENOMEM;
> 
> ...where is xfer freed?

Please correct me if I'm wrong but xfer is freed at the end of
renesas_i3c_send_ccc_cmd()

> 
> > +		xfer = i3c->xferqueue.cur;
> > +		cmd = xfer->cmds;
> > +
> > +		/* Clear the Respone Queue Full status flag*/
> > +		renesas_clear_bit(i3c->regs, NTST, NTST_RSPQFF);
> 
> Space before */, please.
> 
> > +	ret = reset_control_deassert(i3c->tresetn);
> > +	if (ret)
> > +		return ret;
> > +
> > +	ret = reset_control_deassert(i3c->presetn);
> > +	if (ret)
> ## BUG:		return ret;
> 
> > +	ret = devm_add_action_or_reset(&pdev->dev, renesas_i3c_reset_control_assert,
> > +				       i3c->tresetn);
> > +	if (ret)
> > +		return ret;
> > +
> > +	ret = devm_add_action_or_reset(&pdev->dev, renesas_i3c_reset_control_assert,
> > +				       i3c->presetn);
> > +	if (ret)
> > +		return ret;
> 
> This is wrong, AFAICT. If return happens at marked line, we'll leave
> tresetn asserted.

Ouch, you are right!
This should be:

	ret = reset_control_deassert(i3c->tresetn);
	if (ret)
		return ret;

	ret = reset_control_deassert(i3c->presetn);
	if (ret) {
		reset_control_assert(i3c->tresetn);
		return ret;
	}

As I've introduce these calls because of missing

devm_reset_control_get_optional_exclusive_deasserted()



Should I fix in v2? Or you can take of this while applying?
Thanks.


> 
> Best regards,
> 								Pavel
> -- 
> In cooperation with Nabla.


Kind Regards,
Tommaso



  reply	other threads:[~2026-01-09 11:59 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-08  9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 01/22] bitops: add generic parity calculation for u8 Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 02/22] dt-bindings: i3c: Add Renesas I3C controller Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 03/22] i3c: controllers do not need to depend on I3C Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 04/22] i3c: master: Add basic driver for the Renesas I3C controller Tommaso Merciai
2026-01-09 10:22   ` [cip-dev] " Pavel Machek
2026-01-09 11:58     ` Tommaso Merciai [this message]
2026-01-14 11:43       ` Pavel Machek
2026-01-14 11:53   ` Pavel Machek
2026-01-08  9:28 ` [PATCH 6.1.y-cip 05/22] i3c: Document I3C_ADDR_SLOT_EXT_STATUS_MASK Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 06/22] i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 07/22] i3c: Standardize defines for specification parameters Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 08/22] i3c: Add more parameters for controllers to the header Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 09/22] i3c: master: Add helpers for DMA mapping and bounce buffer handling Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 10/22] i3c: document i3c_xfers Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 11/22] i3c: master: Add inline i3c_readl_fifo() and i3c_writel_fifo() Tommaso Merciai
2026-01-09 10:26   ` [cip-dev] " Pavel Machek
2026-01-08  9:28 ` [PATCH 6.1.y-cip 12/22] i3c: Correct the macro module_i3c_i2c_driver Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 13/22] i3c: export SETDASA method Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 14/22] clk: renesas: r9a09g047: Add I3C0 clocks and resets Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 15/22] arm64: dts: renesas: r9a09g047: Add I3C node Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 16/22] dt-bindings: hwmon: ti,tmp108: document V+ supply, add short description Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 17/22] dt-bindings: hwmon: ti,tmp108: Add nxp,p3t1085 compatible string Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 18/22] hwmon: (tmp108) Add NXP p3t1085 support Tommaso Merciai
2026-01-09 10:29   ` [cip-dev] " Pavel Machek
2026-01-08  9:28 ` [PATCH 6.1.y-cip 19/22] hwmon: (tmp108) Add helper function tmp108_common_probe() to prepare I3C support Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 20/22] hwmon: (tmp108) Add support for I3C device Tommaso Merciai
2026-01-09 10:32   ` [cip-dev] " Pavel Machek
2026-01-08  9:28 ` [PATCH 6.1.y-cip 21/22] hwmon: (tmp108) Do not fail in I3C probe when I3C regmap is a module Tommaso Merciai
2026-01-08  9:28 ` [PATCH 6.1.y-cip 22/22] hwmon: (tmp108) Add basic regulator support Tommaso Merciai
2026-01-09 10:39 ` [cip-dev] [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Pavel Machek
2026-01-09 12:08   ` Tommaso Merciai
2026-01-13  5:43     ` nobuhiro.iwamatsu.x90
2026-01-15  8:50       ` Pavel Machek

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=aWDtZhy_vCiwVYuS@tom-desktop \
    --to=tommaso.merciai.xr@bp.renesas.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=pavel@nabladev.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=tomm.merciai@gmail.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