From patchwork Thu May 21 12:28:39 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: 11562809 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7A3C615E4 for ; Thu, 21 May 2020 12:28:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5EAAD2078B for ; Thu, 21 May 2020 12:28:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="NnCukASh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728887AbgEUM24 (ORCPT ); Thu, 21 May 2020 08:28:56 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:46943 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729146AbgEUM24 (ORCPT ); Thu, 21 May 2020 08:28:56 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200521122854euoutp01f6acfb3c47a7ac458ba5659e76414f11~RCuf4wQGU3003330033euoutp01K for ; Thu, 21 May 2020 12:28:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200521122854euoutp01f6acfb3c47a7ac458ba5659e76414f11~RCuf4wQGU3003330033euoutp01K DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1590064134; bh=IZ7CS4NJbb36gBFM7iksoxNTIp+cLNBvatf2Qrqvda0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NnCukAShjdWJnjNlsnxyhKu5xMYA7AcHcYs4gnw44FJSxAXrwhkhpaQqzeJKMjYhp lSZkefUgBpnrN0VxM8JuCkzIuHcwvDbWAMjuXdMoO3m6MzD49qyMOJO/RgLiU8EFB6 Sqdn43ayrgt778dWlUl8q7gghVoi04mdgrv0iWJ8= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200521122854eucas1p13d58441e5d3560cf20fc7fd59a0da85e~RCufpeb3u2046020460eucas1p1r; Thu, 21 May 2020 12:28:54 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id B2.28.60698.60476CE5; Thu, 21 May 2020 13:28:54 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200521122854eucas1p2800cc56585f6f18512de270469cde59c~RCufLf5T_2575425754eucas1p2r; Thu, 21 May 2020 12:28:54 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200521122854eusmtrp1328491783e256f4b1fd7da9e24066663~RCufK3BiY2920829208eusmtrp1Z; Thu, 21 May 2020 12:28:54 +0000 (GMT) X-AuditID: cbfec7f5-a29ff7000001ed1a-19-5ec674061939 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id F7.8F.08375.50476CE5; Thu, 21 May 2020 13:28:54 +0100 (BST) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200521122853eusmtip26a086964120e0b4a5159e31bd4091706~RCuerkCOi1167511675eusmtip2i; Thu, 21 May 2020 12:28:53 +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 1/3] interconnect: Export of_icc_get_from_provider() Date: Thu, 21 May 2020 14:28:39 +0200 Message-Id: <20200521122841.8867-2-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+NgFlrBKsWRmVeSWpSXmKPExsWy7djPc7psJcfiDE5NVrK4P6+V0WLjjPWs Fte/PGe1mL53E5vF+fMb2C0u75rDZvG59wijxYzz+5gs1h65y25x+E07qwOXx6ZVnWwed67t YfPo27KK0ePzJrkAligum5TUnMyy1CJ9uwSujCUfZrIVTBKsWHm0gb2B8SZfFyMnh4SAicT5 nhNsXYxcHEICKxglNm/sYYFwvjBKfJ18FCrzmVFi5/zljDAtVy58YIRILGeUeH2jlRmuZeW/ a+wgVWwChhK9R/vAOkQEZCT2NE1iBSliFmhikri5eAPQEg4OYQF3iW/rokFMFgFViUnLk0DK eQWsJFbu62eBWCYvsXrDAWYQm1PAWmLbsSlMEDWCEidnPgGrYQaqad46G+wGCYFt7BLT/k1k g2h2kVj65y8zhC0s8er4FnYIW0bi9GSIPyUEmhklenbfZodwJjBK3D++AOpPa4k7536xgVzH LKApsX6XPkTYUeJr1y9mkLCEAJ/EjbeCEEfwSUzaNh0qzCvR0SYEUa0i8XvVdCYIW0qi+8l/ FogSD4nN/dETGBVnIflmFpJvZiGsXcDIvIpRPLW0ODc9tdg4L7Vcrzgxt7g0L10vOT93EyMw /Zz+d/zrDsZ9f5IOMQpwMCrx8FqkHYsTYk0sK67MPcQowcGsJMK7kP9onBBvSmJlVWpRfnxR aU5q8SFGaQ4WJXFe40UvY4UE0hNLUrNTUwtSi2CyTBycUg2Mfu3NvH6bbb9U3q4wm2K0jWUj 81qF7i8sH+ZqlL/2r74ia3NcWzD+n/IxiW6L2G8BZ6a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18512de270469cde59c X-Msg-Generator: CA X-RootMTR: 20200521122854eucas1p2800cc56585f6f18512de270469cde59c X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200521122854eucas1p2800cc56585f6f18512de270469cde59c 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 makes the above function public (for use in exynos-bus devfreq driver). Signed-off-by: Artur Świgoń Reviewed-by: Krzysztof Kozlowski Reviewed-by: Chanwoo Choi Signed-off-by: Sylwester Nawrocki --- drivers/interconnect/core.c | 3 ++- include/linux/interconnect-provider.h | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index ece2a57..1b51e0c 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -334,7 +334,7 @@ EXPORT_SYMBOL_GPL(of_icc_xlate_onecell); * Returns a valid pointer to struct icc_node on success or ERR_PTR() * on failure. */ -static struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec) +struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec) { struct icc_node *node = ERR_PTR(-EPROBE_DEFER); struct icc_provider *provider; @@ -353,6 +353,7 @@ static struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec) return node; } +EXPORT_SYMBOL_GPL(of_icc_get_from_provider); static void devm_icc_release(struct device *dev, void *res) { diff --git a/include/linux/interconnect-provider.h b/include/linux/interconnect-provider.h index 0c49453..c92be2a 100644 --- a/include/linux/interconnect-provider.h +++ b/include/linux/interconnect-provider.h @@ -103,6 +103,7 @@ void icc_node_del(struct icc_node *node); int icc_nodes_remove(struct icc_provider *provider); int icc_provider_add(struct icc_provider *provider); int icc_provider_del(struct icc_provider *provider); +struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec); #else @@ -154,6 +155,11 @@ static inline int icc_provider_del(struct icc_provider *provider) return -ENOTSUPP; } +static inline struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec) +{ + return ERR_PTR(-ENOTSUPP); +} + #endif /* CONFIG_INTERCONNECT */ #endif /* __LINUX_INTERCONNECT_PROVIDER_H */ From patchwork Thu May 21 12:28:40 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: 11562823 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4221390 for ; Thu, 21 May 2020 12:29:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2542920872 for ; Thu, 21 May 2020 12:29:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="JaOOYRP+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729311AbgEUM27 (ORCPT ); Thu, 21 May 2020 08:28:59 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:46954 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729301AbgEUM26 (ORCPT ); Thu, 21 May 2020 08:28:58 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200521122856euoutp011789a9ddb6a99e23bdcca76d09febec9~RCuhozk5L3052730527euoutp010 for ; Thu, 21 May 2020 12:28:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200521122856euoutp011789a9ddb6a99e23bdcca76d09febec9~RCuhozk5L3052730527euoutp010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1590064136; bh=QRNTjhidHU9c61aZQR469tlN0NU7e/1LVLkXIqdFPz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JaOOYRP+Hc2xS4bo1vGst62O3ZncqijEKA+n5XaeC7b25B5oER/foDK7gUENszboa xn4U1vxu92B0Xz1v/Hs+I1s/2qevC7cV+ENZ3UdC35MP/vOKyf3uhcPLmSM1NTUsP/ 7VzWH0oVD1QT85SXIwgpBXpUIY4XOGqilVb7UzUI= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200521122856eucas1p2c876ff8e8f4abf8bb8cd57c30b8adab7~RCuhIj5K-2589225892eucas1p2l; Thu, 21 May 2020 12:28:56 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 8D.E3.61286.80476CE5; Thu, 21 May 2020 13:28:56 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200521122855eucas1p2b8dec2202f9913c80d93aa01842ea83f~RCug2ymOr2553325533eucas1p2n; Thu, 21 May 2020 12:28:55 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200521122855eusmtrp162da15abce02538d7853c0cc90ff84ca~RCug2LT4S2920829208eusmtrp1d; Thu, 21 May 2020 12:28:55 +0000 (GMT) X-AuditID: cbfec7f2-ef1ff7000001ef66-c4-5ec67408bcb6 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 09.8F.08375.70476CE5; Thu, 21 May 2020 13:28:55 +0100 (BST) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200521122855eusmtip2126c1e50b9d4023bf612017538bdc190~RCugZRkp81167511675eusmtip2j; Thu, 21 May 2020 12:28:55 +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 2/3] interconnect: Relax requirement in of_icc_get_from_provider() Date: Thu, 21 May 2020 14:28:40 +0200 Message-Id: <20200521122841.8867-3-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+NgFlrJKsWRmVeSWpSXmKPExsWy7djPc7ocJcfiDNo3cVncn9fKaLFxxnpW i+tfnrNaTN+7ic3i/PkN7BaXd81hs/jce4TRYsb5fUwWa4/cZbc4/Kad1YHLY9OqTjaPO9f2 sHn0bVnF6PF5k1wASxSXTUpqTmZZapG+XQJXxvGXE9gLWrkqFi06xN7AeICji5GTQ0LARGLX 4pdMXYxcHEICKxglzvY0MYEkhAS+MEqsXK8AkfjMKLHs4012mI73F58zQySWM0p86XjECuEA dSxqbGABqWITMJToPdrHCGKLCMhI7GmaBFbELNDEJHFz8QawImGBcIlLDd/AbBYBVYlnneeA dnNw8ApYScx/VQqxTV5i9YYDzCA2p4C1xLZjU8DO4xUQlDg58wlYKzNQTfPW2WAXSQjsYpc4 8/M2I0Szi8Sev5vZIGxhiVfHt0C9ICNxenIPC0RDM6NEz+7b7BDOBEaJ+8cXQHVbS9w594sN 5CJmAU2J9bv0IcKOEiealjOChCUE+CRuvBWEOIJPYtK26cwQYV6JjjYhiGoVid+rpjNB2FIS 3U/+s0DYHhIH2/vZJjAqzkLyziwk78xC2LuAkXkVo3hqaXFuemqxYV5quV5xYm5xaV66XnJ+ 7iZGYAI6/e/4px2MXy8lHWIU4GBU4uF9kHwsTog1say4MvcQowQ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utaxec0yAeUW TB1BKxZsKmPflGBUvr0k2P6Xhu2LM1vYZx7cbqZybdvG9NrJb4Pt2tYJXjl19O/c9tzl33ex pZsosRRnJBpqMRcVJwIAVy8Mo74CAAA= X-CMS-MailID: 20200521122855eucas1p2b8dec2202f9913c80d93aa01842ea83f X-Msg-Generator: CA X-RootMTR: 20200521122855eucas1p2b8dec2202f9913c80d93aa01842ea83f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200521122855eucas1p2b8dec2202f9913c80d93aa01842ea83f 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 relaxes the condition in of_icc_get_from_provider() so that it is no longer required to set '#interconnect-cells' to <1> in the DT, and therefore it is not required to supply dummy node IDs in the 'interconnects' property when node IDs are dynamically generated rather than hardcoded (statically allocated). In case of the devfreq driver for exynos-bus, node IDs are dynamically allocated and '#interconnect-cells' is always zero. Signed-off-by: Artur Świgoń Acked-by: Krzysztof Kozlowski Reviewed-by: Chanwoo Choi Signed-off-by: Sylwester Nawrocki --- drivers/interconnect/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 1b51e0c..6a342ef 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -339,7 +339,7 @@ struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec) struct icc_node *node = ERR_PTR(-EPROBE_DEFER); struct icc_provider *provider; - if (!spec || spec->args_count != 1) + if (!spec) return ERR_PTR(-EINVAL); mutex_lock(&icc_lock); 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: 11562819 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 216C81392 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 03E272088E for ; Thu, 21 May 2020 12:29:02 +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 YXtITN99lmUCo+IsJN/MQvLNLIS9CxiZVzGKp5YW56anFhvlpZbrFSfmFpfmpesl5+duYgQm ntP/jn/ZwbjrT9IhRgEORiUe3gfJx+KEWBPLiitzDzFKcDArifAu5D8aJ8SbklhZlVqUH19U mpNafIhRmoNFSZzXeNHLWCGB9MSS1OzU1ILUIpgsEwenVAPj6nkn+jcl8Qeqaxq94jkynyfb c/6Bi++zq688/7w3IObRpgnXxZ8fZtWfaHDjvPJf7o45aVvvsy1RSOuS+zN31lqGmA5GRieX X5WrrTVqZh1b2Xks+IeSVMQflZpTgddcLOZndOt3zXwc0ap7nK1t3RpWTueYU/simh4qrv5i Jt5g5nbX2qleiaU4I9FQi7moOBEAvx4PRDgDAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFIsWRmVeSWpSXmKPExsVy+t/xe7qcJcfiDOae4rO4P6+V0WLjjPWs Fte/PGe1mL53E5vF+fMb2C0u75rDZvG59wijxYzz+5gs1h65y25x+E07qwOXx6ZVnWwed67t YfPo27KK0ePzJrkAlig9m6L80pJUhYz84hJbpWhDCyM9Q0sLPSMTSz1DY/NYKyNTJX07m5TU nMyy1CJ9uwS9jPe9F9gLjolU7G3sYmlgvCDQxcjBISFgIvFxj10XIxeHkMBSRolJK/qYIOJS EvNblLoYOYFMYYk/17rYQGwhgU+MEpe3MIPYbAKGEr1H+xhBbBEBGYk9TZNYQeYwC/QwSZz5 vIAdJCEsECgxqfccC8hMFgFVian3akDCvAJWEucXfGODmC8vsXrDAbCZnALWEtuOTWGC2GUl cfHBAXaIekGJkzOfgI1hFlCXWD9PCCTMDNTavHU28wRGwVlIqmYhVM1CUrWAkXkVo0hqaXFu em6xkV5xYm5xaV66XnJ+7iZGYDxtO/Zzyw7GrnfBhxgFOBiVeHgfJB+LE2JNLCuuzD3EKMHB rCTCu5D/aJwQb0piZVVqUX58UWlOavEhRlOgzyYyS4km5wNjPa8k3tDU0NzC0tDc2NzYzEJJ nLdD4GCMkEB6YklqdmpqQWoRTB8TB6dUA+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 Acked-by: Krzysztof Kozlowski --- 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; };