Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1374108ybk; Thu, 21 May 2020 05:31:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeL/s3utk0djhUx37HMTAXgfDsRTluVzSvh5nnr7zvu6MYLru5qh6jgpiwbbZN4nTSjgNQ X-Received: by 2002:a17:906:6d10:: with SMTP id m16mr3223817ejr.84.1590064261868; Thu, 21 May 2020 05:31:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590064261; cv=none; d=google.com; s=arc-20160816; b=R+EcAcZ6ATl7gAOJ0KEyopq+HM15XXtmT3/QWyTT9Y1tsBd4wLsK1E1jU6OmNNb6I7 5mDr6Xnz32xUc/NVgvqIFbyym89+Dqo8vs2CEbqKDOlj6GkrkPcHt1FI9HibWs33hEnE pHFfJrSYSNIsSm5owXUgoaRglbUscB6v37k9HHcPO6hRMP5u0E4U3i//gX+kiPmDKvYi 43XzRml+790+paQstmpWK3zzY9ZV11Y1GRdjkxyxEk0wB2n/sM2TP54g05nbAZMzzue+ geYztcDDHMRJRQnxHzsumuRxiqRnoOY9AQ/TOyIUW1aVEHrrJlR+EPcUda7HG2ZyPJjb 27mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type :content-transfer-encoding:mime-version:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=igXGRewGvuHwG1JtRT/phNUdDRjD08TvAgW2YxVqo4M=; b=QrnajR0m7mRGtIjkcoe+Qh33tNUpGvSN4nKzIJb2hWA++QokLMvizcyaqOuLCKByWx Jhs93od0wyGYo1k2s20vUKrc/rp+BvrYV2csLc5fQBL/rg3cvTJlr95WSt6oB29Bbks0 tkZQrG9lITRVgVFyDapmUahtrWiBug+tkWIz2+JCPhVUC2+ZtTMopjQdOKx8SYxR8Uy/ CnNcf+8KZFhePZUpyCi+zul2jiSteuKW1qri8daiAFlBra4NdZufj6aZRjRBhuoch3z6 W5fThzwgd07dkS5xiQ+hOFulsk1MIgQ48/u7GAdB2DdmL2379A7wFkT7w9i2zfZw19r1 2AJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ODqnwnmL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kt25si3278037ejb.511.2020.05.21.05.30.36; Thu, 21 May 2020 05:31:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ODqnwnmL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729337AbgEUM3C (ORCPT + 99 others); Thu, 21 May 2020 08:29:02 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:57967 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729299AbgEUM3A (ORCPT ); Thu, 21 May 2020 08:29:00 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200521122858euoutp02a6936c7b9cf75434d8a58e4a0e59574e~RCujP3OFr0397503975euoutp02g for ; Thu, 21 May 2020 12:28:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200521122858euoutp02a6936c7b9cf75434d8a58e4a0e59574e~RCujP3OFr0397503975euoutp02g 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 Content-Transfer-Encoding: 8bit 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/j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+T6ic9N9Jo4bI2qZDr3ump1Xlhd+OlwljZLy7GdkUsKN+Z83rf5 tr6zwB47vSNTc/4Ly6WunBNzUGNh/t/C/aFJjRHH4koVHVPXHNpivmRe/W/fn5M6FoV4/FRi Kc5INNRiLipOBABEHfAAvQIAAA== X-CMS-MailID: 20200521122857eucas1p1db29d5dd09e801ca22214e94022a951b X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200521122857eucas1p1db29d5dd09e801ca22214e94022a951b X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200521122857eucas1p1db29d5dd09e801ca22214e94022a951b References: <20200521122841.8867-1-s.nawrocki@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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; }; -- 2.7.4