Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1493654pxv; Fri, 25 Jun 2021 14:30:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7+HXkWg3872vui69okFemm4/hk/+W7meuGrDSrqXTbBuoXa7hSOql4bu0aDzEIq9p0Wxz X-Received: by 2002:a05:6638:1349:: with SMTP id u9mr7550180jad.43.1624656629522; Fri, 25 Jun 2021 14:30:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624656629; cv=none; d=google.com; s=arc-20160816; b=EYRQaSHsavAgCEvGrNYFNuCshcjOndiPR1rvULnwqaVkNexcplsCi/IfkA3nsC5V+V cS4miFox9Z9IiCxsxDWbtS5uQ8N3ekj9+X0ZhHSwnJAiPLqOytFyaMBeAC0W4zrIKMaf TN0QWvnZOEWNbjlZEnte1bZDRWbIRk/KyFlJsvlnk59Qco1uLCw0Ep7B1JU2/PSzLzRM ahAhCeDFvjv2uUSl2545sVGK0TlU7Ul+DqAcwiJym5Y3QaFFwcT9rmTJc2h055GFNTOw SM6GORmuHxqsWW0AVqm/+2CyMS4gnLTRwzIcROal54F07ReMERqNM5Z+cY/7lwy90Ya2 wdsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:sender:dkim-signature; bh=VKnhaTPJl4bd6GS1KO3Fw6pzG9/UGtuplYmEcz9Jwrw=; b=SZXADJv+YECsrZ5kJIodffdd8dHiSuZyHHEReRW9aQWFeQVNhzoSLPrAbm/kDLb68Z NRq/JVvUQoOeQLk9tdNPf2HnztaxLti/Zcdy4nHAauv6vXIB5I9jLBYbiYTcCPFIO3Z5 CxUI4LKiFx0zVTUOMA988WTkDS1g2VmWeUGurGnSNAD8dU9/k18KwGwEhtDmX6a2srlO KgBiMAnYEV2t9hmjd+oQl5aJWkRm+8dFyJZ6UmUEVOTvHPNk9qtGwCRtAZxIQO7FbBzF C6z2C9ZuRtUFwMtagwdCnQ2+RWos2zamFS9M1JEeklsvypy4RuiuYPvzztKNzo9zgeYt m44A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b="mA7y/1zN"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d6si7364304ilm.75.2021.06.25.14.30.17; Fri, 25 Jun 2021 14:30:29 -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=@mg.codeaurora.org header.s=smtp header.b="mA7y/1zN"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230093AbhFYVbh (ORCPT + 99 others); Fri, 25 Jun 2021 17:31:37 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:61932 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbhFYVb1 (ORCPT ); Fri, 25 Jun 2021 17:31:27 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1624656546; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=VKnhaTPJl4bd6GS1KO3Fw6pzG9/UGtuplYmEcz9Jwrw=; b=mA7y/1zN+DMmFNO+y+TTcn+hXOrRnoBeHUX3tfxsOQtqQbKkYOQcJS/gqX5sLvtMYwZBGaY2 r3EYhdG8W/vZ6YwUP42aIRm1/ufC9IIKCJ0R7IPk8XKoRvf5/Q8LK6a4tOahDiWeL1IH2k45 s4if/ZcomebBI0CHXkFSHAlWRxA= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n02.prod.us-east-1.postgun.com with SMTP id 60d64a9c19389419555de0e5 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 25 Jun 2021 21:29:00 GMT Sender: mdtipton=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 84626C433D3; Fri, 25 Jun 2021 21:28:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from hu-mdtipton-lv.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mdtipton) by smtp.codeaurora.org (Postfix) with ESMTPSA id A2EC1C433F1; Fri, 25 Jun 2021 21:28:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A2EC1C433F1 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=mdtipton@codeaurora.org From: Mike Tipton To: djakov@kernel.org Cc: bjorn.andersson@linaro.org, agross@kernel.org, saravanak@google.com, okukatla@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Tipton Subject: [PATCH 2/4] interconnect: Always call pre_aggregate before aggregate Date: Fri, 25 Jun 2021 14:28:37 -0700 Message-Id: <20210625212839.24155-3-mdtipton@codeaurora.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210625212839.24155-1-mdtipton@codeaurora.org> References: <20210625212839.24155-1-mdtipton@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The pre_aggregate callback isn't called in all cases before calling aggregate. Add the missing calls so providers can rely on consistent framework behavior. Fixes: d3703b3e255f ("interconnect: Aggregate before setting initial bandwidth") Signed-off-by: Mike Tipton --- drivers/interconnect/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 945121e18b5c..cfd54c90a6bb 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -973,9 +973,12 @@ void icc_node_add(struct icc_node *node, struct icc_provider *provider) } node->avg_bw = node->init_avg; node->peak_bw = node->init_peak; - if (provider->aggregate) + if (provider->aggregate) { + if (provider->pre_aggregate) + provider->pre_aggregate(node); provider->aggregate(node, 0, node->init_avg, node->init_peak, &node->avg_bw, &node->peak_bw); + } provider->set(node, node); node->avg_bw = 0; node->peak_bw = 0; -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project