summaryrefslogtreecommitdiff
path: root/drivers/interconnect
diff options
context:
space:
mode:
authorArtur Świgoń <a.swigon@samsung.com>2020-05-21 14:28:41 +0200
committerGeorgi Djakov <georgi.djakov@linaro.org>2020-06-16 16:38:43 +0300
commit65461e26b1fe73bde4326367ee23cc1a24e6c33e (patch)
treeb2c266eff016db74571ae0bfe03f437f4bd260ab /drivers/interconnect
parent0259a41da3233744f6a3e7848430da13100423d6 (diff)
interconnect: Allow inter-provider pairs to be configured
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> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20200521122841.8867-4-s.nawrocki@samsung.com Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Diffstat (limited to 'drivers/interconnect')
-rw-r--r--drivers/interconnect/core.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
index 8b4d50d59e16..609e206bf598 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;