Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3957088pxb; Mon, 4 Oct 2021 13:39:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2BgM/qAvb9LtrYfa4lLdfSN1UbDCjgfa9VsjH6wlQu4vhuikGsyIXTnRq64yg0J8IQti6 X-Received: by 2002:a17:906:5e17:: with SMTP id n23mr17033111eju.258.1633379958287; Mon, 04 Oct 2021 13:39:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633379958; cv=none; d=google.com; s=arc-20160816; b=bGJpHkMRF4jgNFe3Fq9TRRcBX/fVcbokhX6nQ3wiM1ZdluRXVAEkxBqjFKFX6O1smz o+yagRgdprEERkGvHm6mPLSi1xI8dKJ0jmNkdyBJ3b6Xx8tmlPTJoQBoc197+mq5kUzm JJ7NGCI/px0OicQTn3lfjwe+/3FI+e/3VVzgq0LSt0ReQy3RGG52hO/P+hkD1EDqBU7j 1ZS72ZrMbykjjdYHRBhdzBeufoSIHBkvBJTzIfqvhgsbtQYw+b5nB23y9L2+UUCM8SiZ S22xztnOrTIoATQASg6yYW0U+5odVqqG5uH85qw4DfV54bnu8nSQcFzXj6AOztQPgZLy 6rrA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pf8iLua/m7c85OG6i31tFw6D6gH8beRZZZrifxZEhjM=; b=r6MschcCdN7PDl5sZUrf6lT/NLbm2wUKoJP7sn2PW9ihTJ7ux9lnOSpvxepvIAfYY0 AOOnj9aOegTolRxtxGm3/G6Ob8yLAdPRI6uj5rbTRsWHWnQrpaCJFuii1edrr904ndPH qLWM0svIyXGgx1j0bgCZMWqu7AHROk4v1UTHBAByg4hLwFEOClk8pClqai0JPA+GP05g 3EeQ94/RCtyEzcC9wE1GQiEOTrPiabLMjSWWAgdCmDezufffhDdelKJiGR/DHey8KiqB fWd8C1EteVbwIvyV5mGEmzBXRWbvzWdTvheuas/Z0CdcaxEktQKPxthD4O3fDuYbQW97 bBCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hcfEsYaN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u1si24162924edp.348.2021.10.04.13.38.53; Mon, 04 Oct 2021 13:39:18 -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=@linuxfoundation.org header.s=korg header.b=hcfEsYaN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237947AbhJDNf2 (ORCPT + 99 others); Mon, 4 Oct 2021 09:35:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:47278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237852AbhJDNdO (ORCPT ); Mon, 4 Oct 2021 09:33:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 06A5763225; Mon, 4 Oct 2021 13:14:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353299; bh=ulfYhLnRGR0H4Tuf9IAqTsHD++vvs7/IV7lUakyRJRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hcfEsYaN9WWlQDNNmk1/me7XxmC1cQ6B3rbtRevytRYSo2IN9EOwAP683tDIjWdnN QYXmV9vQcKwMcyDI4ovGTF3nx5FU1m3D4noUYnE88IEQVmtlC5BnmCJz0uQyp1nu1i 9inaJSm1EzMqygfOYIMMS8F1O/02E/xWP1YZVN2w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shawn Guo , Dmitry Baryshkov , AngeloGioacchino Del Regno , Georgi Djakov , Sasha Levin Subject: [PATCH 5.14 074/172] interconnect: qcom: sdm660: Correct NOC_QOS_PRIORITY shift and mask Date: Mon, 4 Oct 2021 14:52:04 +0200 Message-Id: <20211004125047.384345284@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shawn Guo [ Upstream commit 5833c9b8766298e73c11766f9585d4ea4fa785ff ] The NOC_QOS_PRIORITY shift and mask do not match what vendor kernel defines [1]. Correct them per vendor kernel. As the result of NOC_QOS_PRIORITY_P0_SHIFT being 0, the definition can be dropped and regmap_update_bits() call on P0 can be simplified a bit. [1] https://source.codeaurora.org/quic/la/kernel/msm-4.4/tree/drivers/soc/qcom/msm_bus/msm_bus_noc_adhoc.c?h=LA.UM.8.2.r1-04800-sdm660.0#n37 Fixes: f80a1d414328 ("interconnect: qcom: Add SDM660 interconnect provider driver") Signed-off-by: Shawn Guo Reviewed-by: Dmitry Baryshkov Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20210902054915.28689-1-shawn.guo@linaro.org Signed-off-by: Georgi Djakov Signed-off-by: Sasha Levin --- drivers/interconnect/qcom/sdm660.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/interconnect/qcom/sdm660.c b/drivers/interconnect/qcom/sdm660.c index ac13046537e8..99eef7e2d326 100644 --- a/drivers/interconnect/qcom/sdm660.c +++ b/drivers/interconnect/qcom/sdm660.c @@ -44,9 +44,9 @@ #define NOC_PERM_MODE_BYPASS (1 << NOC_QOS_MODE_BYPASS) #define NOC_QOS_PRIORITYn_ADDR(n) (0x8 + (n * 0x1000)) -#define NOC_QOS_PRIORITY_MASK 0xf +#define NOC_QOS_PRIORITY_P1_MASK 0xc +#define NOC_QOS_PRIORITY_P0_MASK 0x3 #define NOC_QOS_PRIORITY_P1_SHIFT 0x2 -#define NOC_QOS_PRIORITY_P0_SHIFT 0x3 #define NOC_QOS_MODEn_ADDR(n) (0xc + (n * 0x1000)) #define NOC_QOS_MODEn_MASK 0x3 @@ -624,13 +624,12 @@ static int qcom_icc_noc_set_qos_priority(struct regmap *rmap, /* Must be updated one at a time, P1 first, P0 last */ val = qos->areq_prio << NOC_QOS_PRIORITY_P1_SHIFT; rc = regmap_update_bits(rmap, NOC_QOS_PRIORITYn_ADDR(qos->qos_port), - NOC_QOS_PRIORITY_MASK, val); + NOC_QOS_PRIORITY_P1_MASK, val); if (rc) return rc; - val = qos->prio_level << NOC_QOS_PRIORITY_P0_SHIFT; return regmap_update_bits(rmap, NOC_QOS_PRIORITYn_ADDR(qos->qos_port), - NOC_QOS_PRIORITY_MASK, val); + NOC_QOS_PRIORITY_P0_MASK, qos->prio_level); } static int qcom_icc_set_noc_qos(struct icc_node *src, u64 max_bw) -- 2.33.0