From patchwork Tue Dec 5 22:14:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 174219 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3737279vqy; Tue, 5 Dec 2023 14:14:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IG9lPfbVKaxth5CNzw5ULIQCqABD59Ne7DiBasHRxkdhCKqmELvtSgN7wOeadJXWFrGCi84 X-Received: by 2002:a05:6358:528d:b0:16d:bd05:d0f1 with SMTP id g13-20020a056358528d00b0016dbd05d0f1mr4646rwa.5.1701814470871; Tue, 05 Dec 2023 14:14:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701814470; cv=none; d=google.com; s=arc-20160816; b=1GfAC1oMVBQNCs5E+l2o7BvncnrMnRBGa4KcOe4p7cE8rJOfRk6umjTg2QVqvhNbRn CgwHWPYQAzghelXMj88MOIgElMvFe1EI8DhHN4oHCuTbhAe51XagvIir5zZ3sCv2AwBo YyYg3VMphroCha7JtNzlhzvBuKZT8ZZnwZAOZbxSNag897gg3HcVX8F4xeEsd82WYBMc 8vROp7mCi80gdDDJjwX7uW7Jg4TqPew3ueDhdEronFHbz9+pMK43o+DkEehs9IWXeO5x xRa5iUEjrCqZUG5og0Ybi0tsTJ2mOH1QmAfnXOKuJ2sFNw5Xi3sRmcZ3Y1uhQZUf+nIF Q8yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=qHf8U2nrlOqnmtlM/j+8/wfCbRl6t44vzQQ63+6e53Q=; fh=3mHdsJzgN8SuxuhDylb6VGHMKX72qCv2v8ANhAQS4vQ=; b=z6Y1gNnEEs2Knxomxbi7huGDHtqm0Umw6qNTBDzqS6v3KHC1FQpmcL8Sh2QymOhNg2 Cx5bg9O0FvsBp/cmfFq7lDW4WiIkdWpGn/arRApJ2fe7UVsTU/8mlhvCVSCNrZaOnbcW 3hp4ecygnA2+DUQf04QNwcqjF/TjHfhsPGBBjzMqyTXrBnGOTbrEQntfc3ora8BUvC/Q SevldbNXXvVYxkxedO7KU9OXNbgkRBimYBKvFJggDtyTLrmoSSZOZ4aWXk3Yvi9VNy6D yTX4XqGA/WUSG/CmRS3JSCxErtRczlZb9sVz/inoueJDonsWuIFKCEokXLxmOo3BEgyc IxUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZBf3v6nh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id o4-20020a63f144000000b005c662419214si5965440pgk.229.2023.12.05.14.14.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 14:14:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZBf3v6nh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 6E0688047E46; Tue, 5 Dec 2023 14:14:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346334AbjLEWOL (ORCPT + 99 others); Tue, 5 Dec 2023 17:14:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbjLEWOJ (ORCPT ); Tue, 5 Dec 2023 17:14:09 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C254B137; Tue, 5 Dec 2023 14:14:15 -0800 (PST) Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3B5Lp4sT018700; Tue, 5 Dec 2023 22:14:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : date : subject : mime-version : content-type : content-transfer-encoding : message-id : to : cc; s=qcppdkim1; bh=qHf8U2nrlOqnmtlM/j+8/wfCbRl6t44vzQQ63+6e53Q=; b=ZBf3v6nhsdgTawJHYhiGf3LoAQ8cxSf8jrz0H0fyR6+vxjQyRr3r/fBvYGxspU446qTh hCYh1ddCbfddPX6BeDFogPSzgiMZZ10z0nH6KsKUXL7urnrUycm7uwS3wycnLadcDPhr y6dzoiqW2UlBUkMILZJ8vyzTjH0Ag1SF+vfVYDFXXydCiLfVIE8v1GLf+yl9nek45d88 XeDBfPCDL/pS7MIFv36107NharPwFy09HG8s97fdg2V6Jrkb5YUzam9VWFvjW6/GcwV5 iiHKyDv/sPxDhUulYeI/nDlNdauDFZFNh3t3+InJ+nVUcVLwMTnKo9SthR5pNWgMQ4vl Qw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3utaq6r7gt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Dec 2023 22:14:11 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3B5MEALE029675 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 5 Dec 2023 22:14:10 GMT Received: from [169.254.0.1] (10.49.16.6) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 5 Dec 2023 14:14:10 -0800 From: Bjorn Andersson Date: Tue, 5 Dec 2023 14:14:00 -0800 Subject: [PATCH RFT] interconnect: qcom: icc-rpm: Fix peak rate calculation MIME-Version: 1.0 Message-ID: <20231205-qcom_icc_calc_rate-typo-v1-1-9d4378dcf53e@quicinc.com> X-B4-Tracking: v=1; b=H4sIAKegb2UC/x2NQQrCMBAAv1L2bKBZ24sP8AHiTSRstxu7EJM2q aKU/t3gcQaG2aBIVilwajbI8taiKVawhwZ4ovgQo2NlwBaPFtveLJyeTpkdU2CXaRWzfudkyPY djr7ziAi1HqiIGTJFnmofXyFUOWfx+vnvbnA5X+G+7z8MoLTvgwAAAA== To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Georgi Djakov CC: , , , , Bjorn Andersson X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1701814450; l=1406; i=quic_bjorande@quicinc.com; s=20230915; h=from:subject:message-id; bh=IOiUqa5MIxZI2ZQuYicHMxdfvzg1T0CI18L5cTZyuSs=; b=TFtFYGhlEV2KqgcMa0undO9RfnVIsMY9h4Wm2eEncSDVe9bj0eGuLsRmbp/O8Kt7NN7gn4PrN39E zEcHcZnqAeaiZaWR+vm2ruP7fyDlQ6KOFK8SarfcvzjgLnLSnpSa X-Developer-Key: i=quic_bjorande@quicinc.com; a=ed25519; pk=VkhObtljigy9k0ZUIE1Mvr0Y+E1dgBEH9WoLQnUtbIM= X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 5HaCI60Er8S7KpgSfKcEGcesPQx7zYLk X-Proofpoint-ORIG-GUID: 5HaCI60Er8S7KpgSfKcEGcesPQx7zYLk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-05_18,2023-12-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 suspectscore=0 mlxlogscore=906 bulkscore=0 adultscore=0 priorityscore=1501 spamscore=0 clxscore=1011 phishscore=0 impostorscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312050172 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 05 Dec 2023 14:14:28 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784481810659628385 X-GMAIL-MSGID: 1784481810659628385 Per the commit message of commit 'dd014803f260 ("interconnect: qcom: icc-rpm: Add AB/IB calculations coefficients")', the peak rate should be 100/ib_percent. But, in what looks like a typical typo, the numerator value is discarded in the calculation. Update the implementation to match the described intention. Fixes: dd014803f260 ("interconnect: qcom: icc-rpm: Add AB/IB calculations coefficients") Cc: stable@vger.kernel.org Signed-off-by: Bjorn Andersson Reviewed-by: Konrad Dybcio --- Spotted while reading the code, patch is untested. --- drivers/interconnect/qcom/icc-rpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- base-commit: 0f5f12ac05f36f117e793656c3f560625e927f1b change-id: 20231205-qcom_icc_calc_rate-typo-a1542df4f222 Best regards, diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index fb54e78f8fd7..a8ed435f696c 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -307,7 +307,7 @@ static u64 qcom_icc_calc_rate(struct qcom_icc_provider *qp, struct qcom_icc_node if (qn->ib_coeff) { agg_peak_rate = qn->max_peak[ctx] * 100; - agg_peak_rate = div_u64(qn->max_peak[ctx], qn->ib_coeff); + agg_peak_rate = div_u64(agg_peak_rate, qn->ib_coeff); } else { agg_peak_rate = qn->max_peak[ctx]; }