From patchwork Wed Oct 21 15:59:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 318846 Delivered-To: patch@linaro.org Received: by 2002:a92:d1d1:0:0:0:0:0 with SMTP id u17csp2309016ilg; Wed, 21 Oct 2020 08:59:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfZDby52Kz8jeMf6R/LzUsq71gN1FK7x4qvJM3u0P8kzaGEEab7tKovaRkyapBl2xhWL6o X-Received: by 2002:a17:906:f2d5:: with SMTP id gz21mr4400053ejb.467.1603295985849; Wed, 21 Oct 2020 08:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603295985; cv=none; d=google.com; s=arc-20160816; b=VUK9VHFho3lrNkBZSgKxjRrxKPpxOyDa8K9gdJI5Q4IMnP0U7Md2l8OKMYYC2K8YaC 8xSfApU+GWZLiDiJUGe1i7WvfFMe/G5NFjVTphsIL2PAGc4q/BifeZiv9GNYoOl2qPv5 VbDJUlOwJoYv1l6Y63XHdjHZcMUBl5uUZ6uQ5wxBKvGE0CBMR30PEaH/q8z8F4z3dqQZ C1oJHK7+E0MY0qnGOAVhRE/wkbHSR7qwjHoHDUs8xqlWeZcltH4YgBXB7pq11hEOIbnE I/TR/iB8o+8Ms9wFxtU0TYohy7yIINlpN3QzJ8CFVRtXmO36s5Xyxx57iwyZD22ZYo9j 3PBg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=ctjUV/qDzuMk+99Zc1qceboDHYtb3OZdKyaQ+fU3OVg=; b=Rc9Vt2uuH709d7OhIogQvIFuxDDXo15TY8G1bSB9ow+mXWXfHpdMhjtLDuqGRyHmxC MDvbkqfiwJA3Y6T2uzG2TZ1hyHNJZNm8v2RYFqrK9QJtZY4PkhLYWOuKdBR4qtT5Y1XM 9L2YoGw2EAZklQFqbg0aYmq+vOjFCLQ8eNjukw5rSN/CtyBRc7TvkeOKaiYpPYfjBK68 NIH/3KgoA806/ZIfh4E1miKctnEQFJ9MEi1zgiNIzvjgxjWLBDaCMQo/Ri59W7Mw7hr6 mocURW/D7Z2qj5d+F7fihvNkB/LnsTf7cuIO3Po8HNU/9YvszPJAT7iMNjlJsfOXy0JN xEPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V2K64qCt; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t21si1615649ejr.71.2020.10.21.08.59.45; Wed, 21 Oct 2020 08:59:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-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=@linaro.org header.s=google header.b=V2K64qCt; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 S2444302AbgJUP7o (ORCPT + 9 others); Wed, 21 Oct 2020 11:59:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2444293AbgJUP7o (ORCPT ); Wed, 21 Oct 2020 11:59:44 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C3EAC0613CF for ; Wed, 21 Oct 2020 08:59:42 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id i1so3776531wro.1 for ; Wed, 21 Oct 2020 08:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ctjUV/qDzuMk+99Zc1qceboDHYtb3OZdKyaQ+fU3OVg=; b=V2K64qCtTgV8FUgCG4h32MU/PMEDUom+DqEluPXdvc+C5bRsP2g/ezqF1IsksWDmIS aHK7H4cJcC6MNJLz7dmjZbhqDhedvLHwXAWKy4l1BPrUQVcoLEx4f6lEacNcdJfYQUVi grwut/0Vhll0dnz3WNXmQFHHYClIsrPZycBp5koAx/0OGFecQX6L6jCH4DeV/9H1j8vc sm2/pvBwWK9eqqa4Jy0baKN1Wd1a5+sSkNHiJzmrQF3lSVuPBJOM5j/svWSbi4yLy/3F FUZgwWcFWw4lUdrqHlv0oBpkkzDqsKJMS1fzFeq7woPTXapF7p6dVc4FQH9Uh6i28ylV 0CSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ctjUV/qDzuMk+99Zc1qceboDHYtb3OZdKyaQ+fU3OVg=; b=Ta/4+2IhFgEtUSGRJWil7vp78Kf+4sa9ossPvSB2YV72RD0akfPXVjGaLZ/ZJlWuut 8Wt9yhDP07j1hUWlpNIm24dKjBsXquIhRDYx1IM/XMZLQO377YTq55+cSRY+zAnKLSco Ix4BQSdxlVAiQ3/jGlPKohsLOwT+4sa5fJUwEEvbcINRadBYpRPOixUGf9D7i1jtn+Pr 7l2LUHAGc+CjFz9tGYzz4sDrYpakgcQyi7FcYi0IQSd3spl+olU3HWiE0dhysTdmG3op P6pdas9ad8yp2AQDbyMDTThUuk8Q5x87+AeUZa33MdvDOdyd1bbthn+1MH/pEyXvYMH/ Lepw== X-Gm-Message-State: AOAM530k8qytFXeZEqUN20AkBI6OC6Sd5D4AFOrhWK7BgZ+sxC5P4gU5 xRMyoLImeJN6frT4JNnlxplGWC9gXTxx+A== X-Received: by 2002:a5d:4ccd:: with SMTP id c13mr5545597wrt.221.1603295980283; Wed, 21 Oct 2020 08:59:40 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id j13sm4617571wru.86.2020.10.21.08.59.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Oct 2020 08:59:39 -0700 (PDT) From: Georgi Djakov To: linux-pm@vger.kernel.org Cc: akashast@codeaurora.org, mdtipton@codeaurora.org, saravanak@google.com, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, georgi.djakov@linaro.org Subject: [PATCH] interconnect: qcom: Ensure that the floor bandwidth value is enforced Date: Wed, 21 Oct 2020 18:59:38 +0300 Message-Id: <20201021155938.9223-1-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Take into account the initial bandwidth from the framework and update the internal sum and max values before committing if needed. This will ensure that the floor bandwidth values are enforced until the providers get into sync state. Fixes: 7d3b0b0d8184 ("interconnect: qcom: Use icc_sync_state") Signed-off-by: Georgi Djakov --- drivers/interconnect/qcom/icc-rpmh.c | 7 +++++++ 1 file changed, 7 insertions(+) Tested-by: Akash Asthana diff --git a/drivers/interconnect/qcom/icc-rpmh.c b/drivers/interconnect/qcom/icc-rpmh.c index cf10a4b9611b..bf01d09dba6c 100644 --- a/drivers/interconnect/qcom/icc-rpmh.c +++ b/drivers/interconnect/qcom/icc-rpmh.c @@ -79,6 +79,7 @@ EXPORT_SYMBOL_GPL(qcom_icc_aggregate); int qcom_icc_set(struct icc_node *src, struct icc_node *dst) { struct qcom_icc_provider *qp; + struct qcom_icc_node *qn; struct icc_node *node; if (!src) @@ -87,6 +88,12 @@ int qcom_icc_set(struct icc_node *src, struct icc_node *dst) node = src; 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);