mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Artur Świgoń" <a.swigon@samsung.com>
To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-samsung-soc@vger.kernel.org
Cc: "Artur Świgoń" <a.swigon@samsung.com>,
	georgi.djakov@linaro.org, cw00.choi@samsung.com,
	b.zolnierkie@samsung.com, m.szyprowski@samsung.com,
	krzk@kernel.org
Subject: [PATCH v4 3/3] interconnect: Allow inter-provider pairs to be configured
Date: Thu, 16 Jan 2020 15:42:02 +0100	[thread overview]
Message-ID: <20200116144202.12116-4-a.swigon@samsung.com> (raw)
In-Reply-To: <20200116144202.12116-1-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 (or between buses and DMC, handled by
two separate drivers in case of Exynos5422).

Signed-off-by: Artur Świgoń <a.swigon@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 5ea270af5ff4..caa9e35f06a3 100644
--- a/drivers/interconnect/core.c
+++ b/drivers/interconnect/core.c
@@ -259,23 +259,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 cc965b8fab53..b6ae0ee686c5 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.17.1


  parent reply	other threads:[~2020-01-16 14:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200116144241eucas1p226c1d7fc2fad5bd1b9fb6d0fb1b22bff@eucas1p2.samsung.com>
2020-01-16 14:41 ` [PATCH v4 0/3] interconnect: Support Samsung Exynos use-case Artur Świgoń
     [not found]   ` <CGME20200116144241eucas1p18dcf099873015e955d71d90712bbe9e0@eucas1p1.samsung.com>
2020-01-16 14:42     ` [PATCH v4 1/3] interconnect: Export of_icc_get_from_provider() Artur Świgoń
2020-01-23  9:21       ` Georgi Djakov
2020-01-24 11:22         ` Artur Świgoń
     [not found]   ` <CGME20200116144242eucas1p2bf8b4df91355974c8c96778f4ec117f7@eucas1p2.samsung.com>
2020-01-16 14:42     ` [PATCH v4 2/3] interconnect: Relax requirement in of_icc_get_from_provider() Artur Świgoń
2020-01-17  5:24       ` Chanwoo Choi
     [not found]   ` <CGME20200116144242eucas1p1b66d8ca0d111f140c48b80c5064ca4ff@eucas1p1.samsung.com>
2020-01-16 14:42     ` Artur Świgoń [this message]
2020-01-17  5:31   ` [PATCH v4 0/3] interconnect: Support Samsung Exynos use-case Chanwoo Choi
2020-01-17  6:10     ` Artur Świgoń
2020-01-17  7:14       ` Chanwoo Choi

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=20200116144202.12116-4-a.swigon@samsung.com \
    --to=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

all inboxes | Powered by JetHome®