public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cristian Marussi <cristian.marussi@arm.com>
To: Peng Fan <peng.fan@oss.nxp.com>
Cc: Cristian Marussi <cristian.marussi@arm.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, arm-scmi@vger.kernel.org,
	linux-clk@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	sudeep.holla@arm.com, philip.radford@arm.com,
	james.quinlan@broadcom.com, f.fainelli@gmail.com,
	vincent.guittot@linaro.org, etienne.carriere@foss.st.com,
	michal.simek@amd.com, dan.carpenter@linaro.org,
	geert+renesas@glider.be, kuninori.morimoto.gx@renesas.com,
	marek.vasut+renesas@gmail.com
Subject: Re: [PATCH v2 11/13] firmware: arm_scmi: Add bound iterators support
Date: Tue, 17 Mar 2026 09:22:38 +0000	[thread overview]
Message-ID: <abkdXkA4iyJ5HKH7@pluto> (raw)
In-Reply-To: <abkGQn9ODanEVns5@shlinux89>

On Tue, Mar 17, 2026 at 03:44:02PM +0800, Peng Fan wrote:
> On Tue, Mar 10, 2026 at 06:40:28PM +0000, Cristian Marussi wrote:
> >SCMI core stack provides some common helpers to handle in a unified way
> >multipart message replies: such iterator-helpers, when run, currently
> >process by default the whole set of discovered resources.
> >
> >Introduce an alternative way to run the initialized iterator on a limited
> >range of resources.
> >
> >Note that the subset of resources that can be chosen is anyway limited by
> >the SCMI protocol specification, since you are only allowed to choose the
> >startindex on a multi-part enumeration NOT the end index, so that the
> >effective number of returned items by a bound iterators depends really
> >on platform side decisions.
> >
> >Suggested-by: Etienne Carriere <etienne.carriere@foss.st.com>
> >Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
> >---
> >+static void scmi_iterator_cleanup(void *iter)
> >+{
> >+	struct scmi_iterator *i = iter;
> 
> I see you use no_free_ptr for allocation,
> Do we need to use __free for i or drop the __free usage in allocation? 

Neither I think...iter is allocated by iterator_init() which do use
__free cleanups to simplify error paths, BUT if everything goes fine
iter is returned with no_free_ptr() as a normal pointer and all the
compiler-attached cleanup helpers are removed...

Then you can use in an iterator_run() or iterator_run_bound() and in
borth case it HAS to be manually cleanup by calling this scmi_iterator_cleanup
helper where...

> 
> Regards
> Peng
> 
> >+
> >+	i->ph->xops->xfer_put(i->ph, i->t);
> >+	kfree(i);

..it is finally freed explicitly...

...or I am getting something else wrong around the cleanup helpers :P ?

Thanks,
Cristian

  reply	other threads:[~2026-03-17  9:22 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 18:40 [PATCH v2 00/13] SCMI Clock rates discovery rework Cristian Marussi
2026-03-10 18:40 ` [PATCH v2 01/13] clk: scmi: Fix clock rate rounding Cristian Marussi
2026-03-11 11:30   ` Geert Uytterhoeven
2026-03-11 18:33     ` Cristian Marussi
2026-03-10 18:40 ` [PATCH v2 02/13] firmware: arm_scmi: Add clock determine_rate operation Cristian Marussi
2026-03-10 18:40 ` [PATCH v2 03/13] clk: scmi: Use new determine_rate clock operation Cristian Marussi
2026-03-10 18:40 ` [PATCH v2 04/13] firmware: arm_scmi: Simplify clock rates exposed interface Cristian Marussi
2026-03-17  7:38   ` Peng Fan
2026-03-10 18:40 ` [PATCH v2 05/13] clk: scmi: Use new simplified per-clock rate properties Cristian Marussi
2026-03-18 15:29   ` Sudeep Holla
2026-03-10 18:40 ` [PATCH v2 06/13] firmware: arm_scmi: Drop unused clock rate interfaces Cristian Marussi
2026-03-10 18:40 ` [PATCH v2 07/13] firmware: arm_scmi: Make clock rates allocation dynamic Cristian Marussi
2026-03-17  7:28   ` Peng Fan
2026-03-10 18:40 ` [PATCH v2 08/13] firmware: arm_scmi: Harden clock protocol initialization Cristian Marussi
2026-03-11 16:59   ` Geert Uytterhoeven
2026-03-11 18:45     ` Cristian Marussi
2026-03-12 15:33       ` Sudeep Holla
2026-03-12 16:36         ` Cristian Marussi
2026-03-16 15:50           ` Geert Uytterhoeven
2026-03-16 16:14             ` Cristian Marussi
2026-03-16 16:35               ` Geert Uytterhoeven
2026-03-16 16:38                 ` Cristian Marussi
2026-03-24 13:43                 ` Geert Uytterhoeven
2026-03-25 11:02   ` Marek Szyprowski
2026-03-25 12:27     ` Cristian Marussi
2026-03-26  8:55       ` Alexander Stein
2026-03-26 10:16         ` Sudeep Holla
2026-03-10 18:40 ` [PATCH v2 09/13] firmware: arm_scmi: Harden clock parents discovery Cristian Marussi
2026-03-17  7:29   ` Peng Fan
2026-03-10 18:40 ` [PATCH v2 10/13] firmware: arm_scmi: Refactor iterators internal allocation Cristian Marussi
2026-03-17  7:35   ` Peng Fan
2026-03-10 18:40 ` [PATCH v2 11/13] firmware: arm_scmi: Add bound iterators support Cristian Marussi
2026-03-17  7:44   ` Peng Fan
2026-03-17  9:22     ` Cristian Marussi [this message]
2026-03-10 18:40 ` [PATCH v2 12/13] firmware: arm_scmi: Use bound iterators to minimize discovered rates Cristian Marussi
2026-03-10 18:40 ` [PATCH v2 13/13] firmware: arm_scmi: Introduce all_rates_get clock operation Cristian Marussi
2026-03-17  7:34   ` Peng Fan
2026-03-17  8:20 ` [PATCH v2 00/13] SCMI Clock rates discovery rework Geert Uytterhoeven

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=abkdXkA4iyJ5HKH7@pluto \
    --to=cristian.marussi@arm.com \
    --cc=arm-scmi@vger.kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=etienne.carriere@foss.st.com \
    --cc=f.fainelli@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=james.quinlan@broadcom.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=marek.vasut+renesas@gmail.com \
    --cc=michal.simek@amd.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=philip.radford@arm.com \
    --cc=sudeep.holla@arm.com \
    --cc=vincent.guittot@linaro.org \
    /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