From patchwork Thu May 21 12:28:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\\(PLT\\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 213357 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32213C433E1 for ; Thu, 21 May 2020 12:29:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E7C1820825 for ; Thu, 21 May 2020 12:29:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="ODqnwnmL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729308AbgEUM3B (ORCPT ); Thu, 21 May 2020 08:29:01 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:46967 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729307AbgEUM3A (ORCPT ); Thu, 21 May 2020 08:29:00 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200521122858euoutp01da8047ba3c9813de1bf296a1af839d63~RCujQPKeh3068030680euoutp01v for ; Thu, 21 May 2020 12:28:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200521122858euoutp01da8047ba3c9813de1bf296a1af839d63~RCujQPKeh3068030680euoutp01v DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1590064138; bh=igXGRewGvuHwG1JtRT/phNUdDRjD08TvAgW2YxVqo4M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ODqnwnmLnd6a0bEV8c+h1VnQ47cQuHArvm+C/It1fIWECdPl9M5ihqt8OHNjeOIQe +Lqb7lcFN328fiNw3J3IkctEn3SBrHerkzqBMhRTPNKjygqRG2bduo1BDnWhLgjYap 4AKY+JMsuCUic2ES0y+Ko99myW1kFYYGoyQHErrM= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200521122857eucas1p244a6ea13ecf91a631fdcac6f74c2d638~RCuiXTTzq2557525575eucas1p2i; Thu, 21 May 2020 12:28:57 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 71.38.60679.90476CE5; Thu, 21 May 2020 13:28:57 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200521122857eucas1p1db29d5dd09e801ca22214e94022a951b~RCuiJFOBq2055920559eucas1p1K; Thu, 21 May 2020 12:28:57 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200521122857eusmtrp24965f68ad019e8c96894122014cfcb08~RCuiIZdZr3031730317eusmtrp2M; Thu, 21 May 2020 12:28:57 +0000 (GMT) X-AuditID: cbfec7f4-0e5ff7000001ed07-50-5ec67409c827 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id C5.6C.07950.90476CE5; Thu, 21 May 2020 13:28:57 +0100 (BST) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200521122856eusmtip2fa784dfb01e2c67cef875537ef683d8c~RCuhqQ3Ta0357403574eusmtip2j; Thu, 21 May 2020 12:28:56 +0000 (GMT) From: Sylwester Nawrocki 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 Subject: [PATCH v5 3/3] interconnect: Allow inter-provider pairs to be configured Date: Thu, 21 May 2020 14:28:41 +0200 Message-Id: <20200521122841.8867-4-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521122841.8867-1-s.nawrocki@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKKsWRmVeSWpSXmKPExsWy7djPc7qcJcfiDF7vkLO4P6+V0WLjjPWs Fte/PGe1mL53E5vF+fMb2C0u75rDZvG59wijxYzz+5gs1h65y25x+E07qwOXx6ZVnWwed67t YfPo27KK0ePzJrkAligum5TUnMyy1CJ9uwSujPe9F9gLjolU7G3sYmlgvCDQxcjBISFgIrF4 c3oXIxeHkMAKRonWzztYIJwvjBIzF25khnA+M0r0LtrMAtPxcY9dFyMnUHw5UNGberiGZbv3 sIAk2AQMJXqP9jGC2CICMhJ7miaxghQxCzQxSdxcvAFskLBAsMSB9eUgJouAqsTUezUg5bwC VhLnF3xjA7ElBOQlVm84wAxicwpYS2w7NoUJokZQ4uTMJ2CrmIFqmrfOZoao38Yu8eSID4Tt IvF86wNWCFtY4tXxLewQtozE/53zmUDOkRBoZpTo2X2bHcKZwChx//gCRogqa4k7536xgRzH LKApsX6XPkTYUWLT7OXMkHDgk7jxVhDiBj6JSdumQ4V5JTrahCCqVSR+r5rOBGFLSXQ/+c8C YXt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TB8TB6dUA+MiZ/Y5GW8O9q2QVoqae+ulYTO7Qq/p/VVs/RlP zhbGR0dl2tvarknZevKS6+T6ic9N9Jo4bI2qZDr3ump1Xlhd+OlwljZLy7GdkUsKN+Z83rf5 tr6zwB47vSNTc/4Ly6WunBNzUGNh/t/C/aFJjRHH4koVHVPXHNpivmRe/W/fn5M6FoV4/FRi Kc5INNRiLipOBABEHfAAvQIAAA== X-CMS-MailID: 20200521122857eucas1p1db29d5dd09e801ca22214e94022a951b X-Msg-Generator: CA X-RootMTR: 20200521122857eucas1p1db29d5dd09e801ca22214e94022a951b X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200521122857eucas1p1db29d5dd09e801ca22214e94022a951b References: <20200521122841.8867-1-s.nawrocki@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Artur Świgoń 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ń Signed-off-by: Sylwester Nawrocki --- 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; };