From: Georgi Djakov <djakov@kernel.org>
To: Raviteja Laggyshetty <quic_rlaggysh@quicinc.com>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Odelu Kukatla <quic_okukatla@quicinc.com>,
Mike Tipton <quic_mdtipton@quicinc.com>,
Jagadeesh Kona <quic_jkona@quicinc.com>
Cc: Jeff Johnson <jeff.johnson@oss.qualcomm.com>,
Sibi Sankar <quic_sibis@quicinc.com>,
linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V10 2/7] interconnect: core: Add dynamic id allocation support
Date: Mon, 14 Apr 2025 12:57:23 +0300 [thread overview]
Message-ID: <5310f549-fdb0-4554-87fc-33bf61e752b7@kernel.org> (raw)
In-Reply-To: <20250324183203.30127-3-quic_rlaggysh@quicinc.com>
On 24.03.25 20:31, Raviteja Laggyshetty wrote:
> The current interconnect framework relies on static IDs for node
> creation and registration, which limits topologies with multiple
> instances of the same interconnect provider. To address this,
> introduce icc_node_create_dyn() and icc_link_nodes() APIs to
> dynamically allocate IDs for interconnect nodes during creation
> and link. This change removes the dependency on static IDs,
> allowing multiple instances of the same hardware, such as EPSS L3.
>
Hi Raviteja,
Thank you for working on this!
> Signed-off-by: Raviteja Laggyshetty <quic_rlaggysh@quicinc.com>
> ---
> drivers/interconnect/core.c | 83 ++++++++++++++++++++++++++-
> include/linux/interconnect-provider.h | 12 ++++
> include/linux/interconnect.h | 3 +
> 3 files changed, 97 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
> index 9d5404a07e8a..d4c40c2b3ec1 100644
> --- a/drivers/interconnect/core.c
> +++ b/drivers/interconnect/core.c
> @@ -20,6 +20,8 @@
>
> #include "internal.h"
>
> +#define ICC_DYN_ID_START 10000
> +
> #define CREATE_TRACE_POINTS
> #include "trace.h"
>
> @@ -826,7 +828,12 @@ static struct icc_node *icc_node_create_nolock(int id)
> if (!node)
> return ERR_PTR(-ENOMEM);
>
> - id = idr_alloc(&icc_idr, node, id, id + 1, GFP_KERNEL);
> + /* dynamic id allocation */
> + if (id == ICC_ALLOC_DYN_ID)
> + id = idr_alloc(&icc_idr, node, ICC_DYN_ID_START, 0, GFP_KERNEL);
> + else
> + id = idr_alloc(&icc_idr, node, id, id + 1, GFP_KERNEL);
> +
> if (id < 0) {
> WARN(1, "%s: couldn't get idr\n", __func__);
> kfree(node);
> @@ -838,6 +845,26 @@ static struct icc_node *icc_node_create_nolock(int id)
> return node;
> }
>
> +/**
> + * icc_node_create_dyn() - create a node with dynamic id
> + * @id: node id
This function does not take any arguments. Please remove.
> + *
> + * Return: icc_node pointer on success, or ERR_PTR() on error
> + */
> +struct icc_node *icc_node_create_dyn(void)
> +{
> + struct icc_node *node;
> +
> + mutex_lock(&icc_lock);
> +
> + node = icc_node_create_nolock(ICC_ALLOC_DYN_ID);
> +
> + mutex_unlock(&icc_lock);
> +
> + return node;
> +}
> +EXPORT_SYMBOL_GPL(icc_node_create_dyn);
BR,
Georgi
next prev parent reply other threads:[~2025-04-14 9:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-24 18:31 [PATCH V10 0/7]Add EPSS L3 provider support on SA8775P SoC Raviteja Laggyshetty
2025-03-24 18:31 ` [PATCH V10 1/7] dt-bindings: interconnect: Add EPSS L3 compatible for SA8775P Raviteja Laggyshetty
2025-03-24 18:31 ` [PATCH V10 2/7] interconnect: core: Add dynamic id allocation support Raviteja Laggyshetty
2025-04-14 9:57 ` Georgi Djakov [this message]
2025-03-24 18:31 ` [PATCH V10 3/7] interconnect: qcom: Add multidev EPSS L3 support Raviteja Laggyshetty
2025-04-14 9:58 ` Georgi Djakov
2025-03-24 18:32 ` [PATCH V10 4/7] interconnect: qcom: icc-rpmh: Add dynamic icc node id support Raviteja Laggyshetty
2025-03-26 17:41 ` Dmitry Baryshkov
2025-03-24 18:32 ` [PATCH V10 5/7] interconnect: qcom: sa8775p: " Raviteja Laggyshetty
2025-03-26 17:41 ` Dmitry Baryshkov
2025-03-24 18:32 ` [PATCH V10 6/7] arm64: dts: qcom: sa8775p: add EPSS l3 interconnect provider Raviteja Laggyshetty
2025-03-26 17:41 ` Dmitry Baryshkov
2025-03-24 18:32 ` [PATCH V10 7/7] arm64: dts: qcom: sa8775p: Add CPU OPP tables to scale DDR/L3 Raviteja Laggyshetty
2025-03-26 17:42 ` Dmitry Baryshkov
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=5310f549-fdb0-4554-87fc-33bf61e752b7@kernel.org \
--to=djakov@kernel.org \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jeff.johnson@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=quic_jkona@quicinc.com \
--cc=quic_mdtipton@quicinc.com \
--cc=quic_okukatla@quicinc.com \
--cc=quic_rlaggysh@quicinc.com \
--cc=quic_sibis@quicinc.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
all inboxes | Powered by JetHome®