From patchwork Tue Aug 10 17:31:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 494920 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=-19.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 9F297C43214 for ; Tue, 10 Aug 2021 18:05:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 82E5C604AC for ; Tue, 10 Aug 2021 18:05:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234353AbhHJSFd (ORCPT ); Tue, 10 Aug 2021 14:05:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:33870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234493AbhHJSDN (ORCPT ); Tue, 10 Aug 2021 14:03:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E611961241; Tue, 10 Aug 2021 17:47:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628617662; bh=pDdLwGfN7E6ybMm18yH4Jbx6PvgDlvXVc+EYZDqlKyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w5xDtGYYmqflluVdGNHIB7+Ajc/IizUH/+d9XWZNwuH1RRmi0eVWsTFRfGZI7SmOP Vu+JPRrhj/ZOHtli8OJq0A+UekXzSPI0Hod1nvDoIP0monjpmWMQtCKFpeTG9T/EWe EbdVx3TZCxp51Z9+LDM6dVmudgFgdusFtfrX+8pE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Tipton , Georgi Djakov Subject: [PATCH 5.13 157/175] interconnect: Always call pre_aggregate before aggregate Date: Tue, 10 Aug 2021 19:31:05 +0200 Message-Id: <20210810173006.139418823@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810173000.928681411@linuxfoundation.org> References: <20210810173000.928681411@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mike Tipton commit 73606ba9242f8e32023699b500b7922b4cf2993c upstream. 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 Link: https://lore.kernel.org/r/20210721175432.2119-3-mdtipton@codeaurora.org Signed-off-by: Georgi Djakov Signed-off-by: Greg Kroah-Hartman --- drivers/interconnect/core.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -973,9 +973,14 @@ void icc_node_add(struct icc_node *node, } node->avg_bw = node->init_avg; node->peak_bw = node->init_peak; + + if (provider->pre_aggregate) + provider->pre_aggregate(node); + if (provider->aggregate) 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;