Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1494103pxv; Fri, 25 Jun 2021 14:31:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgU0WPmkrml51hd9pKWs2/HimR4B7WJdDWTM6TCRS7790JPsjSRVxuDaqZ8p+fNj5AczPL X-Received: by 2002:a02:b919:: with SMTP id v25mr11420556jan.120.1624656676064; Fri, 25 Jun 2021 14:31:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624656676; cv=none; d=google.com; s=arc-20160816; b=RjjkZMZ+GDUKDhN3mpt8mSHwVRsuVK78qftAoXo2uTRLcfs2iln3xusVSa4R9FqUmj SWltJFQDvhOK3B39PtJ1gJnWdzSq1E6zAyz6eCVdWjzsP+uKxXuFeILChgJJKukNN294 B5DvLcCG0cIJkiagpbDjkoqCa3Vbjbn0+3ibQjGH6A2wRwrLJsDRfcHQbNyxYVJh0zc6 ceWOru9hxAU38WYygulWim/uYEdjWzJa1PT0g+CibQVBuovh/XYUYV8dsDPY6MnkY/ib PzztYxIIB4SfFFzoUXwcgR9ta+bN5Mhwic2DWMfW5yRKheB59AweerhzsUVbA/kIO4fo c91A== 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=ySesvNlauEEm7yyBbVlezGiznvSWahvS4OLJh1EwFhQ=; b=LboC1HEMA5DSDoec+FNe0u7Yp0YxClxdjxtEeYEDxyC3h9PuQJ7AxPN7MiQkdlnjil rOiSvccGuXbFJeWiGAVNic3cRfspoGQqWytaZgZn4OOs8XoIT0g7x/OCtJvGCF7HuWmK riVGx5NXo+nz5unZF6EjMwUt67+a4pMEd4zQu6ITzciO98yV69modL24MyEgJFyufU37 9emW307T/ONtvInY+uMH+5344VFeJ/yaY7SfkUHIyA6GUOgXGe1W6e2dNqoZn/E126cL YPK+Fh4zy3S6MjsTMZIkTRDCb5WgfyQJmbRLV3E7VRd76CGySyS89oVYBULcq1z4lvM1 bQYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b="b40h3X/Y"; 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 a15si8146882ilv.21.2021.06.25.14.31.03; Fri, 25 Jun 2021 14:31:16 -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="b40h3X/Y"; 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 S230053AbhFYVbd (ORCPT + 99 others); Fri, 25 Jun 2021 17:31:33 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:61796 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229864AbhFYVbW (ORCPT ); Fri, 25 Jun 2021 17:31:22 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1624656541; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=ySesvNlauEEm7yyBbVlezGiznvSWahvS4OLJh1EwFhQ=; b=b40h3X/YxLEEajPqjgag1Lp2c4c2DFcXWGeNGdVYfcoOS5t8t/itjJ1ARL986XaIWoeoxa5M S3nvogdz6t+9AZ/6q1NWrdC1uVBeQOIl4Ey9Poh2y6e8qDkGz9DlO7kz4t8P4gDWUhawPMpa 3Ex2bVLiTVoiG2dnCS0IH76smIk= X-Mailgun-Sending-Ip: 69.72.43.7 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-n03.prod.us-west-2.postgun.com with SMTP id 60d64a9c7e5ba0fdc0745f35 (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 81239C433D3; Fri, 25 Jun 2021 21:29:00 +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 5F94AC4338A; Fri, 25 Jun 2021 21:28:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5F94AC4338A 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 3/4] interconnect: qcom: icc-rpmh: Ensure floor BW is enforced for all nodes Date: Fri, 25 Jun 2021 14:28:38 -0700 Message-Id: <20210625212839.24155-4-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 We currently only enforce BW floors for a subset of nodes in a path. All BCMs that need updating are queued in the pre_aggregate/aggregate phase. The first set() commits all queued BCMs and subsequent set() calls short-circuit without committing anything. Since the floor BW isn't set in sum_avg/max_peak until set(), then some BCMs are committed before their associated nodes reflect the floor. Set the floor as each node is being aggregated. This ensures that all all relevant floors are set before the BCMs are committed. Fixes: 266cd33b5913 ("interconnect: qcom: Ensure that the floor bandwidth value is enforced") Signed-off-by: Mike Tipton --- drivers/interconnect/qcom/icc-rpmh.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpmh.c b/drivers/interconnect/qcom/icc-rpmh.c index bf01d09dba6c..f118f57eae37 100644 --- a/drivers/interconnect/qcom/icc-rpmh.c +++ b/drivers/interconnect/qcom/icc-rpmh.c @@ -57,6 +57,11 @@ int qcom_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw, qn->sum_avg[i] += avg_bw; qn->max_peak[i] = max_t(u32, qn->max_peak[i], peak_bw); } + + if (node->init_avg || node->init_peak) { + qn->sum_avg[i] = max_t(u64, qn->sum_avg[i], node->init_avg); + qn->max_peak[i] = max_t(u64, qn->max_peak[i], node->init_peak); + } } *agg_avg += avg_bw; @@ -90,11 +95,6 @@ int qcom_icc_set(struct icc_node *src, struct icc_node *dst) qp = to_qcom_provider(node->provider); qn = node->data; - qn->sum_avg[QCOM_ICC_BUCKET_AMC] = max_t(u64, qn->sum_avg[QCOM_ICC_BUCKET_AMC], - node->avg_bw); - qn->max_peak[QCOM_ICC_BUCKET_AMC] = max_t(u64, qn->max_peak[QCOM_ICC_BUCKET_AMC], - node->peak_bw); - qcom_icc_bcm_voter_commit(qp->voter); return 0; -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project