From patchwork Fri Aug 11 23:16:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 134794 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp1469670vqi; Fri, 11 Aug 2023 19:03:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEKvX950DgIlOdzd5zroNXvFCHtlVe5Mh345bcDF/hP375Obr3QC+1xnvGD76f4VW54s9sO X-Received: by 2002:a05:651c:201:b0:2b6:c8e8:915f with SMTP id y1-20020a05651c020100b002b6c8e8915fmr3289460ljn.22.1691805818216; Fri, 11 Aug 2023 19:03:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691805818; cv=none; d=google.com; s=arc-20160816; b=r1LoY8X0R3SIMzOr6nopZz2oUyS9jCsD3uG0jO1qbrMLS/CQ+0Gl94vWRkenQYbLEt koYr/ojAqogF5OuiR6kdSrEm9Qmbl3zJ868DdWM5tLsgUL/fl/SY0yd3YqivqEgnBesZ WHdygPzU/bst2xNQV04GxRMydWXGmRnbeq4i3VhLOim/bP/Dy0r4g+ujeSiLYP8Dw4gi iFX/3+cSEDGjP6WD9oppVC2xlP16b/fSPGtFGr69thxri1iqzPn+LkCUoH4VnaVn9q6p ZdlTtPMq//JLsdflBQmtO7jOI0Mr+vUEIv6r10vJ7TyUxJlU5LyZdl7iYSoJ6bWwTVAH KUrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=vrEa7BnRXqlxSfaLWUoZT+UIgmwKchO/B/AYrIhfcQw=; fh=MHenx2e24sxK1mTtSFwMETuI0QLHZHbQce7iWE+IwsQ=; b=zZ4I2TCaA0OJWoePQJjuLUffjNi28oufxHV1coNAaYGOFh7HQAAjcr//JJq1SUZk3c U5ZVpVdpUvQhhkNldNPJ5px1PjY1VwWQMvYPR8Uu/4llYVZ2KSB/x8MHn5ms7BduMfiw huAKNFy3FIUH3m2+dGeWMSVrxhO+ij7I3IPGrXYvBsM9cfMMGCLG3BWtqYn3hSl49cTH 2zejjnwTNQwJm5aoEY6pZyp/Bq19NSgqe1wdj+4eR8gbluLoNmoZmtA0grcNziP3/Wev x7lqWu2vqhx3imKYDcblGpfkjJLPT++8Vgm1To7Id4Iwl3vKzpZnolRlammkkx3GulE9 /aTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rOrwY5e7; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u5-20020a1709063b8500b00997bd26a559si4422442ejf.881.2023.08.11.19.03.14; Fri, 11 Aug 2023 19:03:38 -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=@linaro.org header.s=google header.b=rOrwY5e7; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235584AbjHKXQ1 (ORCPT + 99 others); Fri, 11 Aug 2023 19:16:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233647AbjHKXQX (ORCPT ); Fri, 11 Aug 2023 19:16:23 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0983510E4 for ; Fri, 11 Aug 2023 16:16:22 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4fe28f92d8eso4027852e87.1 for ; Fri, 11 Aug 2023 16:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691795780; x=1692400580; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=vrEa7BnRXqlxSfaLWUoZT+UIgmwKchO/B/AYrIhfcQw=; b=rOrwY5e7PCKvYy7gp1p09YmQ/t6ViOupbDgqW/MRFSypqkrrf4MRP+zMghQh7c6iNI vu3ezvNwuWZPr6G98njW+GxZmD48wOlPvagCctULeQmECjUeLQ+1bK9BqS6MLTl/X5YX urb1CHb2iFLY3aXknZOnUAUS87B8RG2H9ZoBln/YfF0StG1SjbgikVD9GGQJcVZByaGG p2VGufLz3yWLnnPfmrztbEgVuHHuiJD7lS5VNT8epSRYuF0SmgALucTZ98A3Hnf7O3rH FuYHwuWuJNJDHHRwW5LWiz7I6N2wCwVF1/Lw/1JbtUrPOxH1IX+QIWafBFZCujwoyu9d bhqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691795780; x=1692400580; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vrEa7BnRXqlxSfaLWUoZT+UIgmwKchO/B/AYrIhfcQw=; b=fn5lFIjjVRAwL7oRfGpKhxs5IYQ8fDBiGVHdiLRT5rdW1H0GrAXoFmlzS7W3byhtAO x+olV8K/j4/J5tg35uyqIl5nIMMah+Sz4NkUB4EvAl89fHJf1x3D/hZ8wpst4xUKrN42 S3nibW3VxPki5T85dIReySicuGU11+tflHQruNU+IQcAT/yjZ/26M/b6WPBwUJ+v07SS GQaGqwI2SlmDezviU9Bwvw363QlKwfjgp0uwRjY8LYKQlYrnQSAPibO+tK+qNEY7MhEn dgJsI0jjlBhZgnJIORFcv7Hup7gHl6gtdZiL9FGuafCPWOy22Kx0Qa3p9u/oIn7KUt+p cPMw== X-Gm-Message-State: AOJu0Yzcl8ixXmDcvQD6Rw5xwg6hqy19IBZ+/0fgpHvhOkrGNeqDcVQ4 R8xO4v3Ol0cb2sHu6I2CwKUwKw== X-Received: by 2002:a05:6512:3d03:b0:4fd:c844:6a43 with SMTP id d3-20020a0565123d0300b004fdc8446a43mr2855752lfv.43.1691795780209; Fri, 11 Aug 2023 16:16:20 -0700 (PDT) Received: from [192.168.1.101] (abyj188.neoplus.adsl.tpnet.pl. [83.9.29.188]) by smtp.gmail.com with ESMTPSA id m16-20020a195210000000b004fe48332852sm884773lfb.136.2023.08.11.16.16.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Aug 2023 16:16:19 -0700 (PDT) From: Konrad Dybcio Date: Sat, 12 Aug 2023 01:16:15 +0200 Subject: [PATCH v2 1/2] interconnect: qcom: bcm-voter: Improve enable_mask handling MIME-Version: 1.0 Message-Id: <20230811-topic-icc_fix_1he-v2-1-0620af8ac133@linaro.org> References: <20230811-topic-icc_fix_1he-v2-0-0620af8ac133@linaro.org> In-Reply-To: <20230811-topic-icc_fix_1he-v2-0-0620af8ac133@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Mike Tipton , Neil Armstrong Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Bjorn Andersson X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1691795777; l=2645; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=/nUZR/0rc3yqrbbrAEz7dJ1RQ7GveO6vo5M4t98V7rI=; b=yopVK/ZtfM2RmTl6QHD084IAaGO1rxaQJR19IYJTnKafbeqsyktjQSPYOLzSrCbn91x+tG8EF YWSZ2ucOpQnA+f8Y/xdRXBIjNbFIN81JMy0eRcY7hbDA8Bg+cyWwlPI X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773986977678225164 X-GMAIL-MSGID: 1773986977678225164 We don't need all the complex arithmetic for BCMs utilizing enable_mask, as all we need to do is to determine whether there's any user (or keepalive) asking for it to be on. Separate the logic for such BCMs for a small speed boost. Suggested-by: Bjorn Andersson Reviewed-by: Bjorn Andersson Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/bcm-voter.c | 43 +++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/drivers/interconnect/qcom/bcm-voter.c b/drivers/interconnect/qcom/bcm-voter.c index d5f2a6b5376b..d857eb8838b9 100644 --- a/drivers/interconnect/qcom/bcm-voter.c +++ b/drivers/interconnect/qcom/bcm-voter.c @@ -58,6 +58,36 @@ static u64 bcm_div(u64 num, u32 base) return num; } +/* BCMs with enable_mask use one-hot-encoding for on/off signaling */ +static void bcm_aggregate_mask(struct qcom_icc_bcm *bcm) +{ + struct qcom_icc_node *node; + int bucket, i; + + for (bucket = 0; bucket < QCOM_ICC_NUM_BUCKETS; bucket++) { + bcm->vote_x[bucket] = 0; + bcm->vote_y[bucket] = 0; + + for (i = 0; i < bcm->num_nodes; i++) { + node = bcm->nodes[i]; + + /* If any vote in this bucket exists, keep the BCM enabled */ + if (node->sum_avg[bucket] || node->max_peak[bucket]) { + bcm->vote_x[bucket] = 0; + bcm->vote_y[bucket] = bcm->enable_mask; + break; + } + } + } + + if (bcm->keepalive) { + bcm->vote_x[QCOM_ICC_BUCKET_AMC] = 1; + bcm->vote_x[QCOM_ICC_BUCKET_WAKE] = 1; + bcm->vote_y[QCOM_ICC_BUCKET_AMC] = 1; + bcm->vote_y[QCOM_ICC_BUCKET_WAKE] = 1; + } +} + static void bcm_aggregate(struct qcom_icc_bcm *bcm) { struct qcom_icc_node *node; @@ -83,11 +113,6 @@ static void bcm_aggregate(struct qcom_icc_bcm *bcm) temp = agg_peak[bucket] * bcm->vote_scale; bcm->vote_y[bucket] = bcm_div(temp, bcm->aux_data.unit); - - if (bcm->enable_mask && (bcm->vote_x[bucket] || bcm->vote_y[bucket])) { - bcm->vote_x[bucket] = 0; - bcm->vote_y[bucket] = bcm->enable_mask; - } } if (bcm->keepalive && bcm->vote_x[QCOM_ICC_BUCKET_AMC] == 0 && @@ -260,8 +285,12 @@ int qcom_icc_bcm_voter_commit(struct bcm_voter *voter) return 0; mutex_lock(&voter->lock); - list_for_each_entry(bcm, &voter->commit_list, list) - bcm_aggregate(bcm); + list_for_each_entry(bcm, &voter->commit_list, list) { + if (bcm->enable_mask) + bcm_aggregate_mask(bcm); + else + bcm_aggregate(bcm); + } /* * Pre sort the BCMs based on VCD for ease of generating a command list From patchwork Fri Aug 11 23:16:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 134789 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp1462502vqi; Fri, 11 Aug 2023 18:40:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGb35xntEV0Z1LJhBVCIvnzzcT8pKo+rSbMrqJ4BK0d6YXaDRTAXYmhWAN7jmwsWyBo4MKo X-Received: by 2002:a17:90b:1982:b0:268:ac99:4bb4 with SMTP id mv2-20020a17090b198200b00268ac994bb4mr2427850pjb.46.1691804406942; Fri, 11 Aug 2023 18:40:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691804406; cv=none; d=google.com; s=arc-20160816; b=qw04QQlYsO2hBaTvw+p8sUErCy6wsQv2K3wn+5j6ve6s60Nwa7K4vv2Jags10BC5e9 aQ7z66QFH9EvQT7vtUsW54J+VYOOWP2E5v58w2kxR5NU900Zh5qtCd2686Ze1k+3PP9X VsXi6SMu/x/Q+ff7XOxst1+XrFr3ycbQDCHuEfqWilbwPoXUXovWd4jHT4whAa0njgIK MbfIir3pl9OuIAgJz3+/x/RRReFo6pwndmmhHL5H0d5i41Um6taz56d7pUnQ7/QUPn3A PxRIhvg0bmkN9w2TDZIRC7D3k4GxkymDl2RxBRFe89r+RUl/z9e0Ld6MMvu//YS8CsqR lfWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=czw8itWeaD9VouL3BdJnjgMtHFcsN8021NNdf8QkGZ0=; fh=MHenx2e24sxK1mTtSFwMETuI0QLHZHbQce7iWE+IwsQ=; b=v8grQHp46x+9e8bKhQWHk3NpMUp/mov+VZz+fKmTCPXbBivRsPaoBn94QR/p9lLiJR fVUH398NOzVzJy2BkJmcahT0KfsLtAvIpcKbZQf76hIg2kC32U2qn6IeD+1SLrarJlC7 XZHW2otrcQM0oag3IbtM0C3NURdZPLK7v9dM1GnKm4pb0xFuvGYsyraVWEroPQmuLLq3 04emdGn/6fjDfSE870auhcFGqe83fKjpC3NNgFr1x4hPNxyhHIELAMIbwV3pN243xiI5 VzO3nEpom4XqFzN8KUfQc+u6r+gGjbBGeyqJaaQpwbwy28AoH4d0LhhfOLZgcsukYizT F8Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bxivqnRM; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020a17090a850600b00269208e38a2si6205783pjn.105.2023.08.11.18.39.54; Fri, 11 Aug 2023 18:40:06 -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=@linaro.org header.s=google header.b=bxivqnRM; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236547AbjHKXQ3 (ORCPT + 99 others); Fri, 11 Aug 2023 19:16:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234786AbjHKXQX (ORCPT ); Fri, 11 Aug 2023 19:16:23 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DBA21718 for ; Fri, 11 Aug 2023 16:16:22 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4fe0c566788so3914884e87.0 for ; Fri, 11 Aug 2023 16:16:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691795781; x=1692400581; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=czw8itWeaD9VouL3BdJnjgMtHFcsN8021NNdf8QkGZ0=; b=bxivqnRMY7Sdkr94n5F/Px3mN3lKykrZetZCwiqpmT8px96/eATphvq+hWbDzMMUl8 9FWKvSrtnqj1iyBjSq0s588zZXDIyp+zq+Vtu3gjHaFQmwsnO2FWli/40X+lk4CL6KEE oSWPwAxzEcavH7rLGjW/6HDD/F17zcfrvs30AnepJpPUUIuJLqhgAP2Wx7UvpoxBWKOW hgBIEJmTvV2/14wWRnobDvt2cJgdSjapGuqR14zWhJTCoRhZA67QtK8OeTtfbKQNZftX P4g0AoG6mKARBLBeR+B9rC1yqtjfEEcz9An6kT7fe1D9yi8WMFKi37mHVFLRac8udreF Ra4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691795781; x=1692400581; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=czw8itWeaD9VouL3BdJnjgMtHFcsN8021NNdf8QkGZ0=; b=MBtiai/XtkSN+wd/t3TuU+S2jKojZDGnhNsPdvnf1EPM1RaP1B6PyrJ9uKRPpvWt8h uhUquDVuEtU+DQE8Ahog9lwp38fVl2mZ+HWDiy7GeKf+HzQd+MX8Rn4rcw2KyzMLDj2U xxztIlbW6CzwW5k1zKV2YNSMd3T5UxRy8HlgKxTGPbxhSfevVvJASgoBIAZplP0yKWPe Lbrz1UJ1s7AqPGrC7hP90Tqq7xl56Nj1LbtKKrYL0ehJc3xhE7NbbXjk19Z3o1PlqVUd Dm3Pr3n/WG3JzLfuwgMKASylFt0o9z1DNiWD0HukOOOOWI0gXQ/h6cleocDJZZIJ4MAJ YA9A== X-Gm-Message-State: AOJu0YykmvLwlQysyeSaO4VJDupDpEFgISf9qazRW7+v+7JwbQe/6gPF 8go/95Y0683Vunbmri94gWXalg== X-Received: by 2002:a05:6512:2315:b0:4fd:fef7:95a5 with SMTP id o21-20020a056512231500b004fdfef795a5mr2782946lfu.11.1691795781383; Fri, 11 Aug 2023 16:16:21 -0700 (PDT) Received: from [192.168.1.101] (abyj188.neoplus.adsl.tpnet.pl. [83.9.29.188]) by smtp.gmail.com with ESMTPSA id m16-20020a195210000000b004fe48332852sm884773lfb.136.2023.08.11.16.16.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Aug 2023 16:16:21 -0700 (PDT) From: Konrad Dybcio Date: Sat, 12 Aug 2023 01:16:16 +0200 Subject: [PATCH v2 2/2] interconnect: qcom: bcm-voter: Use enable_maks for keepalive voting MIME-Version: 1.0 Message-Id: <20230811-topic-icc_fix_1he-v2-2-0620af8ac133@linaro.org> References: <20230811-topic-icc_fix_1he-v2-0-0620af8ac133@linaro.org> In-Reply-To: <20230811-topic-icc_fix_1he-v2-0-0620af8ac133@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Mike Tipton , Neil Armstrong Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Bjorn Andersson X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1691795777; l=1366; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=9+dhJntssIo8yKCa0lMm05/Qxhg0nhjKsOE59k2uJ5g=; b=9Vg8m5lBfUabDMntbvIW95/q5rc6Ri8b0OPHS+v5ebQyY+Oc2oOcbZ+pyrBBtktQslHwm1Caw QZdPS83XTl9BbSNqi2BF+uey/N9R0FlXEHosB4zOljW4OtilqNJycXI X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773985497940888264 X-GMAIL-MSGID: 1773985497940888264 BCMs with an enable_mask expect to only have that specific value written to them. The current implementation only works by miracle for BCMs with enable mask == BIT(0), as the minimal vote we've been using so far just so happens to be equal to that. Use the correct value with keepalive voting. Fixes: d8630f050d3f ("interconnect: qcom: Add support for mask-based BCMs") Reported-by: Bjorn Andersson Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/bcm-voter.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/interconnect/qcom/bcm-voter.c b/drivers/interconnect/qcom/bcm-voter.c index d857eb8838b9..a2d437a05a11 100644 --- a/drivers/interconnect/qcom/bcm-voter.c +++ b/drivers/interconnect/qcom/bcm-voter.c @@ -81,10 +81,10 @@ static void bcm_aggregate_mask(struct qcom_icc_bcm *bcm) } if (bcm->keepalive) { - bcm->vote_x[QCOM_ICC_BUCKET_AMC] = 1; - bcm->vote_x[QCOM_ICC_BUCKET_WAKE] = 1; - bcm->vote_y[QCOM_ICC_BUCKET_AMC] = 1; - bcm->vote_y[QCOM_ICC_BUCKET_WAKE] = 1; + bcm->vote_x[QCOM_ICC_BUCKET_AMC] = bcm->enable_mask; + bcm->vote_x[QCOM_ICC_BUCKET_WAKE] = bcm->enable_mask; + bcm->vote_y[QCOM_ICC_BUCKET_AMC] = bcm->enable_mask; + bcm->vote_y[QCOM_ICC_BUCKET_WAKE] = bcm->enable_mask; } }