From patchwork Fri Mar 3 02:35:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 63732 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp186536wrd; Thu, 2 Mar 2023 18:37:13 -0800 (PST) X-Google-Smtp-Source: AK7set+l88ISZlX4GMuxzW68d6aZ5MUj1nS7w0YHOae6ZLAg+rLu0xzAFbIqIcwG1HTmBxjvxNbA X-Received: by 2002:aa7:d958:0:b0:4af:51dc:da5e with SMTP id l24-20020aa7d958000000b004af51dcda5emr346260eds.38.1677811033443; Thu, 02 Mar 2023 18:37:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677811033; cv=none; d=google.com; s=arc-20160816; b=lXPq8uPSaSJ4Ry+Bx3m5LadgANZQgFSSaD1EZiLpnK8XpmS9UyUU2LSZ0UfL+z3Ldm 4NxBTg9fNgTeb6Hxr+fxyOMPkS06yzIE/mqODs7X+nqV7yL3XQ32aT4r/gAslodyV9vj 5Ij23jzlYSRjbDfxR74O6sWEgtBfqaEN9uYkd4+hTXnV4bY097ykIXL3SA99q5+Pkb77 JCR7dBDZD/ksY1vfuy4HzPYfp0xomO+giMa2xE+0EWB1TICXF56z0ubvUkLaxOEUqIhf o6Pu3nSPhT+BvJTxVzh+ySV51wk87euj4/qE99jswPWCXoXxVwO9VRjeRme/+PNDK71O KlZw== 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=jLRvX/I7uLgP1lL5sZgRZ4/1Xfsiyoty5CreDeDfcFQ=; b=En2O5f/uCVRPxusWRjxqME4CKNJ4IUET9iYVG+HuH6AHsl2bjxccf4RKMJ0hY42WeR Y3Qz9GwK8UQKGj3IhM1ZdWq9Uhd222ucY3I8T9xM5CRNi14RfR6YctqzYMRF6fvXHO7q UPSvgVopSywQBDy1ioYSq2J1FszAQcSrRz6yhFOKmaKJazV4pVnXr2hwaVyhD7Y8GKIV 9UwvBfxFs2qcb1v0BsV9tYnYx3kTjoJLTXpFIN/5Wf2f2te3fKWcqzs/pjMh1uLsCay7 heRERj8KpMK/Nt8lkJooUTBbPLnTIzcp01+AxpywZJ7ZyE0lOlReD/6kqNFVixYWHXTX ZK3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CCG58myA; 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 b11-20020aa7d48b000000b004aeeae11454si1292116edr.140.2023.03.02.18.36.50; Thu, 02 Mar 2023 18:37:13 -0800 (PST) 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=CCG58myA; 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 S229552AbjCCCfK (ORCPT + 99 others); Thu, 2 Mar 2023 21:35:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbjCCCfJ (ORCPT ); Thu, 2 Mar 2023 21:35:09 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A7543B3D6 for ; Thu, 2 Mar 2023 18:35:07 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id j11so1774100lfg.13 for ; Thu, 02 Mar 2023 18:35:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677810905; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jLRvX/I7uLgP1lL5sZgRZ4/1Xfsiyoty5CreDeDfcFQ=; b=CCG58myAHYYt0rheTGVmmZ8w/u/CvaQKetINiA1lSjLDfe62iXWW/PF+3AV6/qysQL meP02uIifxyypHpn4IwUeasomdIoWov5Zr82Cz0DUA8VabXsFrPTnPh6HxzKQ1cg2Cq0 b6oEXfBso/ZIHt0ckSs260XR2pZbjDpA0TkCONxi7cGePpRyE83pqn+k68bMPvaEXgDS RG07N04jYizbe+I/2lJLvMpim69cCvPblH4NgwkN5bFySG/MrTff/Wj2rR3W8PJqAA/h bpD6yW2uKHrsMNKYZvo4IXjBvdJnhWmW/30IDrr2ysOsf5vRWLdSq0imNsR8GxHkUJuB Motw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677810905; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jLRvX/I7uLgP1lL5sZgRZ4/1Xfsiyoty5CreDeDfcFQ=; b=ckRlBNlCQRdBQMtJS1isvh8ePBpF0wyPp2vMpH6nALEaCesMwCBtxEj5THgaihXQ11 VoeV+CnI4M409DnbQaYZW7vKjfmsh3e21S12IFXCL6FFPqMBx7WSQmXEPkKB5IlkVVXe 4hXfXs7urCpAOBo0N55ncBc42ZyCdyhvL0f/dz+9jllzTxCWy/V/5oSKSfy4xW5RPqO/ J/emu01vqdFYOWtbjyMBLbymo3ZSDzf2uLCCwvsF4UsCGrgRhdm4KdIphZKlB4Bqzcp8 8/shPMm4vr61//rmRTjK9DtzmZrc/C/yQBXdUXNzNsThIaOgZwCpW19qYxuO9BkyGrbP mYtw== X-Gm-Message-State: AO0yUKWQm3VOFLnKyjg0N6B1lN1hxPPgBC5b6GzhUOTo42aEmaT/96Yo eToMvn4UV4OkBVEaVGVwaZMaEA== X-Received: by 2002:ac2:508f:0:b0:4dd:a5aa:accb with SMTP id f15-20020ac2508f000000b004dda5aaaccbmr98125lfm.44.1677810905658; Thu, 02 Mar 2023 18:35:05 -0800 (PST) Received: from localhost.localdomain (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id d20-20020ac241d4000000b004d856fe5121sm180218lfi.194.2023.03.02.18.35.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 18:35:05 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org Cc: marijn.suijten@somainline.org, Konrad Dybcio , Georgi Djakov , "Bryan O'Donoghue" , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH] interconnect: qcom: icc-rpm: Don't call __qcom_icc_set twice on the same node Date: Fri, 3 Mar 2023 03:35:00 +0100 Message-Id: <20230303023500.2173137-1-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 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_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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759312381997688155?= X-GMAIL-MSGID: =?utf-8?q?1759312381997688155?= Currently, when sync_state calls set(n, n) all the paths for setting parameters on an icc node are called twice. Avoid that. Fixes: 751f4d14cdb4 ("interconnect: icc-rpm: Set destination bandwidth as well as source bandwidth") Signed-off-by: Konrad Dybcio Reviewed-by: Bryan O'Donoghue --- RFC comes from the fact that I *believe* this should be correct, but I'm not entirely sure about it.. drivers/interconnect/qcom/icc-rpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index a6e0de03f46b..d35db1af9b08 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -387,7 +387,7 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) ret = __qcom_icc_set(src, src_qn, sum_bw); if (ret) return ret; - if (dst_qn) { + if (dst_qn && src_qn != dst_qn) { ret = __qcom_icc_set(dst, dst_qn, sum_bw); if (ret) return ret;