Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp72266rwb; Thu, 22 Sep 2022 14:38:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7UhDqi5k9jMzGRsVve4HOuFxnxgk+doy0ylZkPtIIDAVkXH4c+epPkJJRu5bgEy4ACqPrn X-Received: by 2002:a17:907:e9e:b0:77f:9688:2714 with SMTP id ho30-20020a1709070e9e00b0077f96882714mr4461901ejc.208.1663882723783; Thu, 22 Sep 2022 14:38:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663882723; cv=none; d=google.com; s=arc-20160816; b=sgAty1yGvT4k5IqgrgblAaWAkDXeFQ9RqFKxUJO61s6y/ucr2uEAKGofobCv2/XAsG 7a/U87qEt/4EhDbtU5nK/gMODHpPHO4DZSqyX/vJpO2cHy/pdAP0HSavbjZpyJbIjTCR 9Qu+kSGEj0fnn8cKPAZnCzqM5v5IcGN9dsi7Rqh/B4wcUF39Ej+IUqPadhO71aDIZq7n iLRy0bLrqvN71ybx2kKqEaxl7BjPmTjQeviXVP6BEosnMBfT496w6X/9XywVb0gkfZQg QaoBy/q6U4LCpItpUAAVp3W89rtcCP7tyYcXXy17igeRntUuteyQdh//kygL4k0GBEz8 Cp1Q== 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=1TPEKw6ZfZxcb8OW9aQyQDFvakhQrH+jPbGOfotODj8=; b=cQjhfmrgsv8HU2GF74ESHM3JmAd0gjQvpM6vpzUQdRJhMKzAFroJWs1aA3aYsZ5bbm iHmYqnddSeXmfjDiozbVK7L67PgE1mGqGW5r/nPbi2yZF5/C3bSGzO1BUi7+bvYr4kaG tomsjQ649FDYlBArdVNAAf1lTCmfADwwdtCBIUnALItFUU0Pva7b02JWPg2HPTedtBr9 E4CuhBLBlgRlBk9fDdSQJIYvEcoFtm1+Bz9djncjjHtfvKmxaCooVtNbNL8LbuDPx08O 8kIL+yJLjzs0viKQrxGfU6k1A8fUk0YbYuWs8NI/Mb+b7wvza9oxKfdHyipSVYEN57rp ME8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KhuQv1Rl; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he36-20020a1709073da400b00734b2821879si6958342ejc.898.2022.09.22.14.38.18; Thu, 22 Sep 2022 14:38:43 -0700 (PDT) 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=@chromium.org header.s=google header.b=KhuQv1Rl; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230189AbiIVVTT (ORCPT + 99 others); Thu, 22 Sep 2022 17:19:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229950AbiIVVTQ (ORCPT ); Thu, 22 Sep 2022 17:19:16 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43975110B22 for ; Thu, 22 Sep 2022 14:19:15 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id t190so10404291pgd.9 for ; Thu, 22 Sep 2022 14:19:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=1TPEKw6ZfZxcb8OW9aQyQDFvakhQrH+jPbGOfotODj8=; b=KhuQv1RlE5pzhaW2Ncp6oBIPecXlXGSFNtn6DBktCsSr5GPX9VKESG1uMfTxlILqzu IqDd2Xik6SSw8k6Z46JnVXkRAUpvG1QxwzLaH6lulE2cccjex0siS8xDsk7hhIL/KPLY JcSK/6Uz+LO8yi4QEr6UG3H3jKj0zn+PgtYV0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=1TPEKw6ZfZxcb8OW9aQyQDFvakhQrH+jPbGOfotODj8=; b=g55M8MQ+c7u6XoC2sbC/Iaa8Mn3YSzqxzWoITZokT+mbJA0dFiFLmsjf+twNm0t3E8 TuFDZeAVAtsSh5C0/J07PF6WZ8qdZJPLDa1wEbx8tt5LiEIaZyg0Wql1679/CmerKYKC jwfuYYW6znCN7HUtlbMrxZlmucUDbmT1GboLy6BGX68nQOn+JZaGcBJN5FfoTlZmBDQL B00YzCBaH5ZGnvqRcKIg8oCyPv4reXIbyFo5xOiHKLI/bzA+tD9N5HVX+lnbbkmcfpaJ bafPUBjjaY6qMRcmVfv3t0lIC6zWl7KZcxRfvDcKWMUxrXTuDvX9n8+ruZe/QmwO90kA 4OAQ== X-Gm-Message-State: ACrzQf11+edUFY6Fb9+DjazpeHOftTwvN/VhJp0ZAPhBX2sJiyTGCd+k o9zhiWGQ9tdzk53WDzZanr7goA== X-Received: by 2002:a63:6c01:0:b0:429:ea6e:486d with SMTP id h1-20020a636c01000000b00429ea6e486dmr4643809pgc.247.1663881554644; Thu, 22 Sep 2022 14:19:14 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:5321:6ad9:3932:13d8]) by smtp.gmail.com with ESMTPSA id a7-20020a170902710700b00176ae5c0f38sm4549579pll.178.2022.09.22.14.19.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 14:19:14 -0700 (PDT) From: Douglas Anderson To: stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: Alex Elder , swboyd@chromium.org, Mike Tipton , Georgi Djakov , Douglas Anderson , Andy Gross , Bjorn Andersson , Georgi Djakov , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [5.10 PATCH] interconnect: qcom: icc-rpmh: Add BCMs to commit list in pre_aggregate Date: Thu, 22 Sep 2022 14:18:03 -0700 Message-Id: <20220922141725.5.10.1.I791715539cae1355e21827ca738b0b523a4a0f53@changeid> X-Mailer: git-send-email 2.37.3.998.g577e59143f-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 From: Mike Tipton commit b95b668eaaa2574e8ee72f143c52075e9955177e upstream. We're only adding BCMs to the commit list in aggregate(), but there are cases where pre_aggregate() is called without subsequently calling aggregate(). In particular, in icc_sync_state() when a node with initial BW has zero requests. Since BCMs aren't added to the commit list in these cases, we don't actually send the zero BW request to HW. So the resources remain on unnecessarily. Add BCMs to the commit list in pre_aggregate() instead, which is always called even when there are no requests. Signed-off-by: Mike Tipton [georgi: remove icc_sync_state for platforms with incomplete support] Link: https://lore.kernel.org/r/20211125174751.25317-1-djakov@kernel.org Signed-off-by: Georgi Djakov [dianders: dropped sm8350.c which isn't present in 5.10] Signed-off-by: Douglas Anderson --- This should have been included in Alex Elder's request for patches picked to 5.10 [1] but it was missed. Let's finally pick it up. [1] https://lore.kernel.org/r/20220608205415.185248-3-elder@linaro.org drivers/interconnect/qcom/icc-rpmh.c | 10 +++++----- drivers/interconnect/qcom/sm8150.c | 1 - drivers/interconnect/qcom/sm8250.c | 1 - 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpmh.c b/drivers/interconnect/qcom/icc-rpmh.c index f6fae64861ce..27cc5f03611c 100644 --- a/drivers/interconnect/qcom/icc-rpmh.c +++ b/drivers/interconnect/qcom/icc-rpmh.c @@ -20,13 +20,18 @@ void qcom_icc_pre_aggregate(struct icc_node *node) { size_t i; struct qcom_icc_node *qn; + struct qcom_icc_provider *qp; qn = node->data; + qp = to_qcom_provider(node->provider); for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) { qn->sum_avg[i] = 0; qn->max_peak[i] = 0; } + + for (i = 0; i < qn->num_bcms; i++) + qcom_icc_bcm_voter_add(qp->voter, qn->bcms[i]); } EXPORT_SYMBOL_GPL(qcom_icc_pre_aggregate); @@ -44,10 +49,8 @@ int qcom_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw, { size_t i; struct qcom_icc_node *qn; - struct qcom_icc_provider *qp; qn = node->data; - qp = to_qcom_provider(node->provider); if (!tag) tag = QCOM_ICC_TAG_ALWAYS; @@ -67,9 +70,6 @@ int qcom_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw, *agg_avg += avg_bw; *agg_peak = max_t(u32, *agg_peak, peak_bw); - for (i = 0; i < qn->num_bcms; i++) - qcom_icc_bcm_voter_add(qp->voter, qn->bcms[i]); - return 0; } EXPORT_SYMBOL_GPL(qcom_icc_aggregate); diff --git a/drivers/interconnect/qcom/sm8150.c b/drivers/interconnect/qcom/sm8150.c index c76b2c7f9b10..b936196c229c 100644 --- a/drivers/interconnect/qcom/sm8150.c +++ b/drivers/interconnect/qcom/sm8150.c @@ -627,7 +627,6 @@ static struct platform_driver qnoc_driver = { .driver = { .name = "qnoc-sm8150", .of_match_table = qnoc_of_match, - .sync_state = icc_sync_state, }, }; module_platform_driver(qnoc_driver); diff --git a/drivers/interconnect/qcom/sm8250.c b/drivers/interconnect/qcom/sm8250.c index cc558fec74e3..40820043c8d3 100644 --- a/drivers/interconnect/qcom/sm8250.c +++ b/drivers/interconnect/qcom/sm8250.c @@ -643,7 +643,6 @@ static struct platform_driver qnoc_driver = { .driver = { .name = "qnoc-sm8250", .of_match_table = qnoc_of_match, - .sync_state = icc_sync_state, }, }; module_platform_driver(qnoc_driver); -- 2.37.3.998.g577e59143f-goog