Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8630597rwl; Tue, 10 Jan 2023 16:47:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXtGZHJFqWVdJgNbRKgg4dZ5SiQ5pTFl2W5+5K2ZRzUsvFm45acWVSyyfJVpKyUVC6wdmwLo X-Received: by 2002:a17:902:8686:b0:194:3fd8:f56a with SMTP id g6-20020a170902868600b001943fd8f56amr3819397plo.55.1673398051522; Tue, 10 Jan 2023 16:47:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673398051; cv=none; d=google.com; s=arc-20160816; b=oIdfoHwo141dCBK2cbCtFun3hqhbCUF5xfG8EbUsaa1mtkCRssXzhDFeIHINDp9sVr V+No8az1knQ3giGrdjFGq9rnYs1lbJTJs8ReOD79Dtg5DxS7G06qAMByzn+14VxnKHjt 3m+6oP3QrYdKvXy8WT5jEvoEQMTGbDbl5/MuIXxPuzTarjlNkAJR6AaArAsu/QyXLUy1 akpKs75A/oHaFNoYpeJ4q/1TFcubaWdh6ZvyWaLIm0qwh/UV1emP3eNuC/aggX00f2Ud R/sWrv7ZVDBjBlNWO67R8lmxxWAKLgtJVyhgkz6cB8EL6ZCC8Cc09cbKUkA0/3dFSVZS zapw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=bxJysdNIrmRjvFROtnsTQyJodAB8veehuxuxefoCP2c=; b=HDXB0/0XVK1kEvqzo0Mq0qCBxTW9mp3Kr5imjsEW95GPti+eCaK2cM/OPrHgvZViiD 7kaW1kYz8mVqcsZVy/a83Ao8IxHy0qiK7DwUAcvgOt28HfomET7q1HGxGcNC9nM51X5F 95mnOoOBqFShBcUCLR6MNaWsI5m3qmihQM5QwYY+AJJD0DtSgeY2i2ZG1+GFD+9A4W4c LHOM5bdLLF09YHjCYK6AiDM35akQtwQr+jvCNXeMHHP437a3JTsTtN7Ibo3jm+gaoISg rGae/ZJ0bF6d2aD3HlfYhjd1qX8qFPbXKBYJrQQlZa1QnK7VfJ2Lejv2QQuL3ZWXZ3E0 pNrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rnirWVpi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q20-20020a170902b11400b00187073496b4si12444323plr.136.2023.01.10.16.47.25; Tue, 10 Jan 2023 16:47:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rnirWVpi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234935AbjAJXz7 (ORCPT + 53 others); Tue, 10 Jan 2023 18:55:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235192AbjAJXzz (ORCPT ); Tue, 10 Jan 2023 18:55:55 -0500 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC1DA55663 for ; Tue, 10 Jan 2023 15:55:50 -0800 (PST) Received: by mail-lj1-x22b.google.com with SMTP id bn6so14313428ljb.13 for ; Tue, 10 Jan 2023 15:55:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=bxJysdNIrmRjvFROtnsTQyJodAB8veehuxuxefoCP2c=; b=rnirWVpiSpr6VhSQDQNoXvUVHyHeD6YL7RiNWjVUPzCzzsLSz550ShP6bkCBgPAnXE wZla1NaYrRHdDwOsR4FCEL70oxKgSUwchWimZR2Zp5JkFCr8B20Pbz6aZlr0KjnB9l9E t63pNJYKu02yjJDXV4Zwt5yyOP0J178b7wGbe2lf6rJSMKZL3vKHrkdvS77i/lqEyLWJ xFIOIu/+qvLa7WfAjhvWYVgAcYxhX96XmjwVEptuPUhGKGf/0HL5gBRhPdxrVy/hTaAO qfxScAkoWpyglZhuhCqxOA7fJmIDWWYgDWK/T6u99x8Vhc84fLWpFYq84tDeJgYEHYyI h5Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bxJysdNIrmRjvFROtnsTQyJodAB8veehuxuxefoCP2c=; b=hOQZsZ4dz2B/W9oVVvjQnBuaxYn5VThfaHVY3jzTBhc2+/m9BogclHVn5NE1mt0jNf LMHo15SMgW3oWrMiqZMXysWnF931dkrTe9hMVqgcdF6DJfc0Dc+Q3cUWWW1doZf6qQoq vIBNbMUn2Uxf9iqSYKSe/IOqOcc7eN5N5Lk/OvYpkKRrz3kMQVmGan4vhOmcvmmNoOfZ pDFxdIAteplQ6tzlvJSFLsU9mlHU9Gca6ZLlPsO2DEnVvrdYQs5b5JYomUDg/Q/2jOj3 hL4rgaQIOWLVMbxWAsJhxKccEbTldtbkBSxvJMCH4MotUETauQBmtToyl+ezswMBfGcQ 4jBw== X-Gm-Message-State: AFqh2kq3isS3gNLI7HvJ0IXVEhy6wPAWeFcCKr94tYIaE6/iV3JCbX6Q iJBWPjdi3ztGMHi53jKbqGj+Tw== X-Received: by 2002:a2e:3211:0:b0:27f:c428:c5ec with SMTP id y17-20020a2e3211000000b0027fc428c5ecmr18754489ljy.28.1673394949087; Tue, 10 Jan 2023 15:55:49 -0800 (PST) Received: from [192.168.1.101] (abxi45.neoplus.adsl.tpnet.pl. [83.9.2.45]) by smtp.gmail.com with ESMTPSA id a1-20020a2eb541000000b002770fb5722fsm1513208ljn.123.2023.01.10.15.55.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Jan 2023 15:55:48 -0800 (PST) Message-ID: Date: Wed, 11 Jan 2023 00:55:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v2 04/10] interconnect: qcom: rpm: Add support for specifying channel num Content-Language: en-US To: Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org, krzysztof.kozlowski@linaro.org Cc: marijn.suijten@somainline.org, Georgi Djakov , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230110132202.956619-1-konrad.dybcio@linaro.org> <20230110132202.956619-5-konrad.dybcio@linaro.org> <4a30931b-ef94-df2f-2e89-1028bf9510ce@linaro.org> From: Konrad Dybcio In-Reply-To: <4a30931b-ef94-df2f-2e89-1028bf9510ce@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11.01.2023 00:44, Bryan O'Donoghue wrote: > On 10/01/2023 13:21, Konrad Dybcio wrote: >> Some nodes, like EBI0 (DDR) or L3/LLCC, may be connected over more than >> one channel. This should be taken into account in bandwidth calcualtion, > calculation > >> as we're supposed to feed msmbus with the per-channel bandwidth. Add >> support for specifying that and use it during bandwidth aggregation. >> >> Signed-off-by: Konrad Dybcio >> --- >>   drivers/interconnect/qcom/icc-rpm.c | 7 ++++++- >>   drivers/interconnect/qcom/icc-rpm.h | 2 ++ >>   2 files changed, 8 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c >> index 0516b74abdc7..3207b4c99d04 100644 >> --- a/drivers/interconnect/qcom/icc-rpm.c >> +++ b/drivers/interconnect/qcom/icc-rpm.c >> @@ -336,6 +336,7 @@ static void qcom_icc_bus_aggregate(struct icc_provider *provider, >>   { >>       struct icc_node *node; >>       struct qcom_icc_node *qn; >> +    u64 sum_avg[QCOM_ICC_NUM_BUCKETS]; >>       int i; >>         /* Initialise aggregate values */ >> @@ -353,7 +354,11 @@ static void qcom_icc_bus_aggregate(struct icc_provider *provider, >>       list_for_each_entry(node, &provider->nodes, node_list) { >>           qn = node->data; >>           for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) { >> -            agg_avg[i] += qn->sum_avg[i]; >> +            if (qn->channels) > > when do you actually populate channels ? > > I had a quick scan of your series, I didn't see it.. I use this field in the upcoming MSM8998 and SM6375 drivers, which both require some part of this series to be merged. If I'm not mistaken, this is essentially what downstream calls qcom,agg-ports. 8996 should also use it, but I think I'll add that in a separate series. Other SoCs that I can see have a non-1 value here in various downstream trees I have on my PC that don't necessarily have interconnect drivers at the moment: msm8976 sdm660 mdm9607 msm8953/sdm429 qcs405 msm8952 and a whole bunch of RPMh SoCs that already take care of this. Konrad > >> +                sum_avg[i] = div_u64(qn->sum_avg[i], qn->channels); >> +            else >> +                sum_avg[i] = qn->sum_avg[i]; >> +            agg_avg[i] += sum_avg[i]; >>               agg_peak[i] = max_t(u64, agg_peak[i], qn->max_peak[i]); >>           } >>       } >> diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h >> index 3762648f9d47..eb51680f890d 100644 >> --- a/drivers/interconnect/qcom/icc-rpm.h >> +++ b/drivers/interconnect/qcom/icc-rpm.h >> @@ -66,6 +66,7 @@ struct qcom_icc_qos { >>    * @id: a unique node identifier >>    * @links: an array of nodes where we can go next while traversing >>    * @num_links: the total number of @links >> + * @channels: number of channels at this node (e.g. DDR channels) >>    * @buswidth: width of the interconnect between a node and the bus (bytes) >>    * @sum_avg: current sum aggregate value of all avg bw requests >>    * @max_peak: current max aggregate value of all peak bw requests >> @@ -78,6 +79,7 @@ struct qcom_icc_node { >>       u16 id; >>       const u16 *links; >>       u16 num_links; >> +    u16 channels; >>       u16 buswidth; >>       u64 sum_avg[QCOM_ICC_NUM_BUCKETS]; >>       u64 max_peak[QCOM_ICC_NUM_BUCKETS]; >