linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: georgi.djakov@linaro.org
Cc: a.swigon@samsung.com, cw00.choi@samsung.com,
	b.zolnierkie@samsung.com, m.szyprowski@samsung.com,
	krzk@kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	Sylwester Nawrocki <s.nawrocki@samsung.com>
Subject: [PATCH v5 3/3] interconnect: Allow inter-provider pairs to be configured
Date: Thu, 21 May 2020 14:28:41 +0200	[thread overview]
Message-ID: <20200521122841.8867-4-s.nawrocki@samsung.com> (raw)
In-Reply-To: <20200521122841.8867-1-s.nawrocki@samsung.com>

From: Artur Świgoń <a.swigon@samsung.com>

This patch adds support for a new boolean 'inter_set' field in struct
icc_provider. Setting it to 'true' enables calling '->set' for
inter-provider node pairs. All existing users of the interconnect
framework allocate this structure with kzalloc, and are therefore
unaffected by this change.

This makes it easier for hierarchies like exynos-bus, where every bus
is probed separately and registers a separate interconnect provider, to
model constraints between buses.

Signed-off-by: Artur Świgoń <a.swigon@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/interconnect/core.c           | 11 +++++------
 include/linux/interconnect-provider.h |  2 ++
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
index 6a342ef..b549249 100644
--- a/drivers/interconnect/core.c
+++ b/drivers/interconnect/core.c
@@ -263,23 +263,22 @@ static int aggregate_requests(struct icc_node *node)
 static int apply_constraints(struct icc_path *path)
 {
 	struct icc_node *next, *prev = NULL;
+	struct icc_provider *p;
 	int ret = -EINVAL;
 	int i;
 
 	for (i = 0; i < path->num_nodes; i++) {
 		next = path->reqs[i].node;
+		p = next->provider;
 
-		/*
-		 * Both endpoints should be valid master-slave pairs of the
-		 * same interconnect provider that will be configured.
-		 */
-		if (!prev || next->provider != prev->provider) {
+		/* both endpoints should be valid master-slave pairs */
+		if (!prev || (p != prev->provider && !p->inter_set)) {
 			prev = next;
 			continue;
 		}
 
 		/* set the constraints */
-		ret = next->provider->set(prev, next);
+		ret = p->set(prev, next);
 		if (ret)
 			goto out;
 
diff --git a/include/linux/interconnect-provider.h b/include/linux/interconnect-provider.h
index c92be2a..38701925 100644
--- a/include/linux/interconnect-provider.h
+++ b/include/linux/interconnect-provider.h
@@ -41,6 +41,7 @@ struct icc_node *of_icc_xlate_onecell(struct of_phandle_args *spec,
  * @xlate: provider-specific callback for mapping nodes from phandle arguments
  * @dev: the device this interconnect provider belongs to
  * @users: count of active users
+ * @inter_set: whether inter-provider pairs will be configured with @set
  * @data: pointer to private data
  */
 struct icc_provider {
@@ -53,6 +54,7 @@ struct icc_provider {
 	struct icc_node* (*xlate)(struct of_phandle_args *spec, void *data);
 	struct device		*dev;
 	int			users;
+	bool			inter_set;
 	void			*data;
 };
 
-- 
2.7.4


  parent reply	other threads:[~2020-05-21 12:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200521122848eucas1p27ce74486ea2044cb0b942b2619426e21@eucas1p2.samsung.com>
2020-05-21 12:28 ` [PATCH v5 0/3] interconnect: Support Samsung Exynos use-case Sylwester Nawrocki
     [not found]   ` <CGME20200521122854eucas1p2800cc56585f6f18512de270469cde59c@eucas1p2.samsung.com>
2020-05-21 12:28     ` [PATCH v5 1/3] interconnect: Export of_icc_get_from_provider() Sylwester Nawrocki
     [not found]   ` <CGME20200521122855eucas1p2b8dec2202f9913c80d93aa01842ea83f@eucas1p2.samsung.com>
2020-05-21 12:28     ` [PATCH v5 2/3] interconnect: Relax requirement in of_icc_get_from_provider() Sylwester Nawrocki
     [not found]   ` <CGME20200521122857eucas1p1db29d5dd09e801ca22214e94022a951b@eucas1p1.samsung.com>
2020-05-21 12:28     ` Sylwester Nawrocki [this message]
2020-05-27 13:46       ` [PATCH v5 3/3] interconnect: Allow inter-provider pairs to be configured Krzysztof Kozlowski
2020-05-27 13:49   ` [PATCH v5 0/3] interconnect: Support Samsung Exynos use-case Georgi Djakov
2020-05-27 14:41     ` Sylwester Nawrocki

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=20200521122841.8867-4-s.nawrocki@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=a.swigon@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=georgi.djakov@linaro.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.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;
as well as URLs for NNTP newsgroup(s).