public inbox for cip-dev@lists.cip-project.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@nabladev.com>
To: tommaso.merciai.xr@bp.renesas.com
Cc: Pavel Machek <pavel@nabladev.com>,
	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: Wed, 14 Jan 2026 12:43:55 +0100	[thread overview]
Message-ID: <aWeBe5+GkGtvfYO4@duo.ucw.cz> (raw)
In-Reply-To: <aWDtZhy_vCiwVYuS@tom-desktop>

[-- Attachment #1: Type: text/plain, Size: 2179 bytes --]

Hi!

> > > +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()

Can you check the code again? It looked to me like ccc_cmd() does its
own allocation, and frees it. priv_xfers() does allocation, but does
not free it, otherwise being similar to ccc_cmd().

> > > +	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()

Yeah, and then we would need to do two more asserts when the devm_
setup fails.

Perhaps backporting
devm_reset_control_get_optional_exclusive_deasserted() would be best?

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

I won't do fixing this. I'll likely apply patch with known problems,
and will expect you to fix it up in follow up patches.

Best regards,
								Pavel
-- 
In cooperation with Nabla.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2026-01-14 11:44 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
2026-01-14 11:43       ` Pavel Machek [this message]
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=aWeBe5+GkGtvfYO4@duo.ucw.cz \
    --to=pavel@nabladev.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=tomm.merciai@gmail.com \
    --cc=tommaso.merciai.xr@bp.renesas.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