From patchwork Wed Jun 14 18:04:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108108 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp154637vqr; Wed, 14 Jun 2023 11:42:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7BsBIOTVVTMU+IaGYsXaKRbL5g/RtjrQH4wHPlCkdv3aRhVW8JYy5EEFKifOnOkqtzNiKi X-Received: by 2002:a17:90a:190d:b0:259:c18f:ec81 with SMTP id 13-20020a17090a190d00b00259c18fec81mr2397551pjg.11.1686768152406; Wed, 14 Jun 2023 11:42:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686768152; cv=none; d=google.com; s=arc-20160816; b=KyWMCSyZRTJ1D5HiYCWrXce5yJravYumu/VJdm8HsPkEv2QlapAn3Amwtv1TQ9qnVb zGtVHQIKB6SXIVDf9s88kYyE3mN+AkGa+hqNJX/N6IMtcz1Tg29ypKFbGZo3ahZuqX1S zEsoeKH0jTIcpl2cX+UmckSHulf/8R7FZmLbq8zmUzFSEyh9tKSVf7qu0qxtZqo6OMat OWJl4FGo+VWFl/5VSGACcb9LpBE9Id959IxljOuzrHuQzmyzzEkzL5HAE/mvd59FEHHh vOYz8ddAvje1xDgIVvENJoiKm3oin0984d+T4Lj0GBL2JV23Q2NcXoVyGGNPl/mhwSH/ BVGw== 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=Upd4FeAvQf31usHpyE+RwsUFEIsTHUdVtgm5KELcXA0=; b=Pczgl25O/Up7qbFYIisuteB3oRCHhgHk1hSCSaixKC0PJnlehT+L0ju7MtZSWADGbc Izp5tjZXGcmw9eDZZHP626II40YaMGazKZOYclG8JGd0UblKONl0BjrJCbfSmdMyQw+Y I9Rbb4gG7bnB/SnNqhQ6yCHs9kBlFkkGscsgCSOr1I0VB2yAIjXIHElcrK39yU0flFWd ymlnb8AR7H7XnA3//6P2XrRpW7F4uKdwsbjQR/g8Gir6G+uoESPnD4gJfRNS0ZERlIPb P8nInTl86w3OFJ8es9xiz2CZX1zEZsTYOFhJ4BZgeJDp4zFOZs/gzA0ua2voXji8CmoB 2A8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="wI5e5l//"; 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 f3-20020a17090ab94300b0025bf3ba6bb9si5499505pjw.139.2023.06.14.11.42.17; Wed, 14 Jun 2023 11:42:32 -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="wI5e5l//"; 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 S235320AbjFNSEp (ORCPT + 99 others); Wed, 14 Jun 2023 14:04:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233686AbjFNSEk (ORCPT ); Wed, 14 Jun 2023 14:04:40 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC3A4211C for ; Wed, 14 Jun 2023 11:04:37 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-4f649db9b25so9039970e87.0 for ; Wed, 14 Jun 2023 11:04:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765876; x=1689357876; 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=Upd4FeAvQf31usHpyE+RwsUFEIsTHUdVtgm5KELcXA0=; b=wI5e5l//s9SmtRdaucEZwzoqaSqv0P+OcCY/FZ/8vCs0lKx+xf8gPI7Mnz7YmXE4XI Ci/9nJzhl/7bFpMNRaoO5DffXCMrpP+0vQB3xnph3nv19tpP/3HBjvaEvHTXzx45BW48 /08LB0goopNxP8DUBrw+UlUFSssSpJ29DwPWck31cWdsSbRU1Y6nEnQ3zjxq2ZzN1lHO otNsaJF99SGeiiouf6ZEU7GMEJGkkgbArCUlISZKccJoNE1eL7oTqa3E7ZgIRJyxiCfK 5LOMm8JXmnJPmvk/HGfQ0pxwSewS0LdEixk500s7Y8BXZ/S1JnwRnYhcNQi+tdxapjX5 uolw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765876; x=1689357876; 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=Upd4FeAvQf31usHpyE+RwsUFEIsTHUdVtgm5KELcXA0=; b=VMfQ+Hu+ctssx44JQQuodESuAREkeFqumM8jfld5FJyh0zHIml5TMNLuOaixiSIkIN Ev8Y5mNJ4E13+68aQqEoN2434vt+0KOVj0U9v0X0JCr9Ujt9skH7FGKF4WrxWGnQOmas 9A+e/JRh5Iy2LqlrJ3APLQ2Lsm8mqVq+GUbmktyFwhZmm+gZBWLiNgWtXwg7TpHDtxx7 GNjQiLkB1Z4/qM+ZtnrXLHZC06vMX4ys0pUeevXq+RvajRWCixT3kkgdqDmdUpDJe5Dz rh0gp8zL9DQb9txhWWxX9lr2hvsGuzH9O0NBclMxVmspjhVgVwi4klGlVqqXnj28DZio w0gA== X-Gm-Message-State: AC+VfDy846esYTwI4LOSu8qkr9OT17TWvcxTwUkHFLITWY9QvRjhSStU 7XOcZ19xsXG61Fr/A9HzHUa3Sw== X-Received: by 2002:a05:6512:615:b0:4f2:5d38:2c37 with SMTP id b21-20020a056512061500b004f25d382c37mr8741494lfe.15.1686765875915; Wed, 14 Jun 2023 11:04:35 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:04:35 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:20 +0200 Subject: [PATCH v6 01/22] dt-bindings: interconnect: Add Qcom RPM ICC bindings MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-1-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Krzysztof Kozlowski X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765872; l=982; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=w9msswuI45zhSz7DbQ6BMai4GWYypGBpOWJMFDd+VyU=; b=IOnkjnpkZECBVHk2UHt1fRIw7NiaZ+xUE7tMwJBoa0QGYcAoGKH6PauFzsijOmxOc0RihS+6A 0ND0zIfIXPGAdUKn1sOADH1Tr4UgiDy/Em+SC1q/gu3iADc7OQD+sL0 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768704602249625383?= X-GMAIL-MSGID: =?utf-8?q?1768704602249625383?= The SMD RPM interconnect driver requires different icc tags to the RPMh driver. Add bindings to reflect that. Acked-by: Krzysztof Kozlowski Signed-off-by: Konrad Dybcio --- include/dt-bindings/interconnect/qcom,rpm-icc.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/dt-bindings/interconnect/qcom,rpm-icc.h b/include/dt-bindings/interconnect/qcom,rpm-icc.h new file mode 100644 index 000000000000..2cd56f91e5c5 --- /dev/null +++ b/include/dt-bindings/interconnect/qcom,rpm-icc.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +/* + * Copyright (c) 2023, Linaro Limited + */ + +#ifndef __DT_BINDINGS_INTERCONNECT_QCOM_RPM_ICC_H +#define __DT_BINDINGS_INTERCONNECT_QCOM_RPM_ICC_H + +#define RPM_ACTIVE_TAG (1 << 0) +#define RPM_SLEEP_TAG (1 << 1) +#define RPM_ALWAYS_TAG (RPM_ACTIVE_TAG | RPM_SLEEP_TAG) + +#endif From patchwork Wed Jun 14 18:04:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108104 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp154305vqr; Wed, 14 Jun 2023 11:41:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4VaowIWT7JgUstv1gwx8au4BlBSzFylAcddIR2E6ciEiSgo5hCchP+rYxiBkWkOp3y7pO4 X-Received: by 2002:a17:903:41ce:b0:1ac:8837:df8 with SMTP id u14-20020a17090341ce00b001ac88370df8mr15054586ple.6.1686768106339; Wed, 14 Jun 2023 11:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686768106; cv=none; d=google.com; s=arc-20160816; b=UrbmCUeyJ20kP7l6fJez9HKGlIk8q0Nc6uFSdzG35DL9ram4y4dAYO6qv0hHg6Z52h dcpXAHkZwKCqwFxIJgg2aGEo3oEGL9qD5y3qDdTr2OnHs01pPiwSqrJ/KidWMjV/ZaPf zfn2456qX9xjFoo3qJxbTry5QdhRBzWW9aBD35DwnJ9UERYvYf9a1PjeXPNgFZzEunSW CWEidsa7z3HoZ44puph4/XCk9N4doAD+2KRz/0CLsLQSkm4oJDRRR5/q8Bb7Hq+E1Luk fTL7mY1gwu2gHiDqjJRcs2nCp0hyyeNKR7yNmCAZmEDmCtsu/zP7lePYEG6mEM1ygNZh HryQ== 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=Ak6pJEE70i86/FySUfYrSS2au3HzGmo13oLp85+Of0E=; b=M3ZcuvSd/7g8u0ufcV+1KkZdxKlH6DrcdxbL5FaOJw2fuHfEOV/5UIfehCcJKVU6R7 IqIOHWM4fPYtjTPNmyLvQHqLnoAi1iDBwxSBFgrafIqoEH7N6MK40sumwYzjn2mg3UZn GjBOWgFkahEr8yxaLLTRCZNQG9yxvXB7ZVBVeWMQGtdbJ6+SkcZXe7lNOhj/RYc94AGi RAhHIn63tygIJq2yX4m6OqGMZGryjU8tScdwfF13zGcYKWz+4AUIc9Owg740QCq5Duub OQDhHYCGvexp3b76x5g9rYgWtcqV7QNBqlcE7HitSCG4CyIMrGRokwx9aoMD7x5Ijd2i OVHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wl4qwGXx; 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 e4-20020a170902e0c400b001a52db202c7si1306229pla.382.2023.06.14.11.41.27; Wed, 14 Jun 2023 11:41:46 -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=wl4qwGXx; 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 S236192AbjFNSF0 (ORCPT + 99 others); Wed, 14 Jun 2023 14:05:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233787AbjFNSEk (ORCPT ); Wed, 14 Jun 2023 14:04:40 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE85A211F for ; Wed, 14 Jun 2023 11:04:38 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f61b45ee0dso9182559e87.0 for ; Wed, 14 Jun 2023 11:04:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765877; x=1689357877; 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=Ak6pJEE70i86/FySUfYrSS2au3HzGmo13oLp85+Of0E=; b=wl4qwGXx1Oi6vBD6BiP1Gypn5UfNRwBI2XIwrLHO2SXIb9cW+AkGBMknkor1Kc+itR 2Pvx6mu5gaXcUo+wLGYjKdvzU9bGiGUpUFLvkYD+LC3LYZnd+/2K5iPJnKgx8osidXq5 PA3kqFsSSvDhAwzRN5QIj4KRuHGgkkK2wxjyQMyt2u1KTaXSttM3k9H0TyclKuHFZaaL n2Xpoisl/P9uQsfWRPBobdA+UKBmcf/zj2moZ9yfWvEEY5h+akj1fCeWcH5AlVl4KF9r 0ToLRkQiLCsj86/LNaN5vr6hwfsi01avX846BwhXHvVjgjXZcR0l5KlHnZ0aO2bVrpCD Xb9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765877; x=1689357877; 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=Ak6pJEE70i86/FySUfYrSS2au3HzGmo13oLp85+Of0E=; b=cjYW03vA/ixNXgyzRqo2MN4je+PxUAemhRk1Met9V2IR0U66BtPG8OgPvf14AWe/aD QJiBW+kzpB25QaX/yn6e0g6aIiSdgvSnNiOBCFujDdX6oUjjZsqLBwNCCBAdXJqg+QNJ sSGnXA3k9Uzv6ywa/k2Vj5LJMZQ74pjh4rezU/8/ryvIrkzWdVowl+7FGLAeL0p4NF8n FYRA4bWCk/FoFLlG2KprBPRDPwz3FGBQ26ID8xCr1KVSj/JEmQzTQ0AXg/xg0mw3sLnq +quH1vjf2Zt8afASLs1dmOH52Wp/TW7ANCd8zsaY7eAIGR6McaE5ZQhGAacW5dN3CAUC pVPw== X-Gm-Message-State: AC+VfDy/RhSxFdAz7Pehf5/t+YgCLicv7qR9CXsTVO1ZMrnkWya99uUL 8Wln5NIx2GqwP1NJl+5idLNKCw== X-Received: by 2002:ac2:5f8e:0:b0:4f7:689d:1dc3 with SMTP id r14-20020ac25f8e000000b004f7689d1dc3mr1271154lfe.59.1686765877231; Wed, 14 Jun 2023 11:04:37 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:04:36 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:21 +0200 Subject: [PATCH v6 02/22] soc: qcom: smd-rpm: Add QCOM_SMD_RPM_STATE_NUM MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-2-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765872; l=664; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=XHE1WQYZzaLo+c3xD4ALM/GRb1VwY7GuxNqpdL0mBnk=; b=Z+uUtD+ZHrOfEeHTesqQcIB8eGqM+tb8sAWlyAxnOsptGaC2MR12+NkO+y9dOerYzqKo4C/Im Ym5t1YvHW4EC/pa6R7JTh1ckjC8VBnQkMO7/SprZm+1LyFjwpA2G57Z 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768704553685836703?= X-GMAIL-MSGID: =?utf-8?q?1768704553685836703?= Add a preprocessor define to indicate the number of RPM contexts/states. Signed-off-by: Konrad Dybcio --- include/linux/soc/qcom/smd-rpm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/soc/qcom/smd-rpm.h b/include/linux/soc/qcom/smd-rpm.h index 2990f425fdef..e468f94fa323 100644 --- a/include/linux/soc/qcom/smd-rpm.h +++ b/include/linux/soc/qcom/smd-rpm.h @@ -6,6 +6,7 @@ struct qcom_smd_rpm; #define QCOM_SMD_RPM_ACTIVE_STATE 0 #define QCOM_SMD_RPM_SLEEP_STATE 1 +#define QCOM_SMD_RPM_STATE_NUM 2 /* * Constants used for addressing resources in the RPM. From patchwork Wed Jun 14 18:04:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108082 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp136679vqr; Wed, 14 Jun 2023 11:07:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7N83f7MZ6V4NwFRQ837qSvhd19glwyNnxWrkCIGglvpcBrWinIavx/Ncjnzz4DpyyJjfEv X-Received: by 2002:a05:6402:34c7:b0:4fc:97d9:18ec with SMTP id w7-20020a05640234c700b004fc97d918ecmr2236093edc.21.1686766077624; Wed, 14 Jun 2023 11:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686766077; cv=none; d=google.com; s=arc-20160816; b=InVIRJxM6rKDVCc5rv8t9L7QscFx1AGMxdLsoRc+SjXy+haqtxUmt8eiXJfe51DNq1 H5qpZvZHu0YTr406kUHTnyH2ttIxpNs3Ks0e1RJMlCy/RQfgjHNDfDW2YE/7zzjFslN8 KC4RaqLYBM3RbI7nuu/SVtEhteCaxPfEbLmhg6TWc1MepN8YhdMJ2rLpF2HnoH5mOPAj jMgk4WnJEB9y12Wex2QaolVvmJdJe3qHw2Ok/gh+eyNvOHNSf911LySR70iDgy7EmKnx GXLRbwmz/s0ueBRCSnp4RVe+zDwayUXJj51nU98uLpzn7fv38XdDehJRWNXoZmixcr5J J1/A== 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=SD+82Kp64qdWpl/p0nHwxIb/l/7wz0DuQnwuSSdR/H4=; b=t2wbjbBTbF2Pw+19KmRHR+HOE5uCToiIuOT0ONWdGS/CkUnmO16TwyZviOIfU1yYmW 7vZQQfG1QEdNmmXHY6ON9KXEAuv8chBk4zXMCQ350KIBnW8EogMmhpiSQenJ0xfdnszl iCvYgP+wLiUK/sSjB3WIyp0Ursqu8ja6xWY4QFcHNfuvVy0tw4f8o3QmkKfgiDGkddgS GIxO+jhIlkV0fEzA9sqchLJK5LpRyocWc4TsRvN4JYtY10FsO7AIYVOQ/Uj34qAiwDyF ObomcQwfzP3MxiuXj5sVvn9RnwInUGPNDmZf1zL1hRDsE6fiDrxlU46yyqV1BEbAbzw4 yKnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xGX6Q31u; 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 w7-20020aa7da47000000b005187bc34cefsi1626437eds.243.2023.06.14.11.07.24; Wed, 14 Jun 2023 11:07:57 -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=xGX6Q31u; 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 S236144AbjFNSEv (ORCPT + 99 others); Wed, 14 Jun 2023 14:04:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234359AbjFNSEl (ORCPT ); Wed, 14 Jun 2023 14:04:41 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B7561FCA for ; Wed, 14 Jun 2023 11:04:40 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4f6170b1486so8571266e87.0 for ; Wed, 14 Jun 2023 11:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765878; x=1689357878; 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=SD+82Kp64qdWpl/p0nHwxIb/l/7wz0DuQnwuSSdR/H4=; b=xGX6Q31ulUGAnsn2fKldWkIYkSzXIzb46Mu6lLMTPPQlaZknoQ8zhJP2yPwsvph7/z uNkCytLdjoNRKQwbfZa1bM4892sMAuIdGA9313BH8SViJ1GyQTvIg6Iypw0vJ9B9yh4S p1Da85LFqYnKP5qCQcqKG2p7Rg/ebI4jj7mzTZzn0cIVUszHBwiaDD/bi7WLNS4NOWSJ rD2XhLLU+oN/X00ibEZKG/l7z7+Il7PXDwlU4sc+KQiLGRvyeSWoPC/1ePgf7aWP4BJw 748uzd9FXWSqMoSQm9Sev8KT+zsGWUyytAXcYo8M3Hk+p4rl2Ywfen8du2O7u+woFVvy EdLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765878; x=1689357878; 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=SD+82Kp64qdWpl/p0nHwxIb/l/7wz0DuQnwuSSdR/H4=; b=k8OIdNI8HE9Pup0Gde8JTiBMtABCwDUgJ96my0xCFJA+TP7I8MBFd/Ba4B1eno1Y9L p9KQ8h7OlP+gSFThudHd/PC6bgEgrrtyfftBc1cw+jmgnXp5SkZNEZV9F9tg8SWKKN9q th9gKfCLtV+qQcMoSLvVKBNJVIgfqdV0iTEUG3HmxKZc//bkhPL4HHScYSwlezdXrnHU M74GjDoJcWTotDnxBEacf692ZG7u5SAgO2OJmVYjDn/x8bf7o0k7PmpBdaWbKvECpfj7 ihYB2NSvqeFyugvU889dJX3jknH1KxU4osh8Dc7WKxMCIXubAFeaWBrUsl7G4vXkJ4ur 07eA== X-Gm-Message-State: AC+VfDwUplC3qF55eG1x9wZBa6PHVeF/vv3qKEOLzqjMEVxvO9tyPe98 zEsKz7lAo8/TYscuZUdBmqV4QA== X-Received: by 2002:a19:9201:0:b0:4f3:89e6:23c0 with SMTP id u1-20020a199201000000b004f389e623c0mr871426lfd.31.1686765878627; Wed, 14 Jun 2023 11:04:38 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:04:38 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:22 +0200 Subject: [PATCH v6 03/22] soc: qcom: smd-rpm: Use tabs for defines MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-3-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765872; l=691; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=7uAPa6YDjXHLJZjqpcpTS8PIWFtwDRP9qtCSKC7URyY=; b=ZgJXoVFm/guIPESYFf7R2wG6/rp8u1VbGd9EYvhUNj8fEWrZpRvKXnvnQIYEYBW2u5fSrtpM6 EqBWKWHo/b1CBP0sgS8z/t3jZ0QKbXygUfqDK5j21uPJDXNrHsQzL6k 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768702426647888362?= X-GMAIL-MSGID: =?utf-8?q?1768702426647888362?= Use tabs for defines to make things spaced consistently. Signed-off-by: Konrad Dybcio --- include/linux/soc/qcom/smd-rpm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/soc/qcom/smd-rpm.h b/include/linux/soc/qcom/smd-rpm.h index e468f94fa323..99499e4b080e 100644 --- a/include/linux/soc/qcom/smd-rpm.h +++ b/include/linux/soc/qcom/smd-rpm.h @@ -4,8 +4,8 @@ struct qcom_smd_rpm; -#define QCOM_SMD_RPM_ACTIVE_STATE 0 -#define QCOM_SMD_RPM_SLEEP_STATE 1 +#define QCOM_SMD_RPM_ACTIVE_STATE 0 +#define QCOM_SMD_RPM_SLEEP_STATE 1 #define QCOM_SMD_RPM_STATE_NUM 2 /* From patchwork Wed Jun 14 18:04:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108092 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp142292vqr; Wed, 14 Jun 2023 11:17:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ44Yv2RMepTNhrRd7GxsJ7UIK+sGoej31yGtJUz5iS5rA4/3eby2XdMRgPqg8L79f03eHzS X-Received: by 2002:a17:90a:4611:b0:25c:571:44bc with SMTP id w17-20020a17090a461100b0025c057144bcmr2046304pjg.28.1686766647202; Wed, 14 Jun 2023 11:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686766647; cv=none; d=google.com; s=arc-20160816; b=PmiWdNS5t/uAX36GKsIDIvN6YvoeomRfDGV+3AlYzAE0vpz8OnG+qwvrPBkspFvesq N9X3aVDtiEWYk1xNh8j3xtYJDNrahyV9e0XcgGGcL3BIzf2ek74pGQ53L0ALjZpjRebe 6NbXjHri7M5qPv90g2q96QmlMfMZC4Rmf9R4L2LiINZV8xN29/e9/UTfk7GJp5SDhM8y OSf0Dhuo3lfQwQu1GGNlOLqKYQwCMr8yFSpIrh7dZbiWn8MpEQDKxKNWvz2bSxTpPfYV BZ9bxsTDqGJhzPb3wnRrigsJ+tN5ct+VbsEysnkXgXIuAm+UqRKgxsCL7VK2VPiRIKs/ jPmw== 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=43WXKM//3PGv9o6RwF8pM2BvmgRQSkW/hfnQEDsAZP4=; b=GaZUBRKG6g0Kfepik1Eg/nQmyZepu4CCtkqIg1GjuX5Y22R4jaQ+459G1hD3GZ4ymP OY6Yn1In0oeSMTC6QHziKi65jaS7zPhyyodCjm6ajojiEn9GFT525CpAAsxLK5gDdu4z h/MpCjxY/KqYyD9vYf8nen7fdkNZw4N60HRBZ345xSoyMP5xukzrd9pCNImtVo3fb+fI 6zLzFgjGB7UsK956SfZ41Bp7VVk2f5yZYepTzAqV1BkxhHeqjMkNyhKqFr/sqUrZUu5v FTAKwRXen+eR2xSpncJhI0WTERaGQFzmcPjbAEG8sJDXxvl/BK+ba//Pb4zsX0SP9jFE EdCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xgMycTOm; 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 w22-20020a17090a15d600b0025690f8610bsi13058750pjd.59.2023.06.14.11.17.13; Wed, 14 Jun 2023 11:17:27 -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=xgMycTOm; 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 S241880AbjFNSFV (ORCPT + 99 others); Wed, 14 Jun 2023 14:05:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234832AbjFNSEn (ORCPT ); Wed, 14 Jun 2023 14:04:43 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7B5D211F for ; Wed, 14 Jun 2023 11:04:41 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f769c37d26so1144256e87.1 for ; Wed, 14 Jun 2023 11:04:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765880; x=1689357880; 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=43WXKM//3PGv9o6RwF8pM2BvmgRQSkW/hfnQEDsAZP4=; b=xgMycTOmhiQ/2m7TIIgWdHMJMNT6nwXASYOwGIBmY3O+EBu2V/l6wWtYWsUErNENV9 iVQXXp51xeh2Mq2jOoRQXiatgE78/MJ4kKO02d9OQYVYzSKIN1Wu9Mwaq7e0cVnZH2CR xEh887MgslQg2UtO4KVXaYIgypRGdLZ70ADwmVT7kr/GDlT4gMPF5tQ1MNitBCcIS4Jt 6+ElzeVGpm6eUpDucD6AoXtM3R1SC+ROUA4CfzcbmvRwxUAcOxvEE/dhAkQeSQzePMF6 JLFRvrs4riLX7Dq4SrQgnPQF7+cnWRhib8tsmLgZmHBbveEpb5jlcIlMBxgv/G3XT4K5 3mvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765880; x=1689357880; 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=43WXKM//3PGv9o6RwF8pM2BvmgRQSkW/hfnQEDsAZP4=; b=COMjfRRTx23OcNMQo5ankLY52RfQGYid0zztm/gTh3fl1HMdJduzLbJ5XHKGu6EIr8 GLCivAV3ln/W6Tcxjyuhxxx6wOvcMbFCbNOEtXNLEK449cUvx8w41/pkJMfR5qWiA42U S6xLeEmRHAZinLT1e7tTzXOLLri0H1aRhmRh9QMqtXdEAOWUhvtefnMrXQOU1hCB9hH3 m8hO9cu2G87BBBK4oVzXHBm83QWnF3bKw9KWnhNvUfuSA539RE4AofOnYdaXFFG/5fc5 YyLcWlHX0SJmsfZAXKEDyBzHL2lr0sxo9edR9RxqG/u896b8Wn7ewZpa+2LBlbKAaV2X z+LA== X-Gm-Message-State: AC+VfDy3G5HGtOxr4Hve7U5/Qcw3BvOhKnLtdLAiEtLJLUtAmmkZ2+/N 55pn4BvlZH+WqMNDJRMbtEwjOA== X-Received: by 2002:a19:920a:0:b0:4f4:b806:4b5f with SMTP id u10-20020a19920a000000b004f4b8064b5fmr8074574lfd.57.1686765880116; Wed, 14 Jun 2023 11:04:40 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:04:39 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:23 +0200 Subject: [PATCH v6 04/22] clk: qcom: smd-rpm: Move some RPM resources to the common header MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-4-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765872; l=2480; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=htdvXfCYU07v6+YNPv56ef+1cDlrbXu+3LbOKbiWsm8=; b=iKXknn+N3Ds8jmRkYZstXu2eya+oOrgy7E4hjgC4X+xu1O9ma1WFiu8WBeSN2dCyVjuZ9gTkh bPy7/Bn0s2kAH2eix3LPZxTCLN4yO5RtG9va1hw3Xp7zI/AIxaISk+u 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768703023487160451?= X-GMAIL-MSGID: =?utf-8?q?1768703023487160451?= In preparation for handling the bus clocks in the icc driver, carve out some defines and a struct definition to the common rpm header. Reviewed-by: Dmitry Baryshkov Acked-by: Stephen Boyd Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 13 ------------- include/linux/soc/qcom/smd-rpm.h | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index e4de74b68797..937cb1515968 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -18,13 +18,6 @@ #include -#define QCOM_RPM_KEY_SOFTWARE_ENABLE 0x6e657773 -#define QCOM_RPM_KEY_PIN_CTRL_CLK_BUFFER_ENABLE_KEY 0x62636370 -#define QCOM_RPM_SMD_KEY_RATE 0x007a484b -#define QCOM_RPM_SMD_KEY_ENABLE 0x62616e45 -#define QCOM_RPM_SMD_KEY_STATE 0x54415453 -#define QCOM_RPM_SCALING_ENABLE_ID 0x2 - #define __DEFINE_CLK_SMD_RPM_PREFIX(_prefix, _name, _active, \ type, r_id, key) \ static struct clk_smd_rpm clk_smd_rpm_##_prefix##_active; \ @@ -171,12 +164,6 @@ struct clk_smd_rpm { unsigned long rate; }; -struct clk_smd_rpm_req { - __le32 key; - __le32 nbytes; - __le32 value; -}; - struct rpm_smd_clk_desc { struct clk_smd_rpm **clks; size_t num_clks; diff --git a/include/linux/soc/qcom/smd-rpm.h b/include/linux/soc/qcom/smd-rpm.h index 99499e4b080e..8190878645f9 100644 --- a/include/linux/soc/qcom/smd-rpm.h +++ b/include/linux/soc/qcom/smd-rpm.h @@ -2,6 +2,8 @@ #ifndef __QCOM_SMD_RPM_H__ #define __QCOM_SMD_RPM_H__ +#include + struct qcom_smd_rpm; #define QCOM_SMD_RPM_ACTIVE_STATE 0 @@ -45,6 +47,19 @@ struct qcom_smd_rpm; #define QCOM_SMD_RPM_PKA_CLK 0x616b70 #define QCOM_SMD_RPM_MCFG_CLK 0x6766636d +#define QCOM_RPM_KEY_SOFTWARE_ENABLE 0x6e657773 +#define QCOM_RPM_KEY_PIN_CTRL_CLK_BUFFER_ENABLE_KEY 0x62636370 +#define QCOM_RPM_SMD_KEY_RATE 0x007a484b +#define QCOM_RPM_SMD_KEY_ENABLE 0x62616e45 +#define QCOM_RPM_SMD_KEY_STATE 0x54415453 +#define QCOM_RPM_SCALING_ENABLE_ID 0x2 + +struct clk_smd_rpm_req { + __le32 key; + __le32 nbytes; + __le32 value; +}; + int qcom_rpm_smd_write(struct qcom_smd_rpm *rpm, int state, u32 resource_type, u32 resource_id, From patchwork Wed Jun 14 18:04:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp136607vqr; Wed, 14 Jun 2023 11:07:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7GRwpmhBIwRpQ2vo+na2JOzRegRqCy9ZFrzOClvZQSQcPzyDn2+YuHx9AXjfBWkiPigh3y X-Received: by 2002:a17:907:7202:b0:96f:cb13:8715 with SMTP id dr2-20020a170907720200b0096fcb138715mr15947060ejc.69.1686766071642; Wed, 14 Jun 2023 11:07:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686766071; cv=none; d=google.com; s=arc-20160816; b=dyG2ykYRiqIk44LyZg4FqqvffFilfvGdKmIJdBSgIWQx3yKdD4vbCvdKv4VSKxWNTq r7uH/opswsbUnjFpprYZc118NR8ENQtP6i20D90cV8kppLzDjESU+OLng2oOBPvlOiHu u1WCztVxEA7tCV86XyxT5MYD2S1o++dFLYmb8aP2AunfA+yF/c1vn8hMZM1LiusFK2Px gyT1wBRRjS4T9AnJxR1cgHG5mQ6qGm5WoOWzYajhWf/EvW8KYvlr+ePz5wz7yWNwPIYo VXXrpjbXV/uYws+uHcCC78a8OFDCtXf+9yalMDE+REvGUXd9dSPRaNBxgHbArHbHnHzM YQxA== 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=lt52lJ7IAYpZyo39NdZRaisuqAyx1l+kNW12PnaKg2U=; b=BWLO0lIr675U1WKLn69jK0B44tlOVRicS3HimhxKvsEhKoThQ6fj7OqEZrC6bDLNj7 wodsY1xGuvdzmytrfYjWJoAxObbqcxnPMDidDZde2LGnf27uBJIlcyrCwsPcgk737I5K yjsavSGnWeU3FgXRTIiBY/jGdC1v17UBbsVzIqpVNG+jOBk10rzYaVt5tJu+jg3c2ixH k04GHYPuvea4SEMP8rDZYT45vJ5m9fgAbn9rCbQUVsK9fxDf1TzQGb29rumAHsP6uTDQ dXjE9T5J17ha4uP8xPMGz/bxUZa1BSNdDHrwJGA8mbMEnDsxExrFtywNPyzpjDApfRM2 2N1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ebEkQJ6p; 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 qh8-20020a170906eca800b0096f6bbfea57si5298903ejb.988.2023.06.14.11.07.16; Wed, 14 Jun 2023 11:07:51 -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=ebEkQJ6p; 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 S240317AbjFNSF3 (ORCPT + 99 others); Wed, 14 Jun 2023 14:05:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235440AbjFNSEq (ORCPT ); Wed, 14 Jun 2023 14:04:46 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0D1D213F for ; Wed, 14 Jun 2023 11:04:43 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4f61d79b0f2so9443361e87.3 for ; Wed, 14 Jun 2023 11:04:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765882; x=1689357882; 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=lt52lJ7IAYpZyo39NdZRaisuqAyx1l+kNW12PnaKg2U=; b=ebEkQJ6pcPcQlKbUHz2rRD4DsJNXONVqNhVeSLyBoELawXi2VBwQU7XZv+IRi0idgY v5I5q+N4E3mFWtWUHNWI18VoUKSwKBSejb6SEPJvZ0KM/b2k7AI0ih/G8WM6UJS/uej0 JvYKe8blsU/XNFhS2bzf/YQbv8jNI1otJjf00FqDqbXNEFkBshr7tHkbSvOImCxyPDKU +3q2hzsD+SSu2p0Ti8Xf3vmkCApKoqwvHwp5LYIe35rtZyebxuO497khbL7Q4Ow9vSxe qT35Iq96OHo6OehffZkn3JEvC7V2gasr5jUM/iBoWQKq1hKWTvuL2Ozrxy6RRJ2oWGCe 0Faw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765882; x=1689357882; 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=lt52lJ7IAYpZyo39NdZRaisuqAyx1l+kNW12PnaKg2U=; b=hDS6YK3tBWRCEaMO597AaoDaKrS8VIsZFoFya/4ZRx1AFp8EPl+PByc0WJML3G+R+B oh+SPtfjO4h5yxshN1oQsjW+bRa7eKkkkW05iFS2siCxRm4Y6T07xJ5hN9hxaBeW5Hmg 2HEt3ww7HO8CVknwUPZStoq3f4PC9LoMurx9pmF1U1JNTpOtHtC68s9wntSkT2ro4Ftq q1olhSyaNHcslbRCOsPHZOZe4nckUrRfgAmq7E17dyx3nJOfFvrkgN08fs++ZwNXAzjx fLoBJC+QggbAHnIVWdDfgPbWgP09taCoH2lerglEkScpBJge7gPxjuxklGdSWbCv1jVr QC9A== X-Gm-Message-State: AC+VfDximXFxJ9/HAeueZVCgzcOb0IMeHPBRYWh5qFSHpyx0gsaNJaxC SAEzEzSaGKVnm6rgshGxf2IqNZAN/cWXxQpawWA= X-Received: by 2002:a05:6512:286:b0:4f6:3ab6:3d9e with SMTP id j6-20020a056512028600b004f63ab63d9emr8629429lfp.59.1686765881848; Wed, 14 Jun 2023 11:04:41 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:04:41 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:24 +0200 Subject: [PATCH v6 05/22] soc: qcom: smd-rpm: Move icc_smd_rpm registration to clk-smd-rpm MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-5-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Stephan Gerhold X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765872; l=3949; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=jmhJvBjqUtAAd9ogN4BP2RfilLnjEO+h94MD5RIqO5E=; b=ANYmt8cU0uPSIW79fYlCDPwqhBC87GcaHbFHS2uwFt9qZR7WZZCZE0zD2S4uSWw+r3affjSqe 0v5RphfyVZTCQypgQaEICZU70IxAzTLs4Kjq7PfnoUSzKv9mjga25J+ 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768702420420354273?= X-GMAIL-MSGID: =?utf-8?q?1768702420420354273?= From: Stephan Gerhold icc_smd_rpm will do bus clock votes itself rather than taking the unnecessary detour through the clock subsystem. However, it can only do that after the clocks have been handed off and scaling has been enabled in the RPM in clk-smd-rpm. Move the icc_smd_rpm registration from smd-rpm.c to clk-smd-rpm.c to avoid any possible races. icc_smd_rpm gets the driver data from the smd-rpm device, so still register the platform device on the smd-rpm parent device. Signed-off-by: Stephan Gerhold [Konrad: remove unrelated cleanups] Acked-by: Stephen Boyd Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 21 +++++++++++++++++++++ drivers/soc/qcom/smd-rpm.c | 17 +---------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index 937cb1515968..6e7f0438e8b8 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -1289,12 +1289,20 @@ static struct clk_hw *qcom_smdrpm_clk_hw_get(struct of_phandle_args *clkspec, return desc->clks[idx] ? &desc->clks[idx]->hw : ERR_PTR(-ENOENT); } +static void rpm_smd_unregister_icc(void *data) +{ + struct platform_device *icc_pdev = data; + + platform_device_unregister(icc_pdev); +} + static int rpm_smd_clk_probe(struct platform_device *pdev) { int ret; size_t num_clks, i; struct clk_smd_rpm **rpm_smd_clks; const struct rpm_smd_clk_desc *desc; + struct platform_device *icc_pdev; rpmcc_smd_rpm = dev_get_drvdata(pdev->dev.parent); if (!rpmcc_smd_rpm) { @@ -1344,6 +1352,19 @@ static int rpm_smd_clk_probe(struct platform_device *pdev) if (ret) goto err; + icc_pdev = platform_device_register_data(pdev->dev.parent, + "icc_smd_rpm", -1, NULL, 0); + if (IS_ERR(icc_pdev)) { + dev_err(&pdev->dev, "Failed to register icc_smd_rpm device: %pE\n", + icc_pdev); + /* No need to unregister clocks because of this */ + } else { + ret = devm_add_action_or_reset(&pdev->dev, rpm_smd_unregister_icc, + icc_pdev); + if (ret) + goto err; + } + return 0; err: dev_err(&pdev->dev, "Error registering SMD clock driver (%d)\n", ret); diff --git a/drivers/soc/qcom/smd-rpm.c b/drivers/soc/qcom/smd-rpm.c index 0c1aa809cc4e..577f1f25ab10 100644 --- a/drivers/soc/qcom/smd-rpm.c +++ b/drivers/soc/qcom/smd-rpm.c @@ -19,7 +19,6 @@ /** * struct qcom_smd_rpm - state of the rpm device driver * @rpm_channel: reference to the smd channel - * @icc: interconnect proxy device * @dev: rpm device * @ack: completion for acks * @lock: mutual exclusion around the send/complete pair @@ -27,7 +26,6 @@ */ struct qcom_smd_rpm { struct rpmsg_endpoint *rpm_channel; - struct platform_device *icc; struct device *dev; struct completion ack; @@ -197,7 +195,6 @@ static int qcom_smd_rpm_callback(struct rpmsg_device *rpdev, static int qcom_smd_rpm_probe(struct rpmsg_device *rpdev) { struct qcom_smd_rpm *rpm; - int ret; rpm = devm_kzalloc(&rpdev->dev, sizeof(*rpm), GFP_KERNEL); if (!rpm) @@ -210,23 +207,11 @@ static int qcom_smd_rpm_probe(struct rpmsg_device *rpdev) rpm->rpm_channel = rpdev->ept; dev_set_drvdata(&rpdev->dev, rpm); - rpm->icc = platform_device_register_data(&rpdev->dev, "icc_smd_rpm", -1, - NULL, 0); - if (IS_ERR(rpm->icc)) - return PTR_ERR(rpm->icc); - - ret = of_platform_populate(rpdev->dev.of_node, NULL, NULL, &rpdev->dev); - if (ret) - platform_device_unregister(rpm->icc); - - return ret; + return of_platform_populate(rpdev->dev.of_node, NULL, NULL, &rpdev->dev); } static void qcom_smd_rpm_remove(struct rpmsg_device *rpdev) { - struct qcom_smd_rpm *rpm = dev_get_drvdata(&rpdev->dev); - - platform_device_unregister(rpm->icc); of_platform_depopulate(&rpdev->dev); } From patchwork Wed Jun 14 18:04:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108086 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp137113vqr; Wed, 14 Jun 2023 11:08:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6LH+XwRmpUntw4PWWQ/1Pp2YfEE9idHDk89GchEJLd+M0JAhmAiUnhF1ZGVvTOnj2ruYvD X-Received: by 2002:a19:ab01:0:b0:4f4:ca61:82ba with SMTP id u1-20020a19ab01000000b004f4ca6182bamr8195030lfe.67.1686766114770; Wed, 14 Jun 2023 11:08:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686766114; cv=none; d=google.com; s=arc-20160816; b=HqLpy9OGesk0rec2in6W6AbrVVO4yLf7SzYycKIf1oiF7vzrlq48ogco69CLa2adVV ikTSu9LI/WfEjSLnCIMO41hZi9TshxteQDAfa3Gb3MvS32jPWtwy3hFcyjd8kiIK2xya VmJJ33G6m6bhxBFvN1XQYAjshxd4StWkiudLnLPHV9tJfb2JuByDaADR5xh1aF3pok5Y Y7oYTrVDXhNpnpD4RqUuBzBqqhq7lPz23/oKWckRCJs8+IdF6Tq2f6Tw9I4BLRfyvMWk E9R3q+AUQBybZDzfq0QDgM27vJXse3jbvexyT0w0mwcNKpbkAOZilppmWZNzkN+SDY8X 6t+Q== 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=UEM3N0iLIlvYLepw85JsPFibfyRzMkZ98OPjRwmkvbs=; b=E4XG/R7cvMaE1tzXyiC3ehJG2hFu7IwGP6lPHmbzr1T+7INRx059dxsG9Oew3i70OH NgFV8durgjScEkEbLv2mwpLofXWMxLokhdnOHKxHaqREz4eaphv8cXOUg/L2DekqJPy5 esn8woqWhZp+c2pN3hvaXKf/oKlQdKcr4dvtQkDrFJtocUvy9orFj85U6cl8OxN5ptZ6 MeqQKeFSM/OoBcotzGfhFDezEI2XuG4rT8vBI+tYukBkRd1VMoOsi9K/WYz314b/6AgU RTEkYaSY1lLLnhERqD0LNytLDpPzsu4y2TLfqdYVUp2mGwK0YeiuMFCm/QhQoh/1wBGL +NOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I2qpiZG9; 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 p1-20020a17090628c100b00977c4ffb2d4si8311410ejd.310.2023.06.14.11.08.08; Wed, 14 Jun 2023 11:08:34 -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=I2qpiZG9; 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 S237242AbjFNSFh (ORCPT + 99 others); Wed, 14 Jun 2023 14:05:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235927AbjFNSEr (ORCPT ); Wed, 14 Jun 2023 14:04:47 -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 555232119 for ; Wed, 14 Jun 2023 11:04:45 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f60a27c4a2so8632293e87.2 for ; Wed, 14 Jun 2023 11:04:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765883; x=1689357883; 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=UEM3N0iLIlvYLepw85JsPFibfyRzMkZ98OPjRwmkvbs=; b=I2qpiZG9IlhpHLrWDbUfivORf3SP4eWt8EyCsInFmabtqInJMA0ELNMOuPs/wWZ0mA E97LOikyIZtyN4YUF9b8J64JA6qaUDafc9apsPr8nVcWzTNDSX3wMN3oJV1DT0j7OSVp /+E9B5eiN0tYgMYhFxQeKFQr7wOU8mhwDlavxuVWnXINyLnbrWr+fJ+5CE2HJNoFRUKp GBsohJJi/KHxBeqanUb75i/pRSuiSMdCCPJFxM+YoW1/eOgodS36/pAHCb1cnXzeSG22 UxgFukcqwnjcrWmZ2Pft6OZyLXRkceGI1iGfkCi0CrKPJYy2afgs2nqhpovlw0J9eIGD v6aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765883; x=1689357883; 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=UEM3N0iLIlvYLepw85JsPFibfyRzMkZ98OPjRwmkvbs=; b=YvqXXsM5dwWYoP8kUQrGJ7bBtFybb2uINcn21nL2wAZCuFyv3kn5ggLUDO4mFUbXOH dQ7cGQ99I7epnxaXhHGGAt+jDFRL4uqWi+MfJhFMRd/UA6QT4iJyzCdLF+X76lI/uR6e q9ce1YEDYk8QPYinCKBmWPnXrFPb5zfRX7kylmZa+B1pE1mNb0jnhJ+yc4RTWeAucn9k JfWDnV19h0GAY1xcNlAbZIXPdAKsqpRr6GlmtRpdp7TdTElsaVjdAS1s7jUb5dHYsEmD q7tegBP4gQkp91xN3EYm1A6s7vRI7bAK8S0iYuAToiAOKjtwvKXWQ7GxnU1ZFkWvVoQN cv/A== X-Gm-Message-State: AC+VfDzpe/L32kEjygmcvzPoRtkbchNN+8dGGIdQ6dAty6ta8SpSNCxM +5gLwDbAL9hDCbQcpe5kBVE0rQ== X-Received: by 2002:a05:6512:465:b0:4eb:18d:91de with SMTP id x5-20020a056512046500b004eb018d91demr8327587lfd.43.1686765883519; Wed, 14 Jun 2023 11:04:43 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:04:43 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:25 +0200 Subject: [PATCH v6 06/22] interconnect: qcom: icc-rpm: Introduce keep_alive MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-6-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765872; l=3661; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=g6kESh9vFn5cUExPwamnhleED6tFd+S7dtFe11cmEVE=; b=c3wTBcTebBtYHKq28YJz0R1OV4U4PKJUyiO3yyEw/DPpHxsYLAEsnGeb8UHIJ2FFCnIlQs1WE eMH16p4dT/oAj5IPhQJp2U6lv4Rwt1aRN5cS6ax7U+AUlqmTaGNgRWr 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768702465528166859?= X-GMAIL-MSGID: =?utf-8?q?1768702465528166859?= The downstream kernel employs the concept of "keeping the bus alive" by voting for the minimum (XO/19.2MHz) rate at all times on certain (well, most) buses. This is a very important thing to have, as if we either have a lackluster/wrong DT that doesn't specify a (high enough) vote on a certain bus, we may lose access to the entire bus altogether. This is very apparent when we only start introducing interconnect support on a given platform and haven't yet introduced voting on all peripherals. The same can happen if we only have a single driver casting a vote on a certain bus and that driver exits/crashes/suspends. The keepalive vote is limited to the ACTIVE bucket, as keeping a permanent vote on the SLEEP one could prevent the platform from properly entering low power mode states. Introduce the very same concept, with a slight twist: the vendor kernel checks whether the rate is zero before setting the minimum vote, but that's rather silly, as in doing so we're at the mercy of CCF. Instead, explicitly clamp the rates to always be >= 19.2 MHz for providers with keep_alive=true. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 10 ++++++++++ drivers/interconnect/qcom/icc-rpm.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 6acc7686ed38..863e8ba1daa2 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -50,6 +50,8 @@ #define NOC_QOS_MODE_FIXED_VAL 0x0 #define NOC_QOS_MODE_BYPASS_VAL 0x2 +#define ICC_BUS_CLK_MIN_RATE 19200000ULL + static int qcom_icc_set_qnoc_qos(struct icc_node *src) { struct icc_provider *provider = src->provider; @@ -380,6 +382,13 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) do_div(rate, src_qn->buswidth); rate = min_t(u64, rate, LONG_MAX); + /* + * Downstream checks whether the requested rate is zero, but it makes little sense + * to vote for a value that's below the lower threshold, so let's not do so. + */ + if (bucket == QCOM_ICC_BUCKET_WAKE && qp->keep_alive) + rate = max(ICC_BUS_CLK_MIN_RATE, rate); + if (qp->bus_clk_rate[i] == rate) continue; @@ -453,6 +462,7 @@ int qnoc_probe(struct platform_device *pdev) for (i = 0; i < qp->num_bus_clks; i++) qp->bus_clks[i].id = bus_clocks[i]; + qp->keep_alive = desc->keep_alive; qp->type = desc->type; qp->qos_offset = desc->qos_offset; diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index ee705edf19dd..d2c04c400cad 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -33,6 +33,7 @@ enum qcom_icc_type { * @bus_clk_rate: bus clock rate in Hz * @bus_clks: the clk_bulk_data table of bus clocks * @intf_clks: a clk_bulk_data array of interface clocks + * @keep_alive: whether to always keep a minimum vote on the bus clocks * @is_on: whether the bus is powered on */ struct qcom_icc_provider { @@ -45,6 +46,7 @@ struct qcom_icc_provider { u64 bus_clk_rate[NUM_BUS_CLKS]; struct clk_bulk_data bus_clks[NUM_BUS_CLKS]; struct clk_bulk_data *intf_clks; + bool keep_alive; bool is_on; }; @@ -102,6 +104,7 @@ struct qcom_icc_desc { const char * const *bus_clocks; const char * const *intf_clocks; size_t num_intf_clocks; + bool keep_alive; bool no_clk_scaling; enum qcom_icc_type type; const struct regmap_config *regmap_cfg; From patchwork Wed Jun 14 18:04:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108084 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp137101vqr; Wed, 14 Jun 2023 11:08:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6gGK+Tbly3GigR85iMAgbjRPk3aI5IFcdUDizERJEsXygjLVdp6DXOpTgmiTXezwDpKpsE X-Received: by 2002:a17:906:ef0b:b0:965:ff38:2fbb with SMTP id f11-20020a170906ef0b00b00965ff382fbbmr17032096ejs.1.1686766113015; Wed, 14 Jun 2023 11:08:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686766113; cv=none; d=google.com; s=arc-20160816; b=qz1RFjoVTVx9OgevsdGTaMshH/ZHF7ySQ8132icSVgUnJ7OMusxF+T2YP9lRQAfIQm sYQ7ciy8a72kcA3bVwvFmQOuimy7T1q5R+zO3+6z4wuGadC7+bTGABUj/xF6NiFwzl3l s097+j72YOHINfCyx1jkaojjOMr+SvnZIeccdj7hhXuI0+x76+KS339A27i97/cNuaJX HscK1gLaXMQYIpp378zqnynSlTnW0P67sG39gNuj75VytpuG+e9WwCF7LM/i1Q+tZvCO zzwlk44bPiqPH3LrNnxVcn+jRCnnRtu2jTqNihJpUvPqy7OkP/5KdUT0NJFQ0Po6iXOs PIRg== 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=8XUok3dbfSBKK4OnUZpMrrh2fJAxKXR9JHbUiXx4CDw=; b=kfZ3HB6pWFq0Xq4z3t4vbih/eGPknPz608Pf6pY71ikjhrVUS/bnpNpM0G8Li4jJBz PnNfTwrdg2TRnpFUzRMtJ0ytWRgqO15EmxGV9uhcsdYwxevz+nyL2DDOJkphfZiv3FOd yKLCyuP4IPksByNy/orrFV8iJeDMiwIU4q7RA0UnTkcx+R2LmmyOgeKWVg9lCQj7kCNC zFS7nG6oMEiscZ6bXKc0NP0jm68xTxGu4aCpTo7cQz86FRoorHzQIBo/xeIBtJtLpk1r XGpgzEMoRHoWnYPGQVfMxcuqruFHlMpqpzCuEEmqg5kBh0Z746okxhDwRrAVX33jkUV6 EyyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aN2mbhjo; 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 e15-20020a1709067e0f00b0097456c647ffsi9015658ejr.447.2023.06.14.11.08.04; Wed, 14 Jun 2023 11:08:32 -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=aN2mbhjo; 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 S240388AbjFNSFs (ORCPT + 99 others); Wed, 14 Jun 2023 14:05:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236115AbjFNSEu (ORCPT ); Wed, 14 Jun 2023 14:04:50 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 879E92686 for ; Wed, 14 Jun 2023 11:04:46 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4f764e9295dso1827307e87.0 for ; Wed, 14 Jun 2023 11:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765885; x=1689357885; 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=8XUok3dbfSBKK4OnUZpMrrh2fJAxKXR9JHbUiXx4CDw=; b=aN2mbhjoi0R0yZHc18kKZl+9mthA8tK+nD1YxdGpaaP6NrH+Ea6is9vFNBLf9ttzHR z0qv3ZjpfHAsO5U7UDuL8SjLPUzuEfAoczzCwfp7ne2WxOOtNuWhEJQt23+L/pSaJTIk Evv91O9oKLXuAn1Fnz3Uq69VaLe20aYxZ1Cts/JlFHtFCTF3sx9pTH2cGwVd7BkIeWf7 u2Z2HLXSM2TzghN48WMqmDpkOsyrxl65057waJTReuS1Fjpu1LuyaqdtCWmnplUxDdc4 1oOJdlbKAEqAmZp5JnAgDGX8kAxU5ANfv14rSnzX3O35PCalX2MKwLT8OETO07dpp/Ej a3Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765885; x=1689357885; 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=8XUok3dbfSBKK4OnUZpMrrh2fJAxKXR9JHbUiXx4CDw=; b=d9OEexTyMFaBmzqBFkMOFulF6M4mOEehaPG5Yj92/RPiVM5zNvawuVNqaPN9uvhJwr sm74CLsalr0zUlSUAobvTQMy+HqOLKqgLYEW9LHJ+yfgMSj5FaodLo7Wk0nlUIS608eF z7PjcNpffCg18ahvRfB9IhgervIsTi6kDHHWY6gPqgQt4ajDXHYrACD8LTLbYKz3Ajt1 Q2yJe7OH1A6tC4fTNAKDl6EsrKpR3myhI8qOZvOkGgcrWQvcO/ph6mdjGIaV9G5yrS37 WsJOZRuWLRktIuFog9DbL5BIFqperYS2J8G/YUR7lRVvowdQi0c7Ua1QmmRjpXhy4d3u Kqqg== X-Gm-Message-State: AC+VfDwUnB73fxUiaNBv3tfGVBc6IRHZmxysbdS+vfEYZ7PRFXK3KJ1v JZSGgf1hVLXTOjHJaI6/C0JNyw== X-Received: by 2002:a19:6601:0:b0:4f6:5bf2:63bc with SMTP id a1-20020a196601000000b004f65bf263bcmr7705909lfc.3.1686765884831; Wed, 14 Jun 2023 11:04:44 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:04:44 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:26 +0200 Subject: [PATCH v6 07/22] interconnect: qcom: Add missing headers in icc-rpm.h MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-7-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765872; l=3985; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=cyjuO3H/NwWuCUlv2vJ6Jn9ceZQeEKzsmbMZaK77x5A=; b=nzv+1Ar7IMMFT418Xy6pUo4GIYhu3uf2Bg3gE7654/sVi0xe1701cdSvjgJ/p6vvKBQ8YTN9U whxFQ0ai4GoBXbSp0SMh1k2aKY+tlf6U0zgiE+9TUD7L/lWkrrWg+MK 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768702463626204988?= X-GMAIL-MSGID: =?utf-8?q?1768702463626204988?= Currently the header does not provide all the required dependencies. Fix it. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 1 - drivers/interconnect/qcom/icc-rpm.h | 3 +++ drivers/interconnect/qcom/msm8916.c | 1 - drivers/interconnect/qcom/msm8939.c | 1 - drivers/interconnect/qcom/msm8996.c | 1 - drivers/interconnect/qcom/qcm2290.c | 1 - drivers/interconnect/qcom/qcs404.c | 1 - drivers/interconnect/qcom/sdm660.c | 1 - 8 files changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 863e8ba1daa2..80409f59b2c8 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -3,7 +3,6 @@ * Copyright (C) 2020 Linaro Ltd */ -#include #include #include #include diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index d2c04c400cad..899e75e8ebaf 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -7,6 +7,9 @@ #define __DRIVERS_INTERCONNECT_QCOM_ICC_RPM_H #include +#include +#include +#include #define RPM_BUS_MASTER_REQ 0x73616d62 #define RPM_BUS_SLAVE_REQ 0x766c7362 diff --git a/drivers/interconnect/qcom/msm8916.c b/drivers/interconnect/qcom/msm8916.c index 5c4ba2f37c8e..518f4b40ecc2 100644 --- a/drivers/interconnect/qcom/msm8916.c +++ b/drivers/interconnect/qcom/msm8916.c @@ -4,7 +4,6 @@ * Author: Georgi Djakov */ -#include #include #include #include diff --git a/drivers/interconnect/qcom/msm8939.c b/drivers/interconnect/qcom/msm8939.c index caf0aefad668..a7398c3c7411 100644 --- a/drivers/interconnect/qcom/msm8939.c +++ b/drivers/interconnect/qcom/msm8939.c @@ -5,7 +5,6 @@ * With reference of msm8916 interconnect driver of Georgi Djakov. */ -#include #include #include #include diff --git a/drivers/interconnect/qcom/msm8996.c b/drivers/interconnect/qcom/msm8996.c index 20340fb62fe6..733213a0b8c1 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -5,7 +5,6 @@ * Copyright (c) 2021 Yassine Oudjana */ -#include #include #include #include diff --git a/drivers/interconnect/qcom/qcm2290.c b/drivers/interconnect/qcom/qcm2290.c index a29cdb4fac03..95ea1f6d25ba 100644 --- a/drivers/interconnect/qcom/qcm2290.c +++ b/drivers/interconnect/qcom/qcm2290.c @@ -7,7 +7,6 @@ */ #include -#include #include #include #include diff --git a/drivers/interconnect/qcom/qcs404.c b/drivers/interconnect/qcom/qcs404.c index fae155344332..9292f8ac01b8 100644 --- a/drivers/interconnect/qcom/qcs404.c +++ b/drivers/interconnect/qcom/qcs404.c @@ -4,7 +4,6 @@ */ #include -#include #include #include #include diff --git a/drivers/interconnect/qcom/sdm660.c b/drivers/interconnect/qcom/sdm660.c index 7ffaf70d62d3..904014a9fd32 100644 --- a/drivers/interconnect/qcom/sdm660.c +++ b/drivers/interconnect/qcom/sdm660.c @@ -5,7 +5,6 @@ */ #include -#include #include #include #include From patchwork Wed Jun 14 18:04:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108097 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp152469vqr; Wed, 14 Jun 2023 11:37:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ743E6a1Ky2LH1xb+50M15f4yWn2S6NqH6XpnkkbrUZJkEIGGCDlzWNq8nA3Omnm8fPgt9j X-Received: by 2002:a05:6a00:a89:b0:647:370c:2c2a with SMTP id b9-20020a056a000a8900b00647370c2c2amr2828282pfl.6.1686767866727; Wed, 14 Jun 2023 11:37:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686767866; cv=none; d=google.com; s=arc-20160816; b=YrJ4bPePLFC/hHhRq4a6PnRn3LhmFME1ZpsormgU1wTcDd/f+UHOj7qZ8clNWK0at7 gVUb/1RJ71o69CWU9iRzqXXTlwKQwg+2oh3O4zil1oKwJjvYRwjURr/008PQSlKehEyg DiwTe3xdclynuATp4tjeQjCjwWflW9Q30kqx29OgrvO7KN3GGddmmKbrHSzVgN0dxGYq YTzxvg1Ma2YiVAZfaxGo7bzQ/cHpRVNfEG4+ubLdHEYeLxGjwFWzsw5ePtVdoUtKqx/8 GXIIHjN6UDm6cg/oARA5mfMUPKHij5phuOZ/RxMVyV7wF2RllP0Kr8+NDi1ya7eb0zgQ ELXg== 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=KnD8CjcCc/FAeQtS42aEkvj3Zwl/GPxxQhI6lxnE9EI=; b=GQfCc6XlplI0AbyNJtRY4QbceVEgOzdM64KOg/LsWC8Q8CnXkkW+dz/yk78/iV4C9b cuDpYu1aajQjGSPQvlxdxrzjTLib4gsc2iIghQdhVZzI84I13cPPbe1rinT9DgdtSlWG ivHdL+jwGqwKWExbruS7OXwPdMcvnx9W2lSnlnfPvjGG4NL6N3UDQzegTy39qPilrqvU e+Zbf5cYQc8MByHRPRX/XD9gIG97pahy2X/FIEgFoZBS13sLJGqN+qhZSLR6rz11KIs9 2r9qVG14ZOPyRF1CfqTAHel62tDX2CZHILCRKFSwQocJD2LkAkIME/twVZBknP6yhuiz Mf8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BGHMDUMF; 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 h71-20020a63834a000000b0054b51fd23b0si8319874pge.844.2023.06.14.11.37.33; Wed, 14 Jun 2023 11:37:46 -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=BGHMDUMF; 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 S234908AbjFNSGA (ORCPT + 99 others); Wed, 14 Jun 2023 14:06:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236647AbjFNSEw (ORCPT ); Wed, 14 Jun 2023 14:04:52 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3134269E for ; Wed, 14 Jun 2023 11:04:47 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4f7677a94d1so1410663e87.0 for ; Wed, 14 Jun 2023 11:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765886; x=1689357886; 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=KnD8CjcCc/FAeQtS42aEkvj3Zwl/GPxxQhI6lxnE9EI=; b=BGHMDUMFKMGKA3OhJFhRptDkqHDdMxjcR+aUMuUvs9hXLT8m91UVmvSKU+3WeIEXm8 b8xEkvsnl+7xUBJybu29vX4F/OWajnxp2cRbWz5UPPqjc5jzHq3quosXbNmlwe+kCBFs kdx3T/C++Bnm7PKCufen5DM18X1lf08YKpJekikHyOFKMJqTghacWIKOUmpgHdOzjKbS aAtOWMl4XWgQuwV4m4bzwJbqOOaPWC91NXuzMtgCCQ04qPawG7fZri/ffVX1oHpbVQLm 5k4fJLzVcssmfkxD0uJlxjQLmm0xBwxzywNshisCjnw5Zo5jkpPxVbqN3xWJZWLSPRKA AROQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765886; x=1689357886; 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=KnD8CjcCc/FAeQtS42aEkvj3Zwl/GPxxQhI6lxnE9EI=; b=guN93GMR28pw2EI7hsZvDDzHN9SmdlOedGG8oIQNkS6PZxHYeKBzK0v2wM4LgImW36 nwC75dqjWeJSkjjvzuidEoE/iPPFM8kPbWpfKe8gUHXiefPAqp3IflNpHD2HE0AlW7l1 lzPqLpHahFjuuEXyik0Am1vNfmO41q/LCzy22XeVfDdDClolR5ZW4hZYMi46QBp+FpuL ugHXXIUVZPFRZ+juCCA7U/TmWcABlJdeyXB72CADtrrGN+vEFEJR4ZQD05Mmcs+K8fV0 xN4i/UX50MI5wdFPwKXXM5aloKn2Y3VaGik3wxQMMT4zyGOeRNgC9KpgxGO6ILMuzDmj yGKw== X-Gm-Message-State: AC+VfDymQdhbg9COXDzsiDCU578lyKoa73XPM7ANgIN/z9g/SJpOA1cj FpCSOQvjHSqlcL4242+kh+Nqig== X-Received: by 2002:a19:ad03:0:b0:4f1:95cf:11eb with SMTP id t3-20020a19ad03000000b004f195cf11ebmr8885802lfc.6.1686765886221; Wed, 14 Jun 2023 11:04:46 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:04:45 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:27 +0200 Subject: [PATCH v6 08/22] interconnect: qcom: Fold smd-rpm.h into icc-rpm.h MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-8-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765872; l=5476; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=YrFfALUF34HtEoPnnGGBWyzkWOZPATnw6OZK7hGMX9k=; b=i+onlZRbHhGSIuVW5e6d00sU+wqGZCffzpEor9WrpC8unbbkrIWqrdnvU2OoGX6KhzAtJRPzt WHSbjTPyM7+AZROcn6j3wRLWiPRlmsMJBXmvNedyv1xeeSNqvJF6Ddt 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768704302693693166?= X-GMAIL-MSGID: =?utf-8?q?1768704302693693166?= smd-rpm.h is not very useful as-is and both files are always included anyway.. Combine them. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 1 - drivers/interconnect/qcom/icc-rpm.h | 5 +++++ drivers/interconnect/qcom/msm8916.c | 1 - drivers/interconnect/qcom/msm8939.c | 1 - drivers/interconnect/qcom/msm8974.c | 2 +- drivers/interconnect/qcom/msm8996.c | 1 - drivers/interconnect/qcom/qcm2290.c | 1 - drivers/interconnect/qcom/qcs404.c | 1 - drivers/interconnect/qcom/sdm660.c | 1 - drivers/interconnect/qcom/smd-rpm.c | 2 +- drivers/interconnect/qcom/smd-rpm.h | 15 --------------- 11 files changed, 7 insertions(+), 24 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 80409f59b2c8..3fdf3962b80d 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -13,7 +13,6 @@ #include #include -#include "smd-rpm.h" #include "icc-common.h" #include "icc-rpm.h" diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index 899e75e8ebaf..4755e422d2d1 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -6,6 +6,8 @@ #ifndef __DRIVERS_INTERCONNECT_QCOM_ICC_RPM_H #define __DRIVERS_INTERCONNECT_QCOM_ICC_RPM_H +#include + #include #include #include @@ -124,4 +126,7 @@ enum qos_mode { int qnoc_probe(struct platform_device *pdev); int qnoc_remove(struct platform_device *pdev); +bool qcom_icc_rpm_smd_available(void); +int qcom_icc_rpm_smd_send(int ctx, int rsc_type, int id, u32 val); + #endif diff --git a/drivers/interconnect/qcom/msm8916.c b/drivers/interconnect/qcom/msm8916.c index 518f4b40ecc2..70b67fbe453f 100644 --- a/drivers/interconnect/qcom/msm8916.c +++ b/drivers/interconnect/qcom/msm8916.c @@ -14,7 +14,6 @@ #include -#include "smd-rpm.h" #include "icc-rpm.h" enum { diff --git a/drivers/interconnect/qcom/msm8939.c b/drivers/interconnect/qcom/msm8939.c index a7398c3c7411..b1005dee4e38 100644 --- a/drivers/interconnect/qcom/msm8939.c +++ b/drivers/interconnect/qcom/msm8939.c @@ -15,7 +15,6 @@ #include -#include "smd-rpm.h" #include "icc-rpm.h" enum { diff --git a/drivers/interconnect/qcom/msm8974.c b/drivers/interconnect/qcom/msm8974.c index 1828deaca443..968162213d40 100644 --- a/drivers/interconnect/qcom/msm8974.c +++ b/drivers/interconnect/qcom/msm8974.c @@ -38,7 +38,7 @@ #include #include -#include "smd-rpm.h" +#include "icc-rpm.h" enum { MSM8974_BIMC_MAS_AMPSS_M0 = 1, diff --git a/drivers/interconnect/qcom/msm8996.c b/drivers/interconnect/qcom/msm8996.c index 733213a0b8c1..b03b1d454a41 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -17,7 +17,6 @@ #include #include "icc-rpm.h" -#include "smd-rpm.h" #include "msm8996.h" static const char * const mm_intf_clocks[] = { diff --git a/drivers/interconnect/qcom/qcm2290.c b/drivers/interconnect/qcom/qcm2290.c index 95ea1f6d25ba..36a53add866d 100644 --- a/drivers/interconnect/qcom/qcm2290.c +++ b/drivers/interconnect/qcom/qcm2290.c @@ -18,7 +18,6 @@ #include #include "icc-rpm.h" -#include "smd-rpm.h" enum { QCM2290_MASTER_APPSS_PROC = 1, diff --git a/drivers/interconnect/qcom/qcs404.c b/drivers/interconnect/qcom/qcs404.c index 9292f8ac01b8..1faec0af74e7 100644 --- a/drivers/interconnect/qcom/qcs404.c +++ b/drivers/interconnect/qcom/qcs404.c @@ -12,7 +12,6 @@ #include -#include "smd-rpm.h" #include "icc-rpm.h" enum { diff --git a/drivers/interconnect/qcom/sdm660.c b/drivers/interconnect/qcom/sdm660.c index 904014a9fd32..e7bd86808f13 100644 --- a/drivers/interconnect/qcom/sdm660.c +++ b/drivers/interconnect/qcom/sdm660.c @@ -16,7 +16,6 @@ #include #include "icc-rpm.h" -#include "smd-rpm.h" enum { SDM660_MASTER_IPA = 1, diff --git a/drivers/interconnect/qcom/smd-rpm.c b/drivers/interconnect/qcom/smd-rpm.c index dc8ff8d133a9..b0183262ba66 100644 --- a/drivers/interconnect/qcom/smd-rpm.c +++ b/drivers/interconnect/qcom/smd-rpm.c @@ -13,7 +13,7 @@ #include #include -#include "smd-rpm.h" +#include "icc-rpm.h" #define RPM_KEY_BW 0x00007762 diff --git a/drivers/interconnect/qcom/smd-rpm.h b/drivers/interconnect/qcom/smd-rpm.h deleted file mode 100644 index ca9d0327b8ac..000000000000 --- a/drivers/interconnect/qcom/smd-rpm.h +++ /dev/null @@ -1,15 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (c) 2019, Linaro Ltd. - * Author: Georgi Djakov - */ - -#ifndef __DRIVERS_INTERCONNECT_QCOM_SMD_RPM_H -#define __DRIVERS_INTERCONNECT_QCOM_SMD_RPM_H - -#include - -bool qcom_icc_rpm_smd_available(void); -int qcom_icc_rpm_smd_send(int ctx, int rsc_type, int id, u32 val); - -#endif From patchwork Wed Jun 14 18:04:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108083 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp136988vqr; Wed, 14 Jun 2023 11:08:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4wdhuH4cpKpHnuW4E8VM1tanZ/0R6gRMo1n4jkmVoMMnIcUXw3e1vhUVA8hUPADbxbMrmp X-Received: by 2002:a17:906:58cf:b0:978:8685:71cd with SMTP id e15-20020a17090658cf00b00978868571cdmr20931194ejs.71.1686766103543; Wed, 14 Jun 2023 11:08:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686766103; cv=none; d=google.com; s=arc-20160816; b=vzaHah3EqcrFjMCfx4Mnbp4W90S84lwBoFp5g0U1ffr3TsjPQ3eprGVAUHYcw2dU6C TFYMfBUfX43B6yJVXCfJ2GAPHB/stA2Rg4tJo16xJKEjnKo2Rj2Fcym4mvklxHH4pnRz EO1dGK4Z4IlH+S3Dgvo6reWb5AA0vGcZtrUfPXwtQtNPIG44mGCCjJbmBDBIu0mzz1+W 1LiaWnWn6WVZrROQoU1TtZ0DOYROy9Nw5pHYvPcLw3w4R2ItQP9ypZBk5kcbBy/aMGOX qakLVEY5hpvOQpkqJKk9RDvUjxvkCF6xTGURsM50gCpDHudVNVNKZ/6xqa0WHd94APqR VCUA== 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=J74hRLqdt4phs0w4W6UJv8aBJOI01g/JO9GJ5bngPB0=; b=sbHk1KlfBi7LiAdER2PHYt5X8mmCOgjBnDhgm8m4VFV4d9Yeh0IR0zLaXfSZ4b98hH Sm0T6/wm1Fpun/r/EedJOuoW5X3uxU3OQUf+qVOPW1u+GzHdQJtXhkV5jCsYQkc9vWjm yMKeemtSVa+pUEVy173y7UtZ8/4b8KRC8/fSQgX1ocZHp5GS11yaLJAu5HZSe+cwAXvs W3Dw8pKlqbTIaKR1wmtGtIGQT/+HZj+sXQWz7yCQbo65Nk9gCOQamAFJkiDz7axX7MgF k1UpFea1bZ4LpO8RQ2W8VL8N6TarrsLphT0oXOSkGMKPnLTQJLmYcSBxuuqEeOaRa3tj /58A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aJft9mlY; 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 jj10-20020a170907984a00b00977d7953e63si8406782ejc.810.2023.06.14.11.07.56; Wed, 14 Jun 2023 11:08:23 -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=aJft9mlY; 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 S233996AbjFNSGI (ORCPT + 99 others); Wed, 14 Jun 2023 14:06:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237061AbjFNSEy (ORCPT ); Wed, 14 Jun 2023 14:04:54 -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 9390A26B7 for ; Wed, 14 Jun 2023 11:04:49 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f649db9b25so9040287e87.0 for ; Wed, 14 Jun 2023 11:04:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765887; x=1689357887; 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=J74hRLqdt4phs0w4W6UJv8aBJOI01g/JO9GJ5bngPB0=; b=aJft9mlYztYXjpqZB04XC1o8/3JEVe7q+IhZdoS04JzIW+Bxccn1JyhO8ucm4r5XAL uaZwuBTyVtvePfl7uvmnhdwjWYjltNEaZXWAYoGwnE6uUsS1fE0GuUYdaQtSrXTcW3/C aGTr6siT1RInQL/SzA9SWuLgrXtrGWeqdqze4jLeE7ootKJEvbX5/gyVfnfDVDTwWssl XgsmnqPcxY5bDPv31w1OZF4PljVoJZScTb2uZkhZYNgnxn5C7KW9K8urUlDFlz/BK55S FrUATfUmSOUYhp3dV9KqOTurOelcv3SelQVL2gmA4NTHfZo8SRXEHXR3axxkWOWOddsb 4lqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765887; x=1689357887; 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=J74hRLqdt4phs0w4W6UJv8aBJOI01g/JO9GJ5bngPB0=; b=Jv6mDGpJ0vjvmRAfyuNj5PhNvvyPuobfxS9XOEji4Jq8Xp5Sp2xNBv6AsP1FT8Rfe/ KcD67uhCa5/vUy5Qc8/ZWks5gaNnxzbM2jNhsrnY/KMCDfqAC5PBosimx/Ton2rDTB5V RMSBajFh/ZnGUwnmeyix8Nr4arEFBgMGKPAj6WT1W90CrNPTdr/73hvHiCzLL9RaXaVF 9PZ9TtwSONAuGhgHwVdAbmnnfREY/RDNc+j70zhLBNx6hCPs9l6urtNJrT1VLYJkawHR 1kAyCfKqD4kLuaJffK6ndusWwunqT2TYp87WVJVQOeXRT6AVrYOOvercpWwT7alGPyo4 z73A== X-Gm-Message-State: AC+VfDw9of+AslJfGZvq6kb/RDUZ4eKAZfgVzic5H8JpAX0hOT7ndB/G H/5f/HZuf2lVKdcZXnaQDoK+nA== X-Received: by 2002:ac2:5bca:0:b0:4f6:2c03:36b0 with SMTP id u10-20020ac25bca000000b004f62c0336b0mr8039232lfn.26.1686765887589; Wed, 14 Jun 2023 11:04:47 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:04:47 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:28 +0200 Subject: [PATCH v6 09/22] interconnect: qcom: smd-rpm: Add rpmcc handling skeleton code MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-9-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Stephan Gerhold X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765872; l=3261; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=q5JnbdD4AZQp53PuMKdCoeW41i5whKLsOXgMlTL64nI=; b=tafWmjRtwf+e8Suf9DtjEJQCeY2j9wH0XotnHZCko9vHv9bf1sFuh7Y6XEwih31jHwJBEwxj7 1YIhEZFvBEFBgMODgZ+3PcSoWUMdJFrrlfVNP304vDARdlVQ3THNzVG 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768702453432908211?= X-GMAIL-MSGID: =?utf-8?q?1768702453432908211?= Introduce qcom_icc_rpm_set_bus_rate() in preparation for handling RPM clock resources within the interconnect framework. This lets us greatly simplify all of the code handling, as setting the rate comes down to: u32 rate_khz = max(clk.sleep_rate, clk.active_rate, clk_a.active_rate) write_to_rpm(clock.description, rate_khz); Reviewed-by: Stephan Gerhold Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.h | 15 +++++++++++++++ drivers/interconnect/qcom/smd-rpm.c | 21 +++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index 4755e422d2d1..5c43a8023ffa 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -25,6 +25,18 @@ enum qcom_icc_type { QCOM_ICC_QNOC, }; +/** + * struct rpm_clk_resource - RPM bus clock resource + * @resource_type: RPM resource type of the clock resource + * @clock_id: index of the clock resource of a specific resource type + * @branch: whether the resource represents a branch clock +*/ +struct rpm_clk_resource { + u32 resource_type; + u32 clock_id; + bool branch; +}; + #define NUM_BUS_CLKS 2 /** @@ -50,6 +62,7 @@ struct qcom_icc_provider { unsigned int qos_offset; u64 bus_clk_rate[NUM_BUS_CLKS]; struct clk_bulk_data bus_clks[NUM_BUS_CLKS]; + const struct rpm_clk_resource *bus_clk_desc; struct clk_bulk_data *intf_clks; bool keep_alive; bool is_on; @@ -107,6 +120,7 @@ struct qcom_icc_desc { struct qcom_icc_node * const *nodes; size_t num_nodes; const char * const *bus_clocks; + const struct rpm_clk_resource *bus_clk_desc; const char * const *intf_clocks; size_t num_intf_clocks; bool keep_alive; @@ -128,5 +142,6 @@ int qnoc_remove(struct platform_device *pdev); bool qcom_icc_rpm_smd_available(void); int qcom_icc_rpm_smd_send(int ctx, int rsc_type, int id, u32 val); +int qcom_icc_rpm_set_bus_rate(const struct rpm_clk_resource *clk, int ctx, u32 rate); #endif diff --git a/drivers/interconnect/qcom/smd-rpm.c b/drivers/interconnect/qcom/smd-rpm.c index b0183262ba66..24bc994e1a12 100644 --- a/drivers/interconnect/qcom/smd-rpm.c +++ b/drivers/interconnect/qcom/smd-rpm.c @@ -16,6 +16,7 @@ #include "icc-rpm.h" #define RPM_KEY_BW 0x00007762 +#define QCOM_RPM_SMD_KEY_RATE 0x007a484b static struct qcom_smd_rpm *icc_smd_rpm; @@ -44,6 +45,26 @@ int qcom_icc_rpm_smd_send(int ctx, int rsc_type, int id, u32 val) } EXPORT_SYMBOL_GPL(qcom_icc_rpm_smd_send); +int qcom_icc_rpm_set_bus_rate(const struct rpm_clk_resource *clk, int ctx, u32 rate) +{ + struct clk_smd_rpm_req req = { + .key = cpu_to_le32(QCOM_RPM_SMD_KEY_RATE), + .nbytes = cpu_to_le32(sizeof(u32)), + }; + + /* Branch clocks are only on/off */ + if (clk->branch) + rate = !!rate; + + req.value = cpu_to_le32(rate); + return qcom_rpm_smd_write(icc_smd_rpm, + ctx, + clk->resource_type, + clk->clock_id, + &req, sizeof(req)); +} +EXPORT_SYMBOL_GPL(qcom_icc_rpm_set_bus_rate); + static int qcom_icc_rpm_smd_remove(struct platform_device *pdev) { icc_smd_rpm = NULL; From patchwork Wed Jun 14 18:04:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108111 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp154909vqr; Wed, 14 Jun 2023 11:43:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5DF5eHyapzQ99xqWKvc4wIQVJCbCSF4rsRQSFh4fwXMKnenkCLCvk2i5ckccOVWGYsqSDL X-Received: by 2002:a17:903:244e:b0:1b3:c7c7:74ae with SMTP id l14-20020a170903244e00b001b3c7c774aemr10759437pls.45.1686768189481; Wed, 14 Jun 2023 11:43:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686768189; cv=none; d=google.com; s=arc-20160816; b=Fw3xOIhOCSYoW7NUyuypsjpes3jYNbp94QLwhoLsags+CaBIicm/86dqZ8FS5fveL7 gPdjXrXBtWBNNZ1h5/04Cl85Lej+ktaMlhxYc2jS61CVk31gXCuQgAX/VRGE/VKsqkGj CdRRZVIOrGFnoLnzUvUQHh1s7i+JkfmoBn0IPYs+P5kR2eA1JwL/nNhzcpBQ0RTU15Oi io4blS7n4I+GpSffM4BKioYM+tUb6aAMM0emckUkec8wvX3PCVf3kfCjmVJEViF/XVVm 3eMbLp7xAXOKDpNimiFYTm3zsHGnjiax/Y2KLHIym5/yg7W2bByPYagkLiJXRHb45oOF UNLQ== 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=Hw4WRawxs1UeInGhZDq9K62HhD6piBeFrd3LBHFgURY=; b=esXr0zzphNLAyqlnSr1tPOk9wybYTyfyU/upw0mOB8gNXqhBxGuJu8T5Qow920QT6i WRove4HlKHLY+bg/RMrFilNl/mOjGNMLXbNd5nFW7XWKOxaPYzwbnQGh5d5TkeIpEtlU HyYPwKaawgVVVLDgAAlZQIxkyMG+OR4hVovs/ybSC11a8YUQ3Fp0fW4wauDndP6c9jOG mZJ12brfdkz97nt8gp7nY9iXibxna9uTgqRrA+kkgp2m2dEGQThCb0RaFUs6jG8EFzsx C2zNMpMeGlemb1UYoNZnYNmzE6SjxTsm/BA7J0VNhOz/G6xXAwGK7NDGm5hw8BdMkTE/ /Azg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pbYsJNTM; 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 e4-20020a170902e0c400b001a52db202c7si1306229pla.382.2023.06.14.11.42.54; Wed, 14 Jun 2023 11:43:09 -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=pbYsJNTM; 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 S237085AbjFNSGL (ORCPT + 99 others); Wed, 14 Jun 2023 14:06:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239942AbjFNSE4 (ORCPT ); Wed, 14 Jun 2023 14:04:56 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26A1A2682 for ; Wed, 14 Jun 2023 11:04:51 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4f7deee339dso339460e87.0 for ; Wed, 14 Jun 2023 11:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765889; x=1689357889; 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=Hw4WRawxs1UeInGhZDq9K62HhD6piBeFrd3LBHFgURY=; b=pbYsJNTMQ3iR6kEkTpcBcb+UBfk2mkKoM/yYugH7xUPXJEwhTh7Mj944P7qIkVh2Hj jwA4zNW+QEx+j7jsn9nX7+iocdQNYq3EZDpPjzRhHEZ2r1G+0EERithXjVroBKrDOmnY Vss/IDYquOv1b9P1grInln+HdMGZZVL/2Z83SpoB7PJnBomb4h3v6avqvmmqD732E3rs +KzGIZyR21ttBKm5lfk9pnlAm0ct7splb3CaD44aGYUyBNlr8kQvwjxKMdbNZd/4OvZR XfujlS1i/h4rer0j2yUBbZ9jmKio5QcIhP96lrqeJ+94bRlqhRNALOLKNLPqe0Rq40ln xUcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765889; x=1689357889; 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=Hw4WRawxs1UeInGhZDq9K62HhD6piBeFrd3LBHFgURY=; b=jvEb+FJAyLObICVc/2yUB0sa5gLCGNDI80zwUXD0tbMZP3bstH38If4BbfDj12w5Bz zyUlKIg9/RfCghYfy0msMvmvBoB74J9dvfQYNQQRa0y0BgC1qMJLsve023zxrgHKoi/E 3f9zpBTGGnrE13cl/maISzx05Rb3vAePvwTpuUhjp3tiItCWbEucEjtnBjM8OO1xQc02 oJJgZQ5Pxr9llxO2A9Ip3Vz7+gP7HD/30vgMsyrDSTmRRv/QbhfQ08uOWOPeqhh9codS 1rtpmZc4+jeF7TpdK6bNk+kZ6MaO0CW7XGo1tT6NHfLFJ9Mqw76PLXljRt/MPVsQj5Us LXkA== X-Gm-Message-State: AC+VfDxqnsOSZFiZ6xB8IUzELj5qluHQhNAPhqH8ss9MJJtGY8z5DCQB myqY+GV7jr2BPtXvqhS2wFAsJg== X-Received: by 2002:ac2:5b91:0:b0:4f6:14d1:5967 with SMTP id o17-20020ac25b91000000b004f614d15967mr7801175lfn.61.1686765889340; Wed, 14 Jun 2023 11:04:49 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:04:49 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:29 +0200 Subject: [PATCH v6 10/22] interconnect: qcom: Define RPM bus clocks MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-10-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765872; l=4129; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=R3Hln5kTqJLo0KxW3WBSL1gR8+B0i+HAtxkzQwO6Pts=; b=ysKIixDFpTluliq5pwu676opWfqMJ2lADTjj2uk9IeIs2mDdxdvz460SAWAD4CaWPV29zQ0Wj xR7D6va7REuAlY7On5IrJj7ldldbDrj4dF3JD5OU9tInrgar5ovXoEy 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768704641463867255?= X-GMAIL-MSGID: =?utf-8?q?1768704641463867255?= Add the definitions for RPM bus clocks that will be used by many different platforms. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/Makefile | 2 +- drivers/interconnect/qcom/icc-rpm-clocks.c | 77 ++++++++++++++++++++++++++++++ drivers/interconnect/qcom/icc-rpm.h | 13 +++++ 3 files changed, 91 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/qcom/Makefile b/drivers/interconnect/qcom/Makefile index ab988926433c..80d9d2da95d1 100644 --- a/drivers/interconnect/qcom/Makefile +++ b/drivers/interconnect/qcom/Makefile @@ -29,7 +29,7 @@ qnoc-sm8250-objs := sm8250.o qnoc-sm8350-objs := sm8350.o qnoc-sm8450-objs := sm8450.o qnoc-sm8550-objs := sm8550.o -icc-smd-rpm-objs := smd-rpm.o icc-rpm.o +icc-smd-rpm-objs := smd-rpm.o icc-rpm.o icc-rpm-clocks.o obj-$(CONFIG_INTERCONNECT_QCOM_BCM_VOTER) += icc-bcm-voter.o obj-$(CONFIG_INTERCONNECT_QCOM_MSM8916) += qnoc-msm8916.o diff --git a/drivers/interconnect/qcom/icc-rpm-clocks.c b/drivers/interconnect/qcom/icc-rpm-clocks.c new file mode 100644 index 000000000000..63c82a91bbc7 --- /dev/null +++ b/drivers/interconnect/qcom/icc-rpm-clocks.c @@ -0,0 +1,77 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2023 Linaro Ltd + */ + +#include + +#include "icc-rpm.h" + +const struct rpm_clk_resource aggre1_clk = { + .resource_type = QCOM_SMD_RPM_AGGR_CLK, + .clock_id = 1, +}; +EXPORT_SYMBOL_GPL(aggre1_clk); + +const struct rpm_clk_resource aggre2_clk = { + .resource_type = QCOM_SMD_RPM_AGGR_CLK, + .clock_id = 2, +}; +EXPORT_SYMBOL_GPL(aggre2_clk); + +const struct rpm_clk_resource bimc_clk = { + .resource_type = QCOM_SMD_RPM_MEM_CLK, + .clock_id = 0, +}; +EXPORT_SYMBOL_GPL(bimc_clk); + +const struct rpm_clk_resource bus_0_clk = { + .resource_type = QCOM_SMD_RPM_BUS_CLK, + .clock_id = 0, +}; +EXPORT_SYMBOL_GPL(bus_0_clk); + +const struct rpm_clk_resource bus_1_clk = { + .resource_type = QCOM_SMD_RPM_BUS_CLK, + .clock_id = 1, +}; +EXPORT_SYMBOL_GPL(bus_1_clk); + +const struct rpm_clk_resource bus_2_clk = { + .resource_type = QCOM_SMD_RPM_BUS_CLK, + .clock_id = 2, +}; +EXPORT_SYMBOL_GPL(bus_2_clk); + +const struct rpm_clk_resource mmaxi_0_clk = { + .resource_type = QCOM_SMD_RPM_MMAXI_CLK, + .clock_id = 0, +}; +EXPORT_SYMBOL_GPL(mmaxi_0_clk); + +const struct rpm_clk_resource mmaxi_1_clk = { + .resource_type = QCOM_SMD_RPM_MMAXI_CLK, + .clock_id = 1, +}; +EXPORT_SYMBOL_GPL(mmaxi_1_clk); + +const struct rpm_clk_resource qup_clk = { + .resource_type = QCOM_SMD_RPM_QUP_CLK, + .clock_id = 0, +}; +EXPORT_SYMBOL_GPL(qup_clk); + +/* Branch clocks */ +const struct rpm_clk_resource aggre1_branch_clk = { + .resource_type = QCOM_SMD_RPM_AGGR_CLK, + .clock_id = 1, + .branch = true, +}; +EXPORT_SYMBOL_GPL(aggre1_branch_clk); + +const struct rpm_clk_resource aggre2_branch_clk = { + .resource_type = QCOM_SMD_RPM_AGGR_CLK, + .clock_id = 2, + .branch = true, +}; +EXPORT_SYMBOL_GPL(aggre2_branch_clk); diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index 5c43a8023ffa..ecd6104335a7 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -137,6 +137,19 @@ enum qos_mode { NOC_QOS_MODE_BYPASS, }; +extern const struct rpm_clk_resource aggre1_clk; +extern const struct rpm_clk_resource aggre2_clk; +extern const struct rpm_clk_resource bimc_clk; +extern const struct rpm_clk_resource bus_0_clk; +extern const struct rpm_clk_resource bus_1_clk; +extern const struct rpm_clk_resource bus_2_clk; +extern const struct rpm_clk_resource mmaxi_0_clk; +extern const struct rpm_clk_resource mmaxi_1_clk; +extern const struct rpm_clk_resource qup_clk; + +extern const struct rpm_clk_resource aggre1_branch_clk; +extern const struct rpm_clk_resource aggre2_branch_clk; + int qnoc_probe(struct platform_device *pdev); int qnoc_remove(struct platform_device *pdev); From patchwork Wed Jun 14 18:04:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108101 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp153736vqr; Wed, 14 Jun 2023 11:40:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5IndDL0r9m67kq1RyWdAAqKJZphvd+Dx8ZWQlcNVPyCUqzm7p8EqudM5oXW0vRucIrMpUU X-Received: by 2002:a05:6a20:e193:b0:106:4197:b7ff with SMTP id ks19-20020a056a20e19300b001064197b7ffmr1790823pzb.30.1686768030337; Wed, 14 Jun 2023 11:40:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686768030; cv=none; d=google.com; s=arc-20160816; b=QC3J2FB5AA05MBnw+4TBUnXeDAWebfqPeBVqMObU1TVbCdvGHg780M9EerA7wvEyN3 vO8WV2s1kgARy+APo7cwfVncPw9F+6Hk3ketBF27F0TIDoOI1LlkYPsyaCJCIzKG7vX7 3ZUEpNyim5mxV+WLYNEN2hyPQ6kx3+BFxCP9OgbFdEyTvDfS0Qn71XIEXu5cvpIDoFzH a1ajuD4qM6odFa+iYKexoYNG1n2X3WHscmRnfrKv5i/ScPPOPI2miwH96dsRiAsiyrkD 8iOziCDssftIPu0DfZMxC3Fm1OhWpNGox4soHysFTRbkTI8zEJs4N216HDEsJDQuY6TU 4M/Q== 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=gMhyB/RpDb2yjDqD1QrZgIdZflFbKzp97wvcFuesnD0=; b=Cjjmo+maW8M0PLd4eS/9+DBNkA5u/U8/2eAjBFUcK4b80do/J3FeCzRa9+XGDDigv/ +9PfZgIKoi2AUb0SBf7Q3OpmiYxQisnPJkmvqYOvJ1o99pQo3xwSezAGbs/+BbAvdUcL Ue+uFayJMvv/PegLIkWYn3iaewYWDGkNG4t1SvuU/ci0WpzW3/7rSwXAROwNvatP2vii EULQ3Kl3Jn9VvT0k/0divoYz9LTEBSHtxNsN8S36HA75CzELJo7r7k2dmWfCpscVELFe VoH+hmDiytgIKXjfqztEYewYvzNhh1JsYmU8BA/gEicuioTzHXpAe+0KsoMWTa5HBlYw jROw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=upPlIKm+; 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 f16-20020a635110000000b0053477896e81si8738219pgb.187.2023.06.14.11.40.17; Wed, 14 Jun 2023 11:40:30 -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=upPlIKm+; 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 S240847AbjFNSGR (ORCPT + 99 others); Wed, 14 Jun 2023 14:06:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240329AbjFNSE5 (ORCPT ); Wed, 14 Jun 2023 14:04:57 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 840F12116 for ; Wed, 14 Jun 2023 11:04:52 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-4f655293a38so8762100e87.0 for ; Wed, 14 Jun 2023 11:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765891; x=1689357891; 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=gMhyB/RpDb2yjDqD1QrZgIdZflFbKzp97wvcFuesnD0=; b=upPlIKm+tolcMQ5+qZfqpv6jWmH3EHe8ralpHU4jSNkDBY2zjYM7ZFWFFAJMLXW+/6 jbVEGjkGykFNWJCC4er3hUu3eVJ81Q3nv1XAJbwhfaA5Pc7zMKpQcev2F0baxkRSun6P 17PNsX7CE5Kk0EtZLm2WiN1hwvShL4m0qFUYNfJbRTU5NJcbtSuZFCmSwmGX7DztNjhf AugnmUvfDNumbM/elMa4rZvLKhPmO7VA271tIwd4T7MogPd8s51+SGA+1aOQj7CmLZ0B Zf1ntsb8IY/YtlR498JgbWD+JnOJew2Ul7kfu3beRN0GxjRYchOdaT0ZlNsXC4WyYk0b 0C3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765891; x=1689357891; 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=gMhyB/RpDb2yjDqD1QrZgIdZflFbKzp97wvcFuesnD0=; b=KSh/2VDf94wBvmAZ5dbaZZN/t8zK2FW+KMK4mNDgLohxFBIOHUG6EyU95ushvtK3oC Ce+ObFw/02nhcBelj1ZS8b6/j1ikc3DiH4TkITxtdCfz7KsLFGWxuVrbtTIZufO73QaL eohPBq79ttG5iqaQaKF6c9U8IC8vnXIIMv4LVBq3gCIgDgo0Ze047OWYktVvpFL0Js0q SDDMIVGz5lo4AqiqexwRpDW6OMWArITNHLbTek3xaawYMh47ucD/aMp1KaoWemGxxXRZ 2AjGq22ALSI8rsx7KHe7WEDMrKm6h3Na1cklpsKGPlUYe2u6lJaWBYnHJYUUVTRVm9lb q0gg== X-Gm-Message-State: AC+VfDwxDcSEgbbFx4eGMUrGCP/6SwbX6k3v+U5jB8m1BqpOPQHOtS9V 1a2fD+0hgTFktZxgaf1pGDw3mA== X-Received: by 2002:ac2:46ec:0:b0:4f3:a820:dd98 with SMTP id q12-20020ac246ec000000b004f3a820dd98mr8963435lfo.7.1686765890842; Wed, 14 Jun 2023 11:04:50 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:04:50 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:30 +0200 Subject: [PATCH v6 11/22] interconnect: qcom: sdm660: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-11-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765872; l=1986; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=xMlMRTkT4oZ3O3DhlrRW9yoPIGqYk7SOo/vjpjmWPac=; b=H5234cvJ6NDXbJ3laLRNvGm0U7WrBzqr6vGHOzp9t+WHv7ao+g6ma5IyvYB0Dk0vC/iE/Pbx6 BjbVHAEfGJmAWBaFORV2nK1oqGr+DBtBi8W2YzmiSq2rQLK1aHyJaRy 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768704474402331206?= X-GMAIL-MSGID: =?utf-8?q?1768704474402331206?= Assign the necessary definitions to migrate to the new bus clock handling mechanism. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/sdm660.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/interconnect/qcom/sdm660.c b/drivers/interconnect/qcom/sdm660.c index e7bd86808f13..ad5d52af7eab 100644 --- a/drivers/interconnect/qcom/sdm660.c +++ b/drivers/interconnect/qcom/sdm660.c @@ -1510,6 +1510,7 @@ static const struct qcom_icc_desc sdm660_a2noc = { .type = QCOM_ICC_NOC, .nodes = sdm660_a2noc_nodes, .num_nodes = ARRAY_SIZE(sdm660_a2noc_nodes), + .bus_clk_desc = &aggre2_clk, .intf_clocks = a2noc_intf_clocks, .num_intf_clocks = ARRAY_SIZE(a2noc_intf_clocks), .regmap_cfg = &sdm660_a2noc_regmap_config, @@ -1538,6 +1539,7 @@ static const struct qcom_icc_desc sdm660_bimc = { .type = QCOM_ICC_BIMC, .nodes = sdm660_bimc_nodes, .num_nodes = ARRAY_SIZE(sdm660_bimc_nodes), + .bus_clk_desc = &bimc_clk, .regmap_cfg = &sdm660_bimc_regmap_config, }; @@ -1592,6 +1594,7 @@ static const struct qcom_icc_desc sdm660_cnoc = { .type = QCOM_ICC_NOC, .nodes = sdm660_cnoc_nodes, .num_nodes = ARRAY_SIZE(sdm660_cnoc_nodes), + .bus_clk_desc = &bus_2_clk, .regmap_cfg = &sdm660_cnoc_regmap_config, }; @@ -1654,6 +1657,7 @@ static const struct qcom_icc_desc sdm660_mnoc = { .type = QCOM_ICC_NOC, .nodes = sdm660_mnoc_nodes, .num_nodes = ARRAY_SIZE(sdm660_mnoc_nodes), + .bus_clk_desc = &mmaxi_0_clk, .intf_clocks = mm_intf_clocks, .num_intf_clocks = ARRAY_SIZE(mm_intf_clocks), .regmap_cfg = &sdm660_mnoc_regmap_config, @@ -1691,6 +1695,7 @@ static const struct qcom_icc_desc sdm660_snoc = { .type = QCOM_ICC_NOC, .nodes = sdm660_snoc_nodes, .num_nodes = ARRAY_SIZE(sdm660_snoc_nodes), + .bus_clk_desc = &bus_1_clk, .regmap_cfg = &sdm660_snoc_regmap_config, }; From patchwork Wed Jun 14 18:04:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108085 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp137110vqr; Wed, 14 Jun 2023 11:08:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7IP3y3oHUgltkZp4zRphajMp09zvT+yMY1W8aCr03KIBrlle/xQGpWEBYAKVmT4eEmS/zA X-Received: by 2002:a17:907:60d0:b0:978:7262:d125 with SMTP id hv16-20020a17090760d000b009787262d125mr19480439ejc.76.1686766114340; Wed, 14 Jun 2023 11:08:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686766114; cv=none; d=google.com; s=arc-20160816; b=fyiWfDwF2ZOjtx6dv7SJlKquG+4Ydd2F1Qcb7Cw7CbTM10PdokKxQPlbAdtBQWb0Y2 t3/wa8MjlEEUui5mDycvsMpEdzQJd7ViXX0spij7fjrxp3X3wCHJoE7/sVeD14oL3TYf l18aT+mxupzUEWPsYhS42fq7PoG2FkTjEqAAcr9xg7GhcXfYh28syKywDxeyJdmJaqhB O2FPUShIe42jW2HvVeUN8yTxb26A0tyNFdLmK5tMQPauTVhOqx4Zx8s0g99Bzdrdqmos Dhqckk0ZeThOgTgZfVsOGeiWXwVMzSF3fpPdqyApqAqRVFakMNi6UNF8YJFsbtSKOYZT Z8WA== 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=AGw2C5vkxiY4wctjycR/LXyEjdyTIKRRhbkUxP7hBTM=; b=GKFaVi3fyCZJf+Pmkwo1YyvtS2EfgpztH1YgXnP9btgIPYGnmL1b2tIoN0bDApfNMD T/I3kJmGekq5SP5S65Gtwp43JBl/DLWTrkwyfz9OogwWjcQfRjhhWGgm5SvCUe/l/xj8 e3QZDexS0Ol4wW4pZXk4gxwemFr57zXWgtKeG3i4ugPLvKCKHz+gALvs8dKiV549e60m I/iVtDFUmgRIlI4pNJHzyhChUOPxPk1SNK+kP3KgI31IImyt3CO0dXsyd16bPhjoljS7 4qLtz/VylCd5MtEwudAL2SZ6ZiNmOzY+CGqH0BAfSl7B5VJRbvlUP3ECqDbW8CewjgPM szcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BvWUFQOM; 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 rn26-20020a170906d93a00b0096637b27352si8498843ejb.52.2023.06.14.11.08.09; Wed, 14 Jun 2023 11:08:34 -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=BvWUFQOM; 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 S240329AbjFNSGX (ORCPT + 99 others); Wed, 14 Jun 2023 14:06:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240414AbjFNSE6 (ORCPT ); Wed, 14 Jun 2023 14:04:58 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35478211D for ; Wed, 14 Jun 2023 11:04:54 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4f62b552751so9127947e87.3 for ; Wed, 14 Jun 2023 11:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765892; x=1689357892; 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=AGw2C5vkxiY4wctjycR/LXyEjdyTIKRRhbkUxP7hBTM=; b=BvWUFQOMwUAw+799RcIFhdkQkYEA6nhpj5raefBstGMyuak6gmzcmsnn7Gs7VRS/xN hXU10yT6epQMsBmGM8xeAbxkWYOz9lweVMKqiMsN5o3OydSoSCFILVnAJof9Ahbjwxra edk/x1FR4RACuMenE258Kq2Gp0/PdBWoPkXbseB00DNkF102wKxUfb1dQIYfnTUTLi/g XhIeLO4sJdItbLUefu4IiPNy1feqntFYkAiFqVeraPY8S4ZelHcGqmudTw3kyeGJDAao OPWS+kjgfXPB7NUxuw1vMndBAfyMnJ9C3OE5kCMaOws3oILhmpsIBqK+7sTN68W330Lo YQfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765892; x=1689357892; 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=AGw2C5vkxiY4wctjycR/LXyEjdyTIKRRhbkUxP7hBTM=; b=WAxqOUNA85rUsQ/VrxzKRhBPaQ5EqeSjVEY6Ol61pKfEgL6ftdJukdlX/6sWEelyZ+ Xq+/LeOhDwdbHzyvfDq7jp2Y/I8cXt1Prn/p5584/kPKqLf0JKLWODI+P2fZrbTqf6aT zCJ67t5EXnGPhd9jVddyph7Z2eHkaAcD1ptiMTb6WJcDGlmHWyQlGOpJ7iiU0xRfRrEy Oow/rVOwGdSrZoj4uJWeN7YcqkHYrq4crSg+IYi51jaHXit/TWJ8Necss9PqTWNdBGLx 2SGv7ifxULkzW3b1TsUQ1ZGqnjdavgbQeT6Jgh5kIlHhMKEL6UhWu32PX0YYL73+K+xr cNqw== X-Gm-Message-State: AC+VfDyTHLZoCGg9noYPDnuO1gFGhpSsty2bzWFL+FzVlGmo8X1GNZys AQsQunGhh0l2SOXTJ5f2bHiRkQ== X-Received: by 2002:a19:7915:0:b0:4f6:13f1:38a4 with SMTP id u21-20020a197915000000b004f613f138a4mr7924026lfc.41.1686765892390; Wed, 14 Jun 2023 11:04:52 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:04:52 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:31 +0200 Subject: [PATCH v6 12/22] interconnect: qcom: msm8996: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-12-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765872; l=2380; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=4G5XsIopPXChuGS66XojsbOsXrnNNj++E+3+a47uogk=; b=y/PW+xEjCSkoU+i8wWXoJLlt1BYerNuvA5JwKj+8SQKFX1QQ4dcxvKpaWzV2BHKtLj7aDZFFR 5fDHwfBfAakByzyoCP94VKOsuHq8wVPt+aWkgU8NRGL+APp+A5qgDfF 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768702465570300404?= X-GMAIL-MSGID: =?utf-8?q?1768702465570300404?= Assign the necessary definitions to migrate to the new bus clock handling mechanism. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/msm8996.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/interconnect/qcom/msm8996.c b/drivers/interconnect/qcom/msm8996.c index b03b1d454a41..42722681b4ce 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -1839,6 +1839,7 @@ static const struct qcom_icc_desc msm8996_a1noc = { .type = QCOM_ICC_NOC, .nodes = a1noc_nodes, .num_nodes = ARRAY_SIZE(a1noc_nodes), + .bus_clk_desc = &aggre1_branch_clk, .regmap_cfg = &msm8996_a1noc_regmap_config }; @@ -1860,6 +1861,7 @@ static const struct qcom_icc_desc msm8996_a2noc = { .type = QCOM_ICC_NOC, .nodes = a2noc_nodes, .num_nodes = ARRAY_SIZE(a2noc_nodes), + .bus_clk_desc = &aggre2_branch_clk, .intf_clocks = a2noc_intf_clocks, .num_intf_clocks = ARRAY_SIZE(a2noc_intf_clocks), .regmap_cfg = &msm8996_a2noc_regmap_config @@ -1888,6 +1890,7 @@ static const struct qcom_icc_desc msm8996_bimc = { .type = QCOM_ICC_BIMC, .nodes = bimc_nodes, .num_nodes = ARRAY_SIZE(bimc_nodes), + .bus_clk_desc = &bimc_clk, .regmap_cfg = &msm8996_bimc_regmap_config }; @@ -1946,6 +1949,7 @@ static const struct qcom_icc_desc msm8996_cnoc = { .type = QCOM_ICC_NOC, .nodes = cnoc_nodes, .num_nodes = ARRAY_SIZE(cnoc_nodes), + .bus_clk_desc = &bus_2_clk, .regmap_cfg = &msm8996_cnoc_regmap_config }; @@ -1999,6 +2003,7 @@ static const struct qcom_icc_desc msm8996_mnoc = { .type = QCOM_ICC_NOC, .nodes = mnoc_nodes, .num_nodes = ARRAY_SIZE(mnoc_nodes), + .bus_clk_desc = &mmaxi_0_clk, .intf_clocks = mm_intf_clocks, .num_intf_clocks = ARRAY_SIZE(mm_intf_clocks), .regmap_cfg = &msm8996_mnoc_regmap_config @@ -2037,6 +2042,7 @@ static const struct qcom_icc_desc msm8996_pnoc = { .type = QCOM_ICC_NOC, .nodes = pnoc_nodes, .num_nodes = ARRAY_SIZE(pnoc_nodes), + .bus_clk_desc = &bus_0_clk, .regmap_cfg = &msm8996_pnoc_regmap_config }; @@ -2081,6 +2087,7 @@ static const struct qcom_icc_desc msm8996_snoc = { .type = QCOM_ICC_NOC, .nodes = snoc_nodes, .num_nodes = ARRAY_SIZE(snoc_nodes), + .bus_clk_desc = &bus_1_clk, .regmap_cfg = &msm8996_snoc_regmap_config }; From patchwork Wed Jun 14 18:04:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108087 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp137175vqr; Wed, 14 Jun 2023 11:08:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6JdkiS4W6/HfEpsw/o3SQSNDvVxoNAe9R9lQQtGxjlAQiaHJyU0hKT4vw0xIzar/AVJBXr X-Received: by 2002:a17:907:9806:b0:94f:5847:8ac with SMTP id ji6-20020a170907980600b0094f584708acmr19852523ejc.51.1686766120941; Wed, 14 Jun 2023 11:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686766120; cv=none; d=google.com; s=arc-20160816; b=0yHK6nTE2lCOYm+Vf0N+OrV3vaIe9hWR/TnkoA+Gl+Q9ck8SO8UGC3p4LVwzxvOfT4 29jUK+bMYA5qnnDk01RNfm/zXmEY1cOBWEjxaytbP39IN4H5FVm2pItU3X7fdYqSdx3X q61barnInaY8WCOdZCGkmGVeDYy4puzLZ97HkDsJ2fGeIL37pIpdvauKgm6BBWunCLkW ssVsFtH7kPfuyYWIXgp9mD4kVWDkAZZw1JKIPN0ws1bwfQPOHi0XxD3KKfF5YdyqEyaw kVE9CLyP8az/ukiKrLBb1Qg5El8qNj/Du7BSeM/6Q4iGgo5X5t4h2/+Nj2kNo4EflWVq 23BA== 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=KhmMqJgELFXlAh9h3uttQVzjp1sKHmXWUeh3OQH1oaw=; b=qivo/jj2+hiL4gFMVbsdrkRODtjKHW2RNSTakjybAWMp4F++1tRdBFc/+LLSEGnPur mlZta4KtZzf2TqYM24ZjevZkxPR54Z3P7DCK0ZPXyK2OJM27+YBr9daRL4XAnNuQtuDA cDr4UEZQrOsUpGefX4xDAAyUxGJZc9bbtad08JeC7Gm5JmoJDvhG/jMr3XLbbuA5tRkr 6MxEw8DKnJio15JaGKdiUU3Kp3iyWHSADze/ipQQNOO8QAjeG4XW6djlUWw8XQhTkfCu woYtuuTCzBlVOizPNFM1HsiweYD0uOd4u7Nrhgk+NcWbXwM3kVW1grmrt6wSU7b3tg4f kxoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Pi+e/0Jb"; 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 h20-20020a17090619d400b0096f8ec3d764si8637289ejd.914.2023.06.14.11.08.15; Wed, 14 Jun 2023 11:08:40 -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="Pi+e/0Jb"; 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 S241407AbjFNSG2 (ORCPT + 99 others); Wed, 14 Jun 2023 14:06:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240742AbjFNSFB (ORCPT ); Wed, 14 Jun 2023 14:05:01 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6B732689 for ; Wed, 14 Jun 2023 11:04:55 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f76a4c211dso992930e87.3 for ; Wed, 14 Jun 2023 11:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765893; x=1689357893; 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=KhmMqJgELFXlAh9h3uttQVzjp1sKHmXWUeh3OQH1oaw=; b=Pi+e/0JbEBc6rc9x2oF6ycpVpx+yrCqjvYDiE105zydnRh1JAq00FZBCItzHPjlSLB sl22fSXnSGFb3XoARQeRkxBR9ykrDtwGkMSa5f6yq7c3KIvBWRSZxwD8UTIgEVgZbOeZ CrWuWsxhaMemy+KSBMOlBTaqyN2MBIMUsIYPkSbjz8ggq0+xGXXH8CmgRWshxKdWGvm7 ewaF/kKiAgBr/6Gg3RGHXrag2PQN2v2RxdFQUWHuwdAw1NWsr51Vg1FM3c0cRpgZBzjw EpM9lcMpv63/9e0eRShZZJHW0mOv7GgJEVvBcKYun7+A6V9SUsV0lT91tMN8uQjZL1Oo pFnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765893; x=1689357893; 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=KhmMqJgELFXlAh9h3uttQVzjp1sKHmXWUeh3OQH1oaw=; b=WUu02zoy9bJGFZHmMEo83sEAbj4H2IS0cgFP/2Z5y2PEgUgb5HdLpFqpZbVdeVMDk4 Q3lZZq5/V7sKPHN4udk2tyBVLre1pCnGjqrQGAhyX2dBaoaGpJ54QotKfww9LMUnznbr rcLG/2/HQvjRRcwlq2t9eCexL0/VVnOWFgENw/1rA6HeraUmI33nJ7dvG8a/A7GHEzbB M3CcrfkVs/g9G/VeTBRFFahAQBSvqtsGX14QwUOmrzOC2pnr+GlwlUxkHPMzUcbzg8bv YrG0kJIRyfuKbYs/IbLXZeAPTrmRGPF7/cDP6yWxGux/zGu0hODiLo8dfdcGyi9hDgnd gbBA== X-Gm-Message-State: AC+VfDy+bD05a6F4W/5SVAH9kk6DFt9QSHEu1MCzZXEluC9NKFS4TtdU e8zhQKSM40VkChdmUTFiw6szfg== X-Received: by 2002:ac2:5b11:0:b0:4f1:30cc:3dae with SMTP id v17-20020ac25b11000000b004f130cc3daemr11180460lfn.10.1686765893783; Wed, 14 Jun 2023 11:04:53 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:04:53 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:32 +0200 Subject: [PATCH v6 13/22] interconnect: qcom: qcs404: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-13-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765872; l=1291; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=lGCEkIFx3Ro52nqp/0xgEzhtJm6XAu+5tICY6AP6scg=; b=GnkaJ6PJfJFJ+U9D7aBXdtV2MToXO8a11ZO+RlxPzks9VSY2QScKNUzv9n8sie0GHv6FifFlM Q3tdS7702caDM+8AU0pN6g5oC4c23C1hZAdvu+mfUf2m7WTu7LjeTqI 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768702471635789586?= X-GMAIL-MSGID: =?utf-8?q?1768702471635789586?= Assign the necessary definitions to migrate to the new bus clock handling mechanism. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/qcs404.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/interconnect/qcom/qcs404.c b/drivers/interconnect/qcom/qcs404.c index 1faec0af74e7..82fe905b74a9 100644 --- a/drivers/interconnect/qcom/qcs404.c +++ b/drivers/interconnect/qcom/qcs404.c @@ -983,6 +983,7 @@ static struct qcom_icc_node * const qcs404_bimc_nodes[] = { }; static const struct qcom_icc_desc qcs404_bimc = { + .bus_clk_desc = &bimc_clk, .nodes = qcs404_bimc_nodes, .num_nodes = ARRAY_SIZE(qcs404_bimc_nodes), }; @@ -1037,6 +1038,7 @@ static struct qcom_icc_node * const qcs404_pcnoc_nodes[] = { }; static const struct qcom_icc_desc qcs404_pcnoc = { + .bus_clk_desc = &bus_0_clk, .nodes = qcs404_pcnoc_nodes, .num_nodes = ARRAY_SIZE(qcs404_pcnoc_nodes), }; @@ -1065,6 +1067,7 @@ static struct qcom_icc_node * const qcs404_snoc_nodes[] = { }; static const struct qcom_icc_desc qcs404_snoc = { + .bus_clk_desc = &bus_1_clk, .nodes = qcs404_snoc_nodes, .num_nodes = ARRAY_SIZE(qcs404_snoc_nodes), }; From patchwork Wed Jun 14 18:04:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108090 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp137325vqr; Wed, 14 Jun 2023 11:08:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7v4fj+UrfyT0drQvHQHepUnb+dNamU8oNzXw0fAe3gnSjQOkEi4p9RShEfWFzjxuEuE6cE X-Received: by 2002:a17:906:fd86:b0:978:af9d:771d with SMTP id xa6-20020a170906fd8600b00978af9d771dmr17152279ejb.17.1686766132560; Wed, 14 Jun 2023 11:08:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686766132; cv=none; d=google.com; s=arc-20160816; b=O+nZBw0Zi87K7SIWHXIzQg+mFkGTkIYSAerTzVTjpnqQvd+3aTOU4ddrcaDYYJZzpP c+2UqFNBXaiDHc5uedoOHClrV/xHIh2HxFHaGCsGT2fX7suaNmxnGtiQ5K+IUiyg20zA TizxA+4uRtQLCcVBZ0RZGaG0e1wCz2Uu71pszs7tIQ3JFgfpuFiA5SyMHeLvcry9Cowt SvcvfSux+kVL3Ru0oEW+5Ww6xcw/Oh7MswEbX8Up77TxUXzvygkRADNjezWqbubLA3+V nKbNBtjp9OW6lmhZ+N4qd3r9nObrYjtBXArCSjiobIw3PNEMW2fmdAziRqn+e5p480i2 plEw== 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=xSfPNWyiQLrjAB0czC11oTpbsDGKiNFbaeuQIkEjCow=; b=egG6FgWVcqu02MhkbzEfjMbu0Sfl6hD08sIQYGEK6sNRfafr/wWdKxousmHVBba9w0 F9/jgpIXjV+Q4oCFdKyY2Byp9N7WpYAxZnrWsO+Y2hFHMSeagx5djAtAZvYFlXUazCvd /GO8GrFj6OhJ8+SoyQQY28+wPBvs/KTkmHQSY0bLXdiDaBU69NGrOVoNmLkZXUvMqxa9 uPa2elxV402tqZNk7riToReh0bKa48V1SHpm0kn4QIozCHYGklStdqpzN27CoaW6qTOd 8/8iwFW2v9LYPGGuUY1/UhMw3ls9fDfr14RwLvlqmc2eXJtZTjUlDWnLUeRtQZl9Dk2g 08/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HvBWWY+/"; 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 lr27-20020a170906fb9b00b00978813d3ec2si8098785ejb.344.2023.06.14.11.08.27; Wed, 14 Jun 2023 11:08:52 -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="HvBWWY+/"; 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 S236617AbjFNSGq (ORCPT + 99 others); Wed, 14 Jun 2023 14:06:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240872AbjFNSFE (ORCPT ); Wed, 14 Jun 2023 14:05:04 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2246626A6 for ; Wed, 14 Jun 2023 11:04:57 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b34ac4b6e8so12151491fa.3 for ; Wed, 14 Jun 2023 11:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765895; x=1689357895; 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=xSfPNWyiQLrjAB0czC11oTpbsDGKiNFbaeuQIkEjCow=; b=HvBWWY+/HlzjknLWa5HvxKUQeCiGy/YOMhx5xc54cn2tLIBMBXD36tuq9BCiV8Tdkq obo4I+Lk9hQY7rznljz4ze5SoEiqpS94REtIXwjNwCJIrL42Hc1Cp/1VasBF33b+hJyR rgANW/v+C1vV0EhAtm+xGsCV8DSwl2EOuVvu1AKfJIK9/vLhnIdYCDBfSR1QXOUeVsph CrndO4z7hWH26yg0p6dO8YMcxHHdi33Wfk4lw9oWKDT3irklp0scN4Hz4xRFagOylUkI NaQpbx/O3sV31DEjHwO9mk778zDvPsXas1pwk5hzkCy5q6dyfutk5kez4wB+SuxGG6/u SaCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765895; x=1689357895; 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=xSfPNWyiQLrjAB0czC11oTpbsDGKiNFbaeuQIkEjCow=; b=Ue4R78Zif9PvM65GXdIPcp2ED+c0hxDvON5qbJeApbeBtXBRImmkyiODbhJf4BI32D 2ivjzckQ181ABqZZbW5J0W3ocehMutWxOPP0H9aXz795Q9NQdyD5RA/mSzazxP4z1J8U LcnvBFm628yrYN/yQExt6Lb9PQ5KjhbihEtMH+N1VbeBwoz3E50Qdn0/tiPgl0EABeUj BmbNE/gT5KtK+7OsaeWqYyuvCGqZPs1IvGNXG+FqBWrzCeID3d2V3FIFJSppnXuFcwys fbELPY0cY0f8O8x44W/RW5vtIcSJk5utarY+41fImZiFDVWKtai5zQN44VrK4tu2+6Q4 JCwQ== X-Gm-Message-State: AC+VfDzKZ3IW4ACjKHC9FXT0sWUndmHWGc3dArWVes8dp+w30znJYDbh +dx9oZRDoUgoCnAiwWjKV8pX/w== X-Received: by 2002:a19:5f11:0:b0:4eb:c85:bdc2 with SMTP id t17-20020a195f11000000b004eb0c85bdc2mr8172808lfb.2.1686765895207; Wed, 14 Jun 2023 11:04:55 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:04:54 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:33 +0200 Subject: [PATCH v6 14/22] interconnect: qcom: msm8939: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-14-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov , Stephan Gerhold X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765872; l=1734; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=ptXNaQOaty1z4TDLkDcxe3GA9UIR7yqJkXzhnEP9xnw=; b=zW7ImhAlheC//FuwEf4n0YToyLVvVx+0R5GHfoYXlaiG0pIf/XLFlz2zpFeYNEBn8b8nKAz+B LLu5dSXNePHAYEmBqGh4QucTkyzi3l+8caBBqGqcvU61bow7MrjQbj9 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768702484394431035?= X-GMAIL-MSGID: =?utf-8?q?1768702484394431035?= Assign the necessary definitions to migrate to the new bus clock handling mechanism. Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephan Gerhold Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/msm8939.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/interconnect/qcom/msm8939.c b/drivers/interconnect/qcom/msm8939.c index b1005dee4e38..6732eeeb8158 100644 --- a/drivers/interconnect/qcom/msm8939.c +++ b/drivers/interconnect/qcom/msm8939.c @@ -1283,6 +1283,7 @@ static const struct qcom_icc_desc msm8939_snoc = { .type = QCOM_ICC_NOC, .nodes = msm8939_snoc_nodes, .num_nodes = ARRAY_SIZE(msm8939_snoc_nodes), + .bus_clk_desc = &bus_1_clk, .regmap_cfg = &msm8939_snoc_regmap_config, .qos_offset = 0x7000, }; @@ -1303,6 +1304,7 @@ static const struct qcom_icc_desc msm8939_snoc_mm = { .type = QCOM_ICC_NOC, .nodes = msm8939_snoc_mm_nodes, .num_nodes = ARRAY_SIZE(msm8939_snoc_mm_nodes), + .bus_clk_desc = &bus_2_clk, .regmap_cfg = &msm8939_snoc_regmap_config, .qos_offset = 0x7000, }; @@ -1331,6 +1333,7 @@ static const struct qcom_icc_desc msm8939_bimc = { .type = QCOM_ICC_BIMC, .nodes = msm8939_bimc_nodes, .num_nodes = ARRAY_SIZE(msm8939_bimc_nodes), + .bus_clk_desc = &bimc_clk, .regmap_cfg = &msm8939_bimc_regmap_config, .qos_offset = 0x8000, }; @@ -1402,6 +1405,7 @@ static const struct qcom_icc_desc msm8939_pcnoc = { .type = QCOM_ICC_NOC, .nodes = msm8939_pcnoc_nodes, .num_nodes = ARRAY_SIZE(msm8939_pcnoc_nodes), + .bus_clk_desc = &bus_0_clk, .regmap_cfg = &msm8939_pcnoc_regmap_config, .qos_offset = 0x7000, }; From patchwork Wed Jun 14 18:04:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108088 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp137177vqr; Wed, 14 Jun 2023 11:08:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4duth6EqdHOh9WnJ8MFypm+NaEule0vnjQ6Ix6G/72Q7J16vzayf5RQwzfebQQford5foY X-Received: by 2002:aa7:d999:0:b0:514:9e3c:d82e with SMTP id u25-20020aa7d999000000b005149e3cd82emr10295324eds.14.1686766121025; Wed, 14 Jun 2023 11:08:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686766121; cv=none; d=google.com; s=arc-20160816; b=spc5KVXx8o8mekBBJ6p9X7Ck7C3ncuZulkwGa4rQ6HKvg/2IXNXY1Bok2rG6zIdtBA OoVDEpwyWdc8bPKujKw/6Nk6Qws662MDqTzJ1m0rTvwAtqAVaG9OQK6YheNw7PtM91// PXte9KjyncX/026yFHSmZX2CIMBgXgjtQNnufaNuZAb32/ENitktLJJ4yj2JgyUmym7+ yWuWkQQCbiO8Y+tmm5QSw6AVAqdA55HFYYX8oU0A5sgsIkpdXR9YKGpqmPdtAQHwrNjj IPxpWNKSuaXLThc2ulmAuICwWtDXfyG57vaeSiVp2uZTqNdnH+qFctSdaZ2YkdryBrFp 3+sQ== 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=fyLlsxl16OWqS291jN4brexaOHkZM0ynHfqUIIXviBM=; b=RX5DnrTP/76RI3NtF6ckDfnqvZZUn6nL8gLj5WcJ3c1vOOtdyjrVpigKCIHtzpGbuC AwK/19B60InJkGrPZCnv8PuJidp7HyH4pSV+nuIosS9gaY/rcCqFvPNxVNWXFhEp2PwK Dm/L1ms1DspuDwFazvNiPawYq/23yi7ORlH6PIaMN4rvDfjW9amJBNT98jyC5wguf3Ag CjmnjWQaUoPBtKKK102ZGetYPBdRtagGi0P2el1gXdrG3OhWOdMGDiZydBnfNxKKAv40 hwib8Bxc5ELpKQoChBFh5GrBh0AH9RlDljRl+7G/7JvVkVd76gTtyFhkkbhfyvY1DudV KC9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="oZv/T8vh"; 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 h10-20020a50ed8a000000b005187bb07b86si1761287edr.353.2023.06.14.11.08.15; Wed, 14 Jun 2023 11:08:41 -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="oZv/T8vh"; 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 S241535AbjFNSGg (ORCPT + 99 others); Wed, 14 Jun 2023 14:06:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240892AbjFNSFE (ORCPT ); Wed, 14 Jun 2023 14:05:04 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4369626AF for ; Wed, 14 Jun 2023 11:04:58 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2b1b2ca09b9so13919481fa.1 for ; Wed, 14 Jun 2023 11:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765896; x=1689357896; 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=fyLlsxl16OWqS291jN4brexaOHkZM0ynHfqUIIXviBM=; b=oZv/T8vheSbgW34JAf8IU/cSZSHZufUTOGP1zItVOHwwpLcuDyRP0oiblXUlJLVT2e 6+iofHmUIa75i0yoBsrJXRMnyvtU0aFM5v3OdXqeAICWFaivvAj2tHGracGg41nFGJle LHZHN7XLIHXjuXEeCxI1zBtHAEu3FFIGhieATscJPpKmEP4KrEPJ0nqYaKt2Ti8z+IXS OgNb5IS31wla/etxLJvhnmoaMX7ErVCxl8jYXGPj8vpW+yZOctxVJyNNz0z20piaryLt 81aR+DXNdihvVIPgom0A5QI3vm41JYNdsfavY++hBxSlJu5pirQi1Z0WQjw1D5Aq8LaM HGWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765896; x=1689357896; 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=fyLlsxl16OWqS291jN4brexaOHkZM0ynHfqUIIXviBM=; b=IPWANDWbloCcMoo6p/XKRkfN43uLWyyzTf12B0htWTWDsUDoc32jP9loSdfRbw7Y+s /b8fiBty5lIIxPBhwl4mS04fUn+9htWNT1FYXKmOv1gVMd3u9in7dyed+T2sG7NUH7Hd eU/WKDPye4l09uTr05dOChbexGqy7m5X8AdSV1dlDg+vOJOt3QNjqKYqS534klhAd2Cv goO+eaL7siGX/U6z8w1HJ6fUXsL7ZZeT4PtKeHu6i5LtnmhAJ1bJuNv4HMtFcBw4T0B+ K5UTft1qqp5WjuIM/HsfMmWkmElV2OrZb8YIh8vm0AlrmcCpcALeYyNZ8SE1xeXjs2qC 3SMw== X-Gm-Message-State: AC+VfDwHzmaEoknFOiFLNd5hUAOSDXh7Gi1Ug7TAlsrkI9oJ+RCxb/cK epLUu5dYEuuVzh2343RQqNmSWg== X-Received: by 2002:a19:ca0f:0:b0:4f4:fdb4:c76d with SMTP id a15-20020a19ca0f000000b004f4fdb4c76dmr8576299lfg.47.1686765896602; Wed, 14 Jun 2023 11:04:56 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:04:56 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:34 +0200 Subject: [PATCH v6 15/22] interconnect: qcom: msm8916: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-15-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov , Stephan Gerhold X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765872; l=1438; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=1dxDULtatbAkSLWWf67/ek605+kPD/vruTIZt6NGovc=; b=4oH1pCEvbOMW4wvsyB3dFaB4QVq9MmwUF4ltrBSN51FMGT7GiH3nSkBxLZbfzPwk4uoF/wpkU 9Rl/CHCwcaYA4shfju7EB3PYQU9WR/H88J78BTg3vvnfahQ4jaFXJh1 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768702472525979250?= X-GMAIL-MSGID: =?utf-8?q?1768702472525979250?= Assign the necessary definitions to migrate to the new bus clock handling mechanism. Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephan Gerhold Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/msm8916.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/interconnect/qcom/msm8916.c b/drivers/interconnect/qcom/msm8916.c index 70b67fbe453f..b567a2b4199c 100644 --- a/drivers/interconnect/qcom/msm8916.c +++ b/drivers/interconnect/qcom/msm8916.c @@ -1230,6 +1230,7 @@ static const struct qcom_icc_desc msm8916_snoc = { .type = QCOM_ICC_NOC, .nodes = msm8916_snoc_nodes, .num_nodes = ARRAY_SIZE(msm8916_snoc_nodes), + .bus_clk_desc = &bus_1_clk, .regmap_cfg = &msm8916_snoc_regmap_config, .qos_offset = 0x7000, }; @@ -1258,6 +1259,7 @@ static const struct qcom_icc_desc msm8916_bimc = { .type = QCOM_ICC_BIMC, .nodes = msm8916_bimc_nodes, .num_nodes = ARRAY_SIZE(msm8916_bimc_nodes), + .bus_clk_desc = &bimc_clk, .regmap_cfg = &msm8916_bimc_regmap_config, .qos_offset = 0x8000, }; @@ -1327,6 +1329,7 @@ static const struct qcom_icc_desc msm8916_pcnoc = { .type = QCOM_ICC_NOC, .nodes = msm8916_pcnoc_nodes, .num_nodes = ARRAY_SIZE(msm8916_pcnoc_nodes), + .bus_clk_desc = &bus_0_clk, .regmap_cfg = &msm8916_pcnoc_regmap_config, .qos_offset = 0x7000, }; From patchwork Wed Jun 14 18:04:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108089 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp137293vqr; Wed, 14 Jun 2023 11:08:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5wbyLkfLTowjCGA98w4faueQQ1g7UIYslNEuIuaCrBNDUdGu0F5QTQ+19yaiqn6j4kRURl X-Received: by 2002:a05:651c:105b:b0:2a8:c01a:71b6 with SMTP id x27-20020a05651c105b00b002a8c01a71b6mr7232708ljm.3.1686766130295; Wed, 14 Jun 2023 11:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686766130; cv=none; d=google.com; s=arc-20160816; b=p7hkzGz8eRZDTLg1EahHlhm/hkTIO0FrPRrEwjVXuZSjsPNDjnqiyI+ahM4c9BNV2T xlfdmGOnyMGxRqaDsZPrtG5x2yhqJxMiG0D0isMJR+XdTj4hr1vkJWCXMXWnpw4Q7Ti+ 3yS/VgCwY16E9GpOiR6w+A/ksEmH8tnXZdepBOpCV8ZcshqwvwMlqbRTjmivXQZODJtH hz6ue+VTE6bnnxe8BZgrfo9cgWPxv0qTCR/2h3Hpz76PjSKw9t2TFbINfC9dTKfqH8DW 7UpF+6+ontX4zqHyjMNhaYiwV7AZp6Rl2mhtNSr3dpcpuzLvbOcpEROSslvq5M+rAwT1 T7Iw== 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=r3iwd6rHqsg8HTsIHqkjHpgKU8rjtKazN66jALoshMs=; b=k2PV4mGZt5xelBZhVwBSFz/dm/riE7Od2Wm3yOWpv9KbSpboC4m1HQklfJF3dQAk3X Js3hAN+Ah2e8j4XzDixbZKJ4Jt3kMvdqK00a7tP0V3aLPgIexBp8oyXGWioFrjXfyKE+ qYkuX0EzFb2U1Rz3uPfurptuSESnLpW2JTxA2tTYFMnf+hh9Wenwt1/O7eJj8VXTQ8Ao /6Q/VN3t+rc9OwTbbxtGM7Hzb5462mwraf/4ul418kyEMlvbv80eQv1EOFhsQbueX/Bt hOIuYfbBhjlQTj47TfqdMWfyKAnJ6tgp6SzVsRPtd4fYVVShv1u0Ivl7VWadDFxpfoTo 6HwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fOaETqmN; 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 m16-20020a50ef10000000b005163242f90csi8963537eds.184.2023.06.14.11.08.23; Wed, 14 Jun 2023 11:08:50 -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=fOaETqmN; 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 S241554AbjFNSGl (ORCPT + 99 others); Wed, 14 Jun 2023 14:06:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241002AbjFNSFG (ORCPT ); Wed, 14 Jun 2023 14:05:06 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C34F626B8 for ; Wed, 14 Jun 2023 11:04:59 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4f60a27c4a2so8632690e87.2 for ; Wed, 14 Jun 2023 11:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765898; x=1689357898; 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=r3iwd6rHqsg8HTsIHqkjHpgKU8rjtKazN66jALoshMs=; b=fOaETqmNSknr4iw3nOx579ELaw/iyBGPoamIHwC7mQuQYj+c7Ln+7h5TYT8Qj3vlvQ gdOBlkGdpLMJQKdSGBSGs7lRXQe01SxAgMk7QXxipBY5TBlgne3kyqZ4jsKcwsnPR+VF gOeTJSYOSEzx5rwhBe8T5SD2f1S0JFx6Vo6qMMNIy5ctyzm3y3AeCnH70cUexUcP7p6y dXSbP4yTEt9hCIstLnV9boARGrbQ7XCkV8ZMy3mIVYZmC7vpibH+BydsR4XiWJRdZ4sZ KCCujrkgm1jZwVaACJE6//4Otiiuhl3/u01qqx6KveQVmBUJQwJrPTFaoLteMvZknUFU WSsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765898; x=1689357898; 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=r3iwd6rHqsg8HTsIHqkjHpgKU8rjtKazN66jALoshMs=; b=RMh607ZYm+scWXRnDjJrnjK0kaEarnWsDkrctgaau7NXaSf4/wAewZxeznza1B1SjZ Azu8FjDMKOS1n9wV9lWw0gMJO+PWZ9peOibChJosSnpN3q+44DlNcI90jO61uSzsTb9C KjGzkRkSjQLLa5O1JIU6K0yE/JTfM0EU+F7BxI4xg2T+hDHzx17uGU/J8KATzxXE0ytv xbhg6rDErLSFfYY5l42Gn/ZCjtCA9cPf5Qtj4dCpkFe/d73PtjW7hlzTROIVVC7VJm3g Jc2/YFFJETSK3jX0kjVzjGyyerHLKThGIKyg2U+lpUnZ5jt2ErszRI5+joKeabv4B4vm tLfQ== X-Gm-Message-State: AC+VfDwwhDgH40LrCOWcmLnGg2p0aYeaP09bDMiEiyGl3rzwm3HxX+pR zHWSDvsCudpXj1I0e5OeB+DJx+xDdqqCLh2h55U= X-Received: by 2002:a19:6554:0:b0:4f1:3be7:e1d with SMTP id c20-20020a196554000000b004f13be70e1dmr7638434lfj.62.1686765898105; Wed, 14 Jun 2023 11:04:58 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:04:57 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:35 +0200 Subject: [PATCH v6 16/22] interconnect: qcom: qcm2290: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-16-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765873; l=2388; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Y5vzxfTOafvaW8mPCP2rmWXwcfrcZgL9XrNa/4uLTOM=; b=c8St70MdxSL4ETnKqVrqwwneypoqlc2/65u/cJgwHt+IG4LQkzORMvmLaBkRk0jZwCVG+XT0/ BRBb8UbqS8gAFSRIHCdklVuzS+x9oZX9EUDo/38umtszqxEEmd2xlk9 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768702482058814069?= X-GMAIL-MSGID: =?utf-8?q?1768702482058814069?= Assign the necessary definitions to migrate to the new bus clock handling mechanism. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/qcm2290.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/interconnect/qcom/qcm2290.c b/drivers/interconnect/qcom/qcm2290.c index 36a53add866d..8fc4acc4220b 100644 --- a/drivers/interconnect/qcom/qcm2290.c +++ b/drivers/interconnect/qcom/qcm2290.c @@ -1195,6 +1195,7 @@ static const struct qcom_icc_desc qcm2290_bimc = { .type = QCOM_ICC_BIMC, .nodes = qcm2290_bimc_nodes, .num_nodes = ARRAY_SIZE(qcm2290_bimc_nodes), + .bus_clk_desc = &bimc_clk, .regmap_cfg = &qcm2290_bimc_regmap_config, /* M_REG_BASE() in vendor msm_bus_bimc_adhoc driver */ .qos_offset = 0x8000, @@ -1250,6 +1251,7 @@ static const struct qcom_icc_desc qcm2290_cnoc = { .type = QCOM_ICC_NOC, .nodes = qcm2290_cnoc_nodes, .num_nodes = ARRAY_SIZE(qcm2290_cnoc_nodes), + .bus_clk_desc = &bus_1_clk, .regmap_cfg = &qcm2290_cnoc_regmap_config, }; @@ -1291,6 +1293,7 @@ static const struct qcom_icc_desc qcm2290_snoc = { .type = QCOM_ICC_QNOC, .nodes = qcm2290_snoc_nodes, .num_nodes = ARRAY_SIZE(qcm2290_snoc_nodes), + .bus_clk_desc = &bus_2_clk, .regmap_cfg = &qcm2290_snoc_regmap_config, /* Vendor DT node fab-sys_noc property 'qcom,base-offset' */ .qos_offset = 0x15000, @@ -1305,6 +1308,7 @@ static const struct qcom_icc_desc qcm2290_qup_virt = { .type = QCOM_ICC_QNOC, .nodes = qcm2290_qup_virt_nodes, .num_nodes = ARRAY_SIZE(qcm2290_qup_virt_nodes), + .bus_clk_desc = &qup_clk, }; static struct qcom_icc_node * const qcm2290_mmnrt_virt_nodes[] = { @@ -1318,6 +1322,7 @@ static const struct qcom_icc_desc qcm2290_mmnrt_virt = { .type = QCOM_ICC_QNOC, .nodes = qcm2290_mmnrt_virt_nodes, .num_nodes = ARRAY_SIZE(qcm2290_mmnrt_virt_nodes), + .bus_clk_desc = &mmaxi_0_clk, .regmap_cfg = &qcm2290_snoc_regmap_config, .qos_offset = 0x15000, }; @@ -1332,6 +1337,7 @@ static const struct qcom_icc_desc qcm2290_mmrt_virt = { .type = QCOM_ICC_QNOC, .nodes = qcm2290_mmrt_virt_nodes, .num_nodes = ARRAY_SIZE(qcm2290_mmrt_virt_nodes), + .bus_clk_desc = &mmaxi_1_clk, .regmap_cfg = &qcm2290_snoc_regmap_config, .qos_offset = 0x15000, }; From patchwork Wed Jun 14 18:04:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108093 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp142293vqr; Wed, 14 Jun 2023 11:17:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zRfPq3KhsyLHYbM28hChO0zQwvKBTANKt2nnGKjMyOuXmFHUv+CEljRXeRmulVd+stSUJ X-Received: by 2002:a17:903:124d:b0:1af:e302:123 with SMTP id u13-20020a170903124d00b001afe3020123mr3445842plh.3.1686766647222; Wed, 14 Jun 2023 11:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686766647; cv=none; d=google.com; s=arc-20160816; b=ZzYS43UoeQx5cuqXDUMkW2z0a0f52TyVuxcr39h7WgAlQnoSA+yOG8hAvXw/4JgeqX T7CSQC9l+JhXJNSvGVtD/0zk22ZXp8hZR+RwTnpjn0EXFyWgmaMEnAH2kmD+paCJuY9R rugQC8UkyuQb7Z8ULySfdsqJrTBdEWEg3dL37L3v+txYpi7cQIqBwYyC3G4kREvWEzSj BgV3EOO0ibyFn4MHF5ns1DEekT3BEEo8Y93B/GmiYcnvJ+tZ6NHBmhNbsLTRy3DTMC5A 4g+Jpd+VRqNyR20M9bMBcJU1zE1+weF6M8lGN2FM3fcCmtBzKPSwIfGgdwhnk6nJqamy mgiw== 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=ioPA5AiGcmtgHEjrKLBi7HE2C3MwcpMCNwE3NBc/q2U=; b=iyWEtOUv1mUcFb3n4FJOuUBPof/5z+nu7Gy8LYjBYZ8EUWKZ3u2LixkQ8u7/Vcvkuy SIzJTJkUcKV8e1Lx75IeVzr6Ae3CjuLpUAZ/454azm+7dlaMILT/BFQ6D7v7894jjuRD uTtHJzV/Mi6MU/5hAUX+IlmNnNxg1W2PnvPSM/bb0E6B2PPj5nY0+boiv+NPSBzMJeQ2 fzLo2kn/3cOQ2nV2LlTjAvX0JiwCic1BE6d/+j1UkzPSh3/Ou7yRXfK2SF5MmMW3JlrQ zJjlkRExvraAN18ymvMBtnjO6bZ3NSw3+ciSGew7adsCWwDc2w5Q2DvQDN32j3CqHHUX HwSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="F+di/RsE"; 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 e5-20020a17090301c500b001afac49e04dsi11574809plh.642.2023.06.14.11.17.12; Wed, 14 Jun 2023 11:17:27 -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="F+di/RsE"; 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 S238421AbjFNSG4 (ORCPT + 99 others); Wed, 14 Jun 2023 14:06:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241175AbjFNSFJ (ORCPT ); Wed, 14 Jun 2023 14:05:09 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A01B02682 for ; Wed, 14 Jun 2023 11:05:01 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4f61b45ee0dso9183049e87.0 for ; Wed, 14 Jun 2023 11:05:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765900; x=1689357900; 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=ioPA5AiGcmtgHEjrKLBi7HE2C3MwcpMCNwE3NBc/q2U=; b=F+di/RsEVmfsUL51gCpt20daAG/BelxVT/W8VsK6Ab1jV0pkZ9JBb6YDSN+LP0g4iZ Aq0j55HW5mVLjJLC7oLQ7j9yJZdxZQpaKzVoQXFxm8nofqLs5VUg8JV2uNBFHYtq01Ps 3oXfp1fQl165NXPsnEKRrX/0cawgrsTS8kADqvb+uVdgIuwdswVgSrPFp1cGN5rCS+/S h2i/jwNn2qdItcZJxhOxSTch42WL8B5DRRvIRvlSkCR91FVdMDfIlNZ7KkaGWpC02lD3 zXJ5X7vgzUBrrVsAy86PECBafMVVkt6gZfV18K0JFwu1QNAbYCToNG5atljGkd7NPfPk rjiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765900; x=1689357900; 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=ioPA5AiGcmtgHEjrKLBi7HE2C3MwcpMCNwE3NBc/q2U=; b=IZPT5CpgUy673MPt9dNC24HRImwQIDFI9eiOi/feasbT6ZXOQE17v1am6PvhiglE2L I+8s0ZI5otdZoiIixVTYS+7FjK/rx3Y441XPJZr0DSB12oKsvfa9ltm3RnnVeqldtqZw YSHAAdRWjdZuqfOhLRiQ9DOGX1HjgK1vfyA5HXaTjuukyALUkqimbHYpVf+AIpSuUh/7 iwbRMVMu8i6hwpqrShw6vZaqioJWZn79YMXHBcYbDrHpsj1S/NvaSLZmCiZpMsmEG44/ Dm2G4Z1fhguFPPDCmjOrf5/KyXRO+R/Do4XU1eW0i/O3madJCYZ05cAjrF2DuAmVO6DE HyUQ== X-Gm-Message-State: AC+VfDwcR6dLZPbrnO+ha/ZgS6It2oxvM2dxfXnommA9pzi4Q5YYGjAx 0rrvhO56qwu7jGXmbh3WK51WQQ== X-Received: by 2002:a19:4359:0:b0:4f3:b4a9:a619 with SMTP id m25-20020a194359000000b004f3b4a9a619mr7722099lfj.40.1686765899706; Wed, 14 Jun 2023 11:04:59 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:04:59 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:36 +0200 Subject: [PATCH v6 17/22] interconnect: qcom: icc-rpm: Control bus rpmcc from icc MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-17-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Stephan Gerhold X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765873; l=10494; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=6XmCLLPOlSJp0xPaLIu2MNKkmr0SzDrl7ZbdIrtYT8E=; b=b7qjO8WvMtF3LPwXjT0n+j1fvda6exldICVwk9Ap/uMcYagpJTvP3/sY6DlD3J6kTY3U1oUHo GiHYA0zAPS9BonjYaaPSntqseGV23ar1GkA53LtLBoew7Rr8h1N2ZwE 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768703023529125298?= X-GMAIL-MSGID: =?utf-8?q?1768703023529125298?= The sole purpose of bus clocks that were previously registered with rpmcc was to convey the aggregated bandwidth to RPM. There's no good reason to keep them outside the interconnect framework, as it only adds to the plentiful complexity. Add the required code to handle these clocks from within SMD RPM ICC. RPM-owned bus clocks are no longer considered a thing, but sadly we have to allow for the existence of HLOS-owned bus clocks, as some (mostly older) SoCs (ab)use these for bus scaling (e.g. MSM8998 and &mmcc AHB_CLK_SRC). This in turn is trivially solved with a single *clk, which is filled and used iff qp.bus_clk_desc is absent and we have a "bus" clock-names entry in the DT node. This change should(tm) be fully compatible with all sorts of old Device Trees as far as the interconnect functionality goes (modulo abusing bus clock handles or wrongly using the qcom,icc.h binding, but that's a mistake in and of itself). Reviewed-by: Stephan Gerhold Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 121 ++++++++++++++++++++---------------- drivers/interconnect/qcom/icc-rpm.h | 13 ++-- drivers/interconnect/qcom/msm8996.c | 1 - drivers/interconnect/qcom/sdm660.c | 1 - 4 files changed, 73 insertions(+), 63 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 3fdf3962b80d..60e4eab8855a 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -48,7 +48,7 @@ #define NOC_QOS_MODE_FIXED_VAL 0x0 #define NOC_QOS_MODE_BYPASS_VAL 0x2 -#define ICC_BUS_CLK_MIN_RATE 19200000ULL +#define ICC_BUS_CLK_MIN_RATE 19200ULL /* kHz */ static int qcom_icc_set_qnoc_qos(struct icc_node *src) { @@ -337,11 +337,10 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) struct qcom_icc_node *src_qn = NULL, *dst_qn = NULL; struct icc_provider *provider; u64 sum_bw; - u64 rate; + u64 active_rate, sleep_rate; u64 agg_avg[QCOM_ICC_NUM_BUCKETS], agg_peak[QCOM_ICC_NUM_BUCKETS]; u64 max_agg_avg; - int ret, i; - int bucket; + int ret; src_qn = src->data; if (dst) @@ -363,49 +362,61 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) return ret; } - for (i = 0; i < qp->num_bus_clks; i++) { - /* - * Use WAKE bucket for active clock, otherwise, use SLEEP bucket - * for other clocks. If a platform doesn't set interconnect - * path tags, by default use sleep bucket for all clocks. - * - * Note, AMC bucket is not supported yet. - */ - if (!strcmp(qp->bus_clks[i].id, "bus_a")) - bucket = QCOM_ICC_BUCKET_WAKE; - else - bucket = QCOM_ICC_BUCKET_SLEEP; - - rate = icc_units_to_bps(max(agg_avg[bucket], agg_peak[bucket])); - do_div(rate, src_qn->buswidth); - rate = min_t(u64, rate, LONG_MAX); - - /* - * Downstream checks whether the requested rate is zero, but it makes little sense - * to vote for a value that's below the lower threshold, so let's not do so. - */ - if (bucket == QCOM_ICC_BUCKET_WAKE && qp->keep_alive) - rate = max(ICC_BUS_CLK_MIN_RATE, rate); - - if (qp->bus_clk_rate[i] == rate) - continue; - - ret = clk_set_rate(qp->bus_clks[i].clk, rate); - if (ret) { - pr_err("%s clk_set_rate error: %d\n", - qp->bus_clks[i].id, ret); + /* Some providers don't have a bus clock to scale */ + if (!qp->bus_clk_desc && !qp->bus_clk) + return 0; + + /* Intentionally keep the rates in kHz as that's what RPM accepts */ + active_rate = max(agg_avg[QCOM_SMD_RPM_ACTIVE_STATE], + agg_peak[QCOM_SMD_RPM_ACTIVE_STATE]); + do_div(active_rate, src_qn->buswidth); + + sleep_rate = max(agg_avg[QCOM_SMD_RPM_SLEEP_STATE], + agg_peak[QCOM_SMD_RPM_SLEEP_STATE]); + do_div(sleep_rate, src_qn->buswidth); + + /* + * Downstream checks whether the requested rate is zero, but it makes little sense + * to vote for a value that's below the lower threshold, so let's not do so. + */ + if (qp->keep_alive) + active_rate = max(ICC_BUS_CLK_MIN_RATE, active_rate); + + /* Some providers have a non-RPM-owned bus clock - convert kHz->Hz for the CCF */ + if (qp->bus_clk) { + active_rate = max_t(u64, active_rate, sleep_rate); + /* ARM32 caps clk_set_rate arg to u32.. Nothing we can do about that! */ + active_rate = min_t(u64, 1000ULL * active_rate, ULONG_MAX); + return clk_set_rate(qp->bus_clk, active_rate); + } + + /* RPM only accepts <=INT_MAX rates */ + active_rate = min_t(u64, active_rate, INT_MAX); + sleep_rate = min_t(u64, sleep_rate, INT_MAX); + + if (active_rate != qp->bus_clk_rate[QCOM_SMD_RPM_ACTIVE_STATE]) { + ret = qcom_icc_rpm_set_bus_rate(qp->bus_clk_desc, QCOM_SMD_RPM_ACTIVE_STATE, + active_rate); + if (ret) return ret; - } - qp->bus_clk_rate[i] = rate; + + /* Cache the rate after we've successfully commited it to RPM */ + qp->bus_clk_rate[QCOM_SMD_RPM_ACTIVE_STATE] = active_rate; + } + + if (sleep_rate != qp->bus_clk_rate[QCOM_SMD_RPM_SLEEP_STATE]) { + ret = qcom_icc_rpm_set_bus_rate(qp->bus_clk_desc, QCOM_SMD_RPM_SLEEP_STATE, + sleep_rate); + if (ret) + return ret; + + /* Cache the rate after we've successfully commited it to RPM */ + qp->bus_clk_rate[QCOM_SMD_RPM_SLEEP_STATE] = sleep_rate; } return 0; } -static const char * const bus_clocks[] = { - "bus", "bus_a", -}; - int qnoc_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -447,6 +458,20 @@ int qnoc_probe(struct platform_device *pdev) if (!qp->intf_clks) return -ENOMEM; + if (desc->bus_clk_desc) { + qp->bus_clk_desc = devm_kzalloc(dev, sizeof(*qp->bus_clk_desc), + GFP_KERNEL); + if (!qp->bus_clk_desc) + return -ENOMEM; + + qp->bus_clk_desc = desc->bus_clk_desc; + } else { + /* Some older SoCs may have a single non-RPM-owned bus clock. */ + qp->bus_clk = devm_clk_get_optional(dev, "bus"); + if (IS_ERR(qp->bus_clk)) + return PTR_ERR(qp->bus_clk); + } + data = devm_kzalloc(dev, struct_size(data, nodes, num_nodes), GFP_KERNEL); if (!data) @@ -456,10 +481,6 @@ int qnoc_probe(struct platform_device *pdev) for (i = 0; i < cd_num; i++) qp->intf_clks[i].id = cds[i]; - qp->num_bus_clks = desc->no_clk_scaling ? 0 : NUM_BUS_CLKS; - for (i = 0; i < qp->num_bus_clks; i++) - qp->bus_clks[i].id = bus_clocks[i]; - qp->keep_alive = desc->keep_alive; qp->type = desc->type; qp->qos_offset = desc->qos_offset; @@ -489,11 +510,7 @@ int qnoc_probe(struct platform_device *pdev) } regmap_done: - ret = devm_clk_bulk_get(dev, qp->num_bus_clks, qp->bus_clks); - if (ret) - return ret; - - ret = clk_bulk_prepare_enable(qp->num_bus_clks, qp->bus_clks); + ret = clk_prepare_enable(qp->bus_clk); if (ret) return ret; @@ -565,7 +582,7 @@ int qnoc_probe(struct platform_device *pdev) icc_provider_deregister(provider); err_remove_nodes: icc_nodes_remove(provider); - clk_bulk_disable_unprepare(qp->num_bus_clks, qp->bus_clks); + clk_disable_unprepare(qp->bus_clk); return ret; } @@ -577,7 +594,7 @@ int qnoc_remove(struct platform_device *pdev) icc_provider_deregister(&qp->provider); icc_nodes_remove(&qp->provider); - clk_bulk_disable_unprepare(qp->num_bus_clks, qp->bus_clks); + clk_disable_unprepare(qp->bus_clk); return 0; } diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index ecd6104335a7..e3b0aa9fff3e 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -37,32 +37,29 @@ struct rpm_clk_resource { bool branch; }; -#define NUM_BUS_CLKS 2 - /** * struct qcom_icc_provider - Qualcomm specific interconnect provider * @provider: generic interconnect provider - * @num_bus_clks: the total number of bus_clks clk_bulk_data entries (0 or 2) * @num_intf_clks: the total number of intf_clks clk_bulk_data entries * @type: the ICC provider type * @regmap: regmap for QoS registers read/write access * @qos_offset: offset to QoS registers * @bus_clk_rate: bus clock rate in Hz - * @bus_clks: the clk_bulk_data table of bus clocks + * @bus_clk_desc: a pointer to a rpm_clk_resource description of bus clocks + * @bus_clk: a pointer to a HLOS-owned bus clock * @intf_clks: a clk_bulk_data array of interface clocks * @keep_alive: whether to always keep a minimum vote on the bus clocks * @is_on: whether the bus is powered on */ struct qcom_icc_provider { struct icc_provider provider; - int num_bus_clks; int num_intf_clks; enum qcom_icc_type type; struct regmap *regmap; unsigned int qos_offset; - u64 bus_clk_rate[NUM_BUS_CLKS]; - struct clk_bulk_data bus_clks[NUM_BUS_CLKS]; + u32 bus_clk_rate[QCOM_SMD_RPM_STATE_NUM]; const struct rpm_clk_resource *bus_clk_desc; + struct clk *bus_clk; struct clk_bulk_data *intf_clks; bool keep_alive; bool is_on; @@ -119,12 +116,10 @@ struct qcom_icc_node { struct qcom_icc_desc { struct qcom_icc_node * const *nodes; size_t num_nodes; - const char * const *bus_clocks; const struct rpm_clk_resource *bus_clk_desc; const char * const *intf_clocks; size_t num_intf_clocks; bool keep_alive; - bool no_clk_scaling; enum qcom_icc_type type; const struct regmap_config *regmap_cfg; unsigned int qos_offset; diff --git a/drivers/interconnect/qcom/msm8996.c b/drivers/interconnect/qcom/msm8996.c index 42722681b4ce..b9695c1931ce 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -1817,7 +1817,6 @@ static const struct qcom_icc_desc msm8996_a0noc = { .num_nodes = ARRAY_SIZE(a0noc_nodes), .intf_clocks = a0noc_intf_clocks, .num_intf_clocks = ARRAY_SIZE(a0noc_intf_clocks), - .no_clk_scaling = true, .regmap_cfg = &msm8996_a0noc_regmap_config }; diff --git a/drivers/interconnect/qcom/sdm660.c b/drivers/interconnect/qcom/sdm660.c index ad5d52af7eab..e1aed937c86b 100644 --- a/drivers/interconnect/qcom/sdm660.c +++ b/drivers/interconnect/qcom/sdm660.c @@ -1617,7 +1617,6 @@ static const struct qcom_icc_desc sdm660_gnoc = { .nodes = sdm660_gnoc_nodes, .num_nodes = ARRAY_SIZE(sdm660_gnoc_nodes), .regmap_cfg = &sdm660_gnoc_regmap_config, - .no_clk_scaling = true, }; static struct qcom_icc_node * const sdm660_mnoc_nodes[] = { From patchwork Wed Jun 14 18:04:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108095 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp143462vqr; Wed, 14 Jun 2023 11:19:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4WxQnMhkcBa3Qc9NflACPvvWWUPBbTSFS7aXSBbF40X5gsAT0HreajJX0RY2inoqaZI/AL X-Received: by 2002:a17:90a:fa46:b0:24e:59d2:6f with SMTP id dt6-20020a17090afa4600b0024e59d2006fmr1973063pjb.11.1686766786835; Wed, 14 Jun 2023 11:19:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686766786; cv=none; d=google.com; s=arc-20160816; b=JPgCvEVOm5F2/33YAbqlWtE5tU8RuJfLaDjhcrrWojEldvucnkvxNXDk2NyDMovmNt 6IgMTveIETjZSKDOsdtjUWyMvXgoPQ8UB0JIC3mYI/E1KoceTTUmMc79bv3Y7oHMaWAI DmCm5z3bd/u/pK3r780/jPe/7eBX6VjwJtZyUede3fvsgS25moQ4Rqg8J8zbPEzAqRc2 XO01pdGkxBd0nRITCVZo4lsSJ9Zi/FXUUQGwtnNSdOJcg//MMXa1syT+OfBjaMt76kAI oAGRRuNFyzUiRWiDfg4WV8QCOrb9YNye3ZLT/zFJNhI1ibJ1+hLZFyY6bel69SCP0aei sZhg== 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=8l+aJ1RcBwCjplYy8WbpWHdZstkv1JFGo7yCxqsN7kQ=; b=aIydB69ewTPnIJiT42b3DpF5qQ59saC4m0lx/yQw3ofSBRv7xsEuq0cQ9HSla60hBQ 9b8wmu7hcaQvEa3JUFF9lVD6SH+fqc40himufQ39axV53gabSaHjMCX/x+c8YveMHo+s E9Idl5LdyMleGiyzJejDaSiGHQph37osGBDfAJmSjQpVq7RGMUgodYWu5E+ryONLH5OG NUHsQtraN25g2sPgKg4QQb59ujszkcvUhaAGHwjbwKevdjYAsFpRtut1aMVDz1RCdyrX jBrr2Qc4C/QKQHb8bmCENGDRMeeWB7a8Xu0iZgGpkz87tofaE2QMIPbj3QCi/Atr60n5 erzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EAyKtnUA; 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 h20-20020a17090ac39400b002565804077bsi5474753pjt.32.2023.06.14.11.19.06; Wed, 14 Jun 2023 11:19:46 -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=EAyKtnUA; 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 S241175AbjFNSHC (ORCPT + 99 others); Wed, 14 Jun 2023 14:07:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241234AbjFNSFL (ORCPT ); Wed, 14 Jun 2023 14:05:11 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F5402126 for ; Wed, 14 Jun 2023 11:05:03 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4f76a223ca5so1042534e87.3 for ; Wed, 14 Jun 2023 11:05:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765901; x=1689357901; 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=8l+aJ1RcBwCjplYy8WbpWHdZstkv1JFGo7yCxqsN7kQ=; b=EAyKtnUAhoiXbQAF7TDo1fZILkxRhTI4PrTr3k2xMXSNgGIPMs84a1DgVtae7QDHV+ D2jBsilVRBZdQZU4Ji3/+QV/u0aVIDyQfi5pWr7vlkgaDYrSK0HXlJC+4gXnbyIrKxlT hxJyAFyQBDU4i7ttGJ7hnk1SXiiR5ra6GiGajblrDJk6hZnpAZD2mEnb9UnovIWXtXUA OP3aFTmJiJlIJ8TFHpVQ0LxrT8Om33j0wc2b3v6qitVdMAIPrCKycSUoPelal3yZrPyO O7Q46T9YKGRmazTbNFR757xq9mt02tZF1Id7YI7kzxGAz3oSG97gFRnKSBLGipcgTObt yrvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765901; x=1689357901; 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=8l+aJ1RcBwCjplYy8WbpWHdZstkv1JFGo7yCxqsN7kQ=; b=Qw33FVjK6NXP3kQq4Ob0wcEky9AFbLU0SuabWXFZV3pHVdk8BlMgzA1kOTRJ4Q0Z74 OoEtM2xtSbdBFaAGc4WF1HFNmSFuCZfYLh4YFy+6W2XT5s62Vsbc9G/YHvRAvqaVQ5+F WkLIwN9EI10tLo17d3Oc9nD5C3cYfkPSankwyKLiJwX2dyGkQcahl4jtJSbOJCzF4vaG 1BYEuoamSj9qS7R822btf4xk6FeiS44dIqjis/GvS4fjTUfQVLeDXVLQGcM9ZArfG0DY 7TaeSWyb5smkT15+LW//iP1+x8SP9/O0h+hRE53W3vgLKLtCHrS9bAwEQSRqi4Ow34w1 icCw== X-Gm-Message-State: AC+VfDxGXGpa09HV5He8oFFaMNyvYndaNDm86B9ZDQnHQtpCIJkQtxh6 IrgSvodsHfc0hmwj6rCuHuYsmw== X-Received: by 2002:a19:6704:0:b0:4f6:2199:57b4 with SMTP id b4-20020a196704000000b004f6219957b4mr8865350lfc.47.1686765901441; Wed, 14 Jun 2023 11:05:01 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.04.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:05:01 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:37 +0200 Subject: [PATCH v6 18/22] clk: qcom: smd-rpm: Separate out interconnect bus clocks MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-18-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765873; l=26677; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=b1fcpW1FguL43YfbPVvUZKbf1hq8/EEzu+HzcWkLj0U=; b=hFDnhaVnWPC9Pj3FTad0d0uis5YX59+WqBwtYJ6Rec3YL31t2pPb/Sd+0RfKjhakvOeoACXjh GY9a1QlyCF2CV7K7JlitG4FkTtfStd96mlRNFPvpVPCsqKkA+qtB2iw 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768703170047753611?= X-GMAIL-MSGID: =?utf-8?q?1768703170047753611?= The interconnect bus clocks are now handled within the ICC framework. They still however need to get a kickstart *before* we call clk_smd_rpm_enable_scaling(), or RPM will assume that they should all be running at 0 kHz and the system will inevitably die. Separate them out to ensure such a kickstart can still take place. As a happy accident, the file got smaller: Total: Before=41951, After=41555, chg -0.94% Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 278 +++++++++++++++++------------------------ 1 file changed, 115 insertions(+), 163 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index 6e7f0438e8b8..0d1d97659d59 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -167,6 +167,14 @@ struct clk_smd_rpm { struct rpm_smd_clk_desc { struct clk_smd_rpm **clks; size_t num_clks; + + /* + * Interconnect clocks are managed by the icc framework, this driver + * only kickstarts them so that they don't get gated between + * clk_smd_rpm_enable_scaling() and interconnect driver initialization. + */ + struct clk_smd_rpm **icc_clks; + size_t num_icc_clks; bool scaling_before_handover; }; @@ -498,13 +506,69 @@ DEFINE_CLK_SMD_RPM_XO_BUFFER(div_clk1, 11, 19200000); DEFINE_CLK_SMD_RPM_XO_BUFFER(div_clk2, 12, 19200000); DEFINE_CLK_SMD_RPM_XO_BUFFER(div_clk3, 13, 19200000); +static struct clk_smd_rpm *bimc_pcnoc_icc_clks[] = { + &clk_smd_rpm_bimc_clk, + &clk_smd_rpm_bus_0_pcnoc_clk, +}; + +static struct clk_smd_rpm *bimc_pcnoc_snoc_icc_clks[] = { + &clk_smd_rpm_bimc_clk, + &clk_smd_rpm_bus_0_pcnoc_clk, + &clk_smd_rpm_bus_1_snoc_clk, +}; + +static struct clk_smd_rpm *bimc_pcnoc_snoc_smmnoc_icc_clks[] = { + &clk_smd_rpm_bimc_clk, + &clk_smd_rpm_bus_0_pcnoc_clk, + &clk_smd_rpm_bus_1_snoc_clk, + &clk_smd_rpm_bus_2_sysmmnoc_clk, +}; + +static struct clk_smd_rpm *bimc_pcnoc_snoc_cnoc_ocmem_icc_clks[] = { + &clk_smd_rpm_bimc_clk, + &clk_smd_rpm_bus_0_pcnoc_clk, + &clk_smd_rpm_bus_1_snoc_clk, + &clk_smd_rpm_bus_2_cnoc_clk, + &clk_smd_rpm_ocmemgx_clk, +}; + +static struct clk_smd_rpm *msm8996_icc_clks[] = { + &clk_smd_rpm_bimc_clk, + &clk_smd_rpm_branch_aggre1_noc_clk, + &clk_smd_rpm_branch_aggre2_noc_clk, + &clk_smd_rpm_bus_0_pcnoc_clk, + &clk_smd_rpm_bus_1_snoc_clk, + &clk_smd_rpm_bus_2_cnoc_clk, + &clk_smd_rpm_mmssnoc_axi_rpm_clk, +}; + +static struct clk_smd_rpm *msm8998_icc_clks[] = { + &clk_smd_rpm_aggre1_noc_clk, + &clk_smd_rpm_aggre2_noc_clk, + &clk_smd_rpm_bimc_clk, + &clk_smd_rpm_bus_1_snoc_clk, + &clk_smd_rpm_bus_2_cnoc_clk, + &clk_smd_rpm_mmssnoc_axi_rpm_clk, +}; + +static struct clk_smd_rpm *sdm660_icc_clks[] = { + &clk_smd_rpm_aggre2_noc_clk, + &clk_smd_rpm_bimc_clk, + &clk_smd_rpm_bus_1_snoc_clk, + &clk_smd_rpm_bus_2_cnoc_clk, + &clk_smd_rpm_mmssnoc_axi_rpm_clk, +}; + +static struct clk_smd_rpm *sm_qnoc_icc_clks[] = { + &clk_smd_rpm_bimc_clk, + &clk_smd_rpm_bus_1_cnoc_clk, + &clk_smd_rpm_mmnrt_clk, + &clk_smd_rpm_mmrt_clk, + &clk_smd_rpm_qup_clk, + &clk_smd_rpm_bus_2_snoc_clk, +}; + static struct clk_smd_rpm *msm8909_clks[] = { - [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QPIC_CLK] = &clk_smd_rpm_qpic_clk, [RPM_SMD_QPIC_CLK_A] = &clk_smd_rpm_qpic_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, @@ -530,15 +594,11 @@ static struct clk_smd_rpm *msm8909_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8909 = { .clks = msm8909_clks, .num_clks = ARRAY_SIZE(msm8909_clks), + .icc_clks = bimc_pcnoc_snoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_icc_clks), }; static struct clk_smd_rpm *msm8916_clks[] = { - [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1, @@ -562,21 +622,15 @@ static struct clk_smd_rpm *msm8916_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8916 = { .clks = msm8916_clks, .num_clks = ARRAY_SIZE(msm8916_clks), + .icc_clks = bimc_pcnoc_snoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_icc_clks), }; static struct clk_smd_rpm *msm8917_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_BIMC_GPU_CLK] = &clk_smd_rpm_bimc_gpu_clk, [RPM_SMD_BIMC_GPU_A_CLK] = &clk_smd_rpm_bimc_gpu_a_clk, - [RPM_SMD_SYSMMNOC_CLK] = &clk_smd_rpm_bus_2_sysmmnoc_clk, - [RPM_SMD_SYSMMNOC_A_CLK] = &clk_smd_rpm_bus_2_sysmmnoc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1, @@ -596,19 +650,13 @@ static struct clk_smd_rpm *msm8917_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8917 = { .clks = msm8917_clks, .num_clks = ARRAY_SIZE(msm8917_clks), + .icc_clks = bimc_pcnoc_snoc_smmnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_smmnoc_icc_clks), }; static struct clk_smd_rpm *msm8936_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, - [RPM_SMD_SYSMMNOC_CLK] = &clk_smd_rpm_bus_2_sysmmnoc_clk, - [RPM_SMD_SYSMMNOC_A_CLK] = &clk_smd_rpm_bus_2_sysmmnoc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1, @@ -632,25 +680,17 @@ static struct clk_smd_rpm *msm8936_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8936 = { .clks = msm8936_clks, .num_clks = ARRAY_SIZE(msm8936_clks), + .icc_clks = bimc_pcnoc_snoc_smmnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_smmnoc_icc_clks), }; static struct clk_smd_rpm *msm8974_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_2_cnoc_a_clk, [RPM_SMD_MMSSNOC_AHB_CLK] = &clk_smd_rpm_bus_3_mmssnoc_ahb_clk, [RPM_SMD_MMSSNOC_AHB_A_CLK] = &clk_smd_rpm_bus_3_mmssnoc_ahb_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, [RPM_SMD_GFX3D_CLK_SRC] = &clk_smd_rpm_gfx3d_clk_src, [RPM_SMD_GFX3D_A_CLK_SRC] = &clk_smd_rpm_gfx3d_a_clk_src, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, - [RPM_SMD_OCMEMGX_CLK] = &clk_smd_rpm_ocmemgx_clk, - [RPM_SMD_OCMEMGX_A_CLK] = &clk_smd_rpm_ocmemgx_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_CXO_D0] = &clk_smd_rpm_cxo_d0, @@ -684,20 +724,14 @@ static struct clk_smd_rpm *msm8974_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8974 = { .clks = msm8974_clks, .num_clks = ARRAY_SIZE(msm8974_clks), + .icc_clks = bimc_pcnoc_snoc_cnoc_ocmem_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_cnoc_ocmem_icc_clks), .scaling_before_handover = true, }; static struct clk_smd_rpm *msm8976_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, - [RPM_SMD_SYSMMNOC_CLK] = &clk_smd_rpm_bus_2_sysmmnoc_clk, - [RPM_SMD_SYSMMNOC_A_CLK] = &clk_smd_rpm_bus_2_sysmmnoc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1, @@ -718,24 +752,15 @@ static struct clk_smd_rpm *msm8976_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8976 = { .clks = msm8976_clks, - .num_clks = ARRAY_SIZE(msm8976_clks), + .icc_clks = bimc_pcnoc_snoc_smmnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_smmnoc_icc_clks), }; static struct clk_smd_rpm *msm8992_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_OCMEMGX_CLK] = &clk_smd_rpm_ocmemgx_clk, - [RPM_SMD_OCMEMGX_A_CLK] = &clk_smd_rpm_ocmemgx_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_2_cnoc_a_clk, [RPM_SMD_GFX3D_CLK_SRC] = &clk_smd_rpm_gfx3d_clk_src, [RPM_SMD_GFX3D_A_CLK_SRC] = &clk_smd_rpm_gfx3d_a_clk_src, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1, [RPM_SMD_BB_CLK1_A] = &clk_smd_rpm_bb_clk1_a, [RPM_SMD_BB_CLK1_PIN] = &clk_smd_rpm_bb_clk1_pin, @@ -777,23 +802,15 @@ static struct clk_smd_rpm *msm8992_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8992 = { .clks = msm8992_clks, .num_clks = ARRAY_SIZE(msm8992_clks), + .icc_clks = bimc_pcnoc_snoc_cnoc_ocmem_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_cnoc_ocmem_icc_clks), }; static struct clk_smd_rpm *msm8994_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_OCMEMGX_CLK] = &clk_smd_rpm_ocmemgx_clk, - [RPM_SMD_OCMEMGX_A_CLK] = &clk_smd_rpm_ocmemgx_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_2_cnoc_a_clk, [RPM_SMD_GFX3D_CLK_SRC] = &clk_smd_rpm_gfx3d_clk_src, [RPM_SMD_GFX3D_A_CLK_SRC] = &clk_smd_rpm_gfx3d_a_clk_src, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1, [RPM_SMD_BB_CLK1_A] = &clk_smd_rpm_bb_clk1_a, [RPM_SMD_BB_CLK1_PIN] = &clk_smd_rpm_bb_clk1_pin, @@ -837,29 +854,17 @@ static struct clk_smd_rpm *msm8994_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8994 = { .clks = msm8994_clks, .num_clks = ARRAY_SIZE(msm8994_clks), + .icc_clks = bimc_pcnoc_snoc_cnoc_ocmem_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_cnoc_ocmem_icc_clks), }; static struct clk_smd_rpm *msm8996_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_2_cnoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, - [RPM_SMD_MMAXI_CLK] = &clk_smd_rpm_mmssnoc_axi_rpm_clk, - [RPM_SMD_MMAXI_A_CLK] = &clk_smd_rpm_mmssnoc_axi_rpm_a_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, [RPM_SMD_CE1_CLK] = &clk_smd_rpm_ce1_clk, [RPM_SMD_CE1_A_CLK] = &clk_smd_rpm_ce1_a_clk, - [RPM_SMD_AGGR1_NOC_CLK] = &clk_smd_rpm_branch_aggre1_noc_clk, - [RPM_SMD_AGGR1_NOC_A_CLK] = &clk_smd_rpm_branch_aggre1_noc_a_clk, - [RPM_SMD_AGGR2_NOC_CLK] = &clk_smd_rpm_branch_aggre2_noc_clk, - [RPM_SMD_AGGR2_NOC_A_CLK] = &clk_smd_rpm_branch_aggre2_noc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1, @@ -891,6 +896,8 @@ static struct clk_smd_rpm *msm8996_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8996 = { .clks = msm8996_clks, .num_clks = ARRAY_SIZE(msm8996_clks), + .icc_clks = msm8996_icc_clks, + .num_icc_clks = ARRAY_SIZE(msm8996_icc_clks), }; static struct clk_smd_rpm *qcs404_clks[] = { @@ -919,19 +926,15 @@ static struct clk_smd_rpm *qcs404_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_qcs404 = { .clks = qcs404_clks, .num_clks = ARRAY_SIZE(qcs404_clks), + .icc_clks = bimc_pcnoc_snoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_icc_clks), }; static struct clk_smd_rpm *msm8998_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_2_cnoc_a_clk, [RPM_SMD_CE1_CLK] = &clk_smd_rpm_ce1_clk, [RPM_SMD_CE1_A_CLK] = &clk_smd_rpm_ce1_a_clk, [RPM_SMD_DIV_CLK1] = &clk_smd_rpm_div_clk1, @@ -954,12 +957,6 @@ static struct clk_smd_rpm *msm8998_clks[] = { [RPM_SMD_LN_BB_CLK2_A_PIN] = &clk_smd_rpm_ln_bb_clk2_a_pin, [RPM_SMD_LN_BB_CLK3_PIN] = &clk_smd_rpm_ln_bb_clk3_pin, [RPM_SMD_LN_BB_CLK3_A_PIN] = &clk_smd_rpm_ln_bb_clk3_a_pin, - [RPM_SMD_MMAXI_CLK] = &clk_smd_rpm_mmssnoc_axi_rpm_clk, - [RPM_SMD_MMAXI_A_CLK] = &clk_smd_rpm_mmssnoc_axi_rpm_a_clk, - [RPM_SMD_AGGR1_NOC_CLK] = &clk_smd_rpm_aggre1_noc_clk, - [RPM_SMD_AGGR1_NOC_A_CLK] = &clk_smd_rpm_aggre1_noc_a_clk, - [RPM_SMD_AGGR2_NOC_CLK] = &clk_smd_rpm_aggre2_noc_clk, - [RPM_SMD_AGGR2_NOC_A_CLK] = &clk_smd_rpm_aggre2_noc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_RF_CLK1] = &clk_smd_rpm_rf_clk1, @@ -979,27 +976,19 @@ static struct clk_smd_rpm *msm8998_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8998 = { .clks = msm8998_clks, .num_clks = ARRAY_SIZE(msm8998_clks), + .icc_clks = msm8998_icc_clks, + .num_icc_clks = ARRAY_SIZE(msm8998_icc_clks), }; static struct clk_smd_rpm *sdm660_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_2_cnoc_a_clk, [RPM_SMD_CNOC_PERIPH_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, [RPM_SMD_CNOC_PERIPH_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, - [RPM_SMD_MMSSNOC_AXI_CLK] = &clk_smd_rpm_mmssnoc_axi_rpm_clk, - [RPM_SMD_MMSSNOC_AXI_CLK_A] = &clk_smd_rpm_mmssnoc_axi_rpm_a_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, [RPM_SMD_CE1_CLK] = &clk_smd_rpm_ce1_clk, [RPM_SMD_CE1_A_CLK] = &clk_smd_rpm_ce1_a_clk, - [RPM_SMD_AGGR2_NOC_CLK] = &clk_smd_rpm_aggre2_noc_clk, - [RPM_SMD_AGGR2_NOC_A_CLK] = &clk_smd_rpm_aggre2_noc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_RF_CLK1] = &clk_smd_rpm_rf_clk1, @@ -1025,15 +1014,13 @@ static struct clk_smd_rpm *sdm660_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_sdm660 = { .clks = sdm660_clks, .num_clks = ARRAY_SIZE(sdm660_clks), + .icc_clks = sdm660_icc_clks, + .num_icc_clks = ARRAY_SIZE(sdm660_icc_clks), }; static struct clk_smd_rpm *mdm9607_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QPIC_CLK] = &clk_smd_rpm_qpic_clk, [RPM_SMD_QPIC_CLK_A] = &clk_smd_rpm_qpic_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, @@ -1047,21 +1034,15 @@ static struct clk_smd_rpm *mdm9607_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_mdm9607 = { .clks = mdm9607_clks, .num_clks = ARRAY_SIZE(mdm9607_clks), + .icc_clks = bimc_pcnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_icc_clks), }; static struct clk_smd_rpm *msm8953_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, - [RPM_SMD_SYSMMNOC_CLK] = &clk_smd_rpm_bus_2_sysmmnoc_clk, - [RPM_SMD_SYSMMNOC_A_CLK] = &clk_smd_rpm_bus_2_sysmmnoc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1, @@ -1083,23 +1064,19 @@ static struct clk_smd_rpm *msm8953_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8953 = { .clks = msm8953_clks, .num_clks = ARRAY_SIZE(msm8953_clks), + .icc_clks = bimc_pcnoc_snoc_smmnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_smmnoc_icc_clks), }; static struct clk_smd_rpm *sm6125_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_2_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_branch_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_branch_qdss_a_clk, [RPM_SMD_RF_CLK1] = &clk_smd_rpm_rf_clk1, [RPM_SMD_RF_CLK1_A] = &clk_smd_rpm_rf_clk1_a, [RPM_SMD_RF_CLK2] = &clk_smd_rpm_rf_clk2, [RPM_SMD_RF_CLK2_A] = &clk_smd_rpm_rf_clk2_a, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_1_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, [RPM_SMD_CE1_CLK] = &clk_smd_rpm_ce1_clk, @@ -1110,12 +1087,6 @@ static struct clk_smd_rpm *sm6125_clks[] = { [RPM_SMD_LN_BB_CLK2_A] = &clk_smd_rpm_ln_bb_clk2_a, [RPM_SMD_LN_BB_CLK3] = &clk_smd_rpm_ln_bb_clk3, [RPM_SMD_LN_BB_CLK3_A] = &clk_smd_rpm_ln_bb_clk3_a, - [RPM_SMD_QUP_CLK] = &clk_smd_rpm_qup_clk, - [RPM_SMD_QUP_A_CLK] = &clk_smd_rpm_qup_a_clk, - [RPM_SMD_MMRT_CLK] = &clk_smd_rpm_mmrt_clk, - [RPM_SMD_MMRT_A_CLK] = &clk_smd_rpm_mmrt_a_clk, - [RPM_SMD_MMNRT_CLK] = &clk_smd_rpm_mmnrt_clk, - [RPM_SMD_MMNRT_A_CLK] = &clk_smd_rpm_mmnrt_a_clk, [RPM_SMD_SNOC_PERIPH_CLK] = &clk_smd_rpm_bus_0_snoc_periph_clk, [RPM_SMD_SNOC_PERIPH_A_CLK] = &clk_smd_rpm_bus_0_snoc_periph_a_clk, [RPM_SMD_SNOC_LPASS_CLK] = &clk_smd_rpm_bus_5_snoc_lpass_clk, @@ -1125,34 +1096,24 @@ static struct clk_smd_rpm *sm6125_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_sm6125 = { .clks = sm6125_clks, .num_clks = ARRAY_SIZE(sm6125_clks), + .icc_clks = sm_qnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(sm_qnoc_icc_clks) }; /* SM6115 */ static struct clk_smd_rpm *sm6115_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_2_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_branch_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_branch_qdss_a_clk, [RPM_SMD_RF_CLK1] = &clk_smd_rpm_rf_clk1, [RPM_SMD_RF_CLK1_A] = &clk_smd_rpm_rf_clk1_a, [RPM_SMD_RF_CLK2] = &clk_smd_rpm_rf_clk2, [RPM_SMD_RF_CLK2_A] = &clk_smd_rpm_rf_clk2_a, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_1_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, [RPM_SMD_CE1_CLK] = &clk_smd_rpm_ce1_clk, [RPM_SMD_CE1_A_CLK] = &clk_smd_rpm_ce1_a_clk, - [RPM_SMD_QUP_CLK] = &clk_smd_rpm_qup_clk, - [RPM_SMD_QUP_A_CLK] = &clk_smd_rpm_qup_a_clk, - [RPM_SMD_MMRT_CLK] = &clk_smd_rpm_mmrt_clk, - [RPM_SMD_MMRT_A_CLK] = &clk_smd_rpm_mmrt_a_clk, - [RPM_SMD_MMNRT_CLK] = &clk_smd_rpm_mmnrt_clk, - [RPM_SMD_MMNRT_A_CLK] = &clk_smd_rpm_mmnrt_a_clk, [RPM_SMD_SNOC_PERIPH_CLK] = &clk_smd_rpm_bus_0_snoc_periph_clk, [RPM_SMD_SNOC_PERIPH_A_CLK] = &clk_smd_rpm_bus_0_snoc_periph_a_clk, [RPM_SMD_SNOC_LPASS_CLK] = &clk_smd_rpm_bus_5_snoc_lpass_clk, @@ -1166,27 +1127,17 @@ static struct clk_smd_rpm *sm6115_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_sm6115 = { .clks = sm6115_clks, .num_clks = ARRAY_SIZE(sm6115_clks), + .icc_clks = sm_qnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(sm_qnoc_icc_clks) }; static struct clk_smd_rpm *sm6375_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_2_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_branch_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_branch_qdss_a_clk, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_1_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, - [RPM_SMD_QUP_CLK] = &clk_smd_rpm_qup_clk, - [RPM_SMD_QUP_A_CLK] = &clk_smd_rpm_qup_a_clk, - [RPM_SMD_MMRT_CLK] = &clk_smd_rpm_mmrt_clk, - [RPM_SMD_MMRT_A_CLK] = &clk_smd_rpm_mmrt_a_clk, - [RPM_SMD_MMNRT_CLK] = &clk_smd_rpm_mmnrt_clk, - [RPM_SMD_MMNRT_A_CLK] = &clk_smd_rpm_mmnrt_a_clk, [RPM_SMD_SNOC_PERIPH_CLK] = &clk_smd_rpm_bus_0_snoc_periph_clk, [RPM_SMD_SNOC_PERIPH_A_CLK] = &clk_smd_rpm_bus_0_snoc_periph_a_clk, [RPM_SMD_SNOC_LPASS_CLK] = &clk_smd_rpm_bus_5_snoc_lpass_clk, @@ -1203,31 +1154,21 @@ static struct clk_smd_rpm *sm6375_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_sm6375 = { .clks = sm6375_clks, .num_clks = ARRAY_SIZE(sm6375_clks), + .icc_clks = sm_qnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(sm_qnoc_icc_clks) }; static struct clk_smd_rpm *qcm2290_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_2_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_branch_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_branch_qdss_a_clk, [RPM_SMD_LN_BB_CLK2] = &clk_smd_rpm_ln_bb_clk2, [RPM_SMD_LN_BB_CLK2_A] = &clk_smd_rpm_ln_bb_clk2_a, [RPM_SMD_RF_CLK3] = &clk_smd_rpm_38m4_rf_clk3, [RPM_SMD_RF_CLK3_A] = &clk_smd_rpm_38m4_rf_clk3_a, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_1_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, - [RPM_SMD_QUP_CLK] = &clk_smd_rpm_qup_clk, - [RPM_SMD_QUP_A_CLK] = &clk_smd_rpm_qup_a_clk, - [RPM_SMD_MMRT_CLK] = &clk_smd_rpm_mmrt_clk, - [RPM_SMD_MMRT_A_CLK] = &clk_smd_rpm_mmrt_a_clk, - [RPM_SMD_MMNRT_CLK] = &clk_smd_rpm_mmnrt_clk, - [RPM_SMD_MMNRT_A_CLK] = &clk_smd_rpm_mmnrt_a_clk, [RPM_SMD_SNOC_PERIPH_CLK] = &clk_smd_rpm_bus_0_snoc_periph_clk, [RPM_SMD_SNOC_PERIPH_A_CLK] = &clk_smd_rpm_bus_0_snoc_periph_a_clk, [RPM_SMD_SNOC_LPASS_CLK] = &clk_smd_rpm_bus_5_snoc_lpass_clk, @@ -1249,6 +1190,8 @@ static struct clk_smd_rpm *qcm2290_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_qcm2290 = { .clks = qcm2290_clks, .num_clks = ARRAY_SIZE(qcm2290_clks), + .icc_clks = sm_qnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(sm_qnoc_icc_clks) }; static const struct of_device_id rpm_smd_clk_match_table[] = { @@ -1332,6 +1275,15 @@ static int rpm_smd_clk_probe(struct platform_device *pdev) goto err; } + for (i = 0; i < desc->num_icc_clks; i++) { + if (!desc->icc_clks[i]) + continue; + + ret = clk_smd_rpm_handoff(desc->icc_clks[i]); + if (ret) + goto err; + } + if (!desc->scaling_before_handover) { ret = clk_smd_rpm_enable_scaling(); if (ret) From patchwork Wed Jun 14 18:04:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108096 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp150365vqr; Wed, 14 Jun 2023 11:33:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5s2zoklHid5QPLVI4OVjEiW0Fyyys10jsrxK7fqM7MsRheceYNrJIlxJCkiviB1IbaTcGy X-Received: by 2002:a05:6a00:2303:b0:657:bdf1:cce1 with SMTP id h3-20020a056a00230300b00657bdf1cce1mr3129149pfh.25.1686767618174; Wed, 14 Jun 2023 11:33:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686767618; cv=none; d=google.com; s=arc-20160816; b=U+UhlHajYt+qZga1LOXgbiH2Be0PpWSbPs8mb5yGuvdgW+H/MHcrJgi2U9DaYF93z6 XcwS+UpsYBzWSFhAcjH2fpu32UKlF4dH0Zqf3p3i6ywgSS9793ecyTll2bjCWqfhZvXN hxu2k05UQWsfOjzFSY0RRZvKHgM3r3ixQXN8S3StYJfWgaiU9tv9/s8ccSFp2TtNEwI+ jwCrhbGyBptu/mhUITeIAcezoYsM130YprZSk0rYASFkfGT21RyQQdFum5rSHmBsUYSR TKM8rcNTOl5E0pFcPtFmYihAGWLI5uXc7YdfTEm1barIZojeU655OWIY3wP6ph4M75sM qOcA== 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=99eTqcvgBaxUe9wKghnaXt5XusNnY2akCNbpdNNpTEY=; b=fyI/j2ELUhYAgQWt3E/WY8rapkdoODtwD/7m4IttSupVLziEy3sWkqwc2v+1sumFmv nBGOlUB669d53oh9MsergDWykuJ3nBJqazrFDwkw7UI2P0IorlKfZbM5rCrXjoxWTh3Y tvhzvlEMC+4ZioekmcatsdY48dznhYEbiUkWoJHc1ng/KDgJaQivuFNjWYDeHITP6L1m mKOQciqPxQBcaY1+CxFOcFudskPBiHilRYX6lCHKrRIsra36HEqzF3/ATjROgSDPgZHK mWM4rTujDfb7C8y6UnPRiVOfPGmxDO1Krb1HA9G/TscKeLv2xhf3puYejYoyzhCkGzsl KVTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KM8mzwJJ; 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 c1-20020a637241000000b005481915c0c6si74018pgn.31.2023.06.14.11.33.21; Wed, 14 Jun 2023 11:33: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=KM8mzwJJ; 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 S234275AbjFNSHJ (ORCPT + 99 others); Wed, 14 Jun 2023 14:07:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241422AbjFNSFN (ORCPT ); Wed, 14 Jun 2023 14:05:13 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7918E211F for ; Wed, 14 Jun 2023 11:05:04 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f655293a38so8762428e87.0 for ; Wed, 14 Jun 2023 11:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765903; x=1689357903; 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=99eTqcvgBaxUe9wKghnaXt5XusNnY2akCNbpdNNpTEY=; b=KM8mzwJJLTIOXAdX+zo6TJQ7C4krxBOV8/7YVT5ywpIS4pBNpzlABXAgyRhkL8As7Y qQWRe4lsCGeQr5tP8UjHd3L9qyd8BxAwYJ7SsWj/WpFTWcC6oKd1o7EFBU+FSmj5kgNX ICuxNHHLrJPqG/YmtYexL1xjJuCJCxy5rHXVgKtBJL7z3QTY+oiMTy+YwAL9eFLFn+vw i10JgIL409eRLge5tApqDZ/qtq7Rd7PEo2g87fSE77ZGJPVD1urQqd74i6XZVu0Yi5jW doGv3GiG8vCr7mf7NrX1doQToyEB75boWxUj2w6eR6qmNhKtSgi/rWw0BADjA4GuSqwY QDSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765903; x=1689357903; 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=99eTqcvgBaxUe9wKghnaXt5XusNnY2akCNbpdNNpTEY=; b=Uar79VZ02xBjGectoywHoAyppIi38d8L9VJBdGpOxZpObSHi8F9OZrtDYWqhZZuchi OsfGHyO0fwLrScFQ9eFhRyDR3jM1OEb4cWUgL+ptls993gEwcUClCyfi8Y847BcTSTP+ 1WiYFOjNdhvDQWXX/4ym7NzC5hbAPBdgDhe0i6eL2zuRt7B6bajGSH45Nq/kaEpJQ9T3 JpETDCx9klJIyjQHdNK/zb3rBIYZc+cV0qgaGd1lTFVRxJkI+PITHfCjw8pB8lyJ2sWY uhIi15CFDLZXq5i/FaCvCdivZj+SeQmLmp0GLPBl1bJgdpEO05SQPKBm8LU0LKyLe29h J2mA== X-Gm-Message-State: AC+VfDwW7QtPtx6ytwjP7b+i3OpfspjTVbI2TiyeWjeKrbMymx9DYVHB G6YAH78gC1wB3LBmwVt8u4Lwyw== X-Received: by 2002:a05:6512:458:b0:4f3:a0f5:92e5 with SMTP id y24-20020a056512045800b004f3a0f592e5mr9019503lfk.31.1686765902837; Wed, 14 Jun 2023 11:05:02 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.05.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:05:02 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:38 +0200 Subject: [PATCH v6 19/22] interconnect: qcom: icc-rpm: Fix bucket number MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-19-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov , Stephan Gerhold X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765873; l=4064; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=mN8q2qvO4mMd/JKi78DO37g2U1aTQESNDTlLHNHgtNU=; b=lNsPsigredB7X48DopX1qYkaLDR7R22vZUUdwIzHmM5rhhxEPZG3XkthhwVRWGtZcTl8SMXCF /bieo0wE1r3ClaB2Kqx9dyrMME1uC7hU72A9gD6MNyT0KA0J/FegPK/ 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768704041884907057?= X-GMAIL-MSGID: =?utf-8?q?1768704041884907057?= SMD RPM only provides two buckets, one each for the active-only and active-sleep RPM contexts. Use the correct constant to allocate and operate on them. This will make the qcom,icc.h header no longer work with this driver, mostly because.. it was never meant to! The commit that introduced bucket support to SMD RPM was trying to shove a square into a round hole and it did not work out very well. That said, there are no active users of SMD RPM ICC + qcom,icc.h, so that doesn't hurt. Fixes: dcbce7b0a79c ("interconnect: qcom: icc-rpm: Support multiple buckets") Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephan Gerhold Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 16 ++++++++-------- drivers/interconnect/qcom/icc-rpm.h | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 60e4eab8855a..5f3bbe7e6a0d 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -248,7 +248,7 @@ static void qcom_icc_pre_bw_aggregate(struct icc_node *node) size_t i; qn = node->data; - for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) { + for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) { qn->sum_avg[i] = 0; qn->max_peak[i] = 0; } @@ -272,9 +272,9 @@ static int qcom_icc_bw_aggregate(struct icc_node *node, u32 tag, u32 avg_bw, qn = node->data; if (!tag) - tag = QCOM_ICC_TAG_ALWAYS; + tag = RPM_ALWAYS_TAG; - for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) { + for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) { if (tag & BIT(i)) { qn->sum_avg[i] += avg_bw; qn->max_peak[i] = max_t(u32, qn->max_peak[i], peak_bw); @@ -299,11 +299,11 @@ static void qcom_icc_bus_aggregate(struct icc_provider *provider, { struct icc_node *node; struct qcom_icc_node *qn; - u64 sum_avg[QCOM_ICC_NUM_BUCKETS]; + u64 sum_avg[QCOM_SMD_RPM_STATE_NUM]; int i; /* Initialise aggregate values */ - for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) { + for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) { agg_avg[i] = 0; agg_peak[i] = 0; } @@ -316,7 +316,7 @@ static void qcom_icc_bus_aggregate(struct icc_provider *provider, */ list_for_each_entry(node, &provider->nodes, node_list) { qn = node->data; - for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) { + for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) { if (qn->channels) sum_avg[i] = div_u64(qn->sum_avg[i], qn->channels); else @@ -327,7 +327,7 @@ static void qcom_icc_bus_aggregate(struct icc_provider *provider, } /* Find maximum values across all buckets */ - for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) + for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) *max_agg_avg = max_t(u64, *max_agg_avg, agg_avg[i]); } @@ -338,7 +338,7 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) struct icc_provider *provider; u64 sum_bw; u64 active_rate, sleep_rate; - u64 agg_avg[QCOM_ICC_NUM_BUCKETS], agg_peak[QCOM_ICC_NUM_BUCKETS]; + u64 agg_avg[QCOM_SMD_RPM_STATE_NUM], agg_peak[QCOM_SMD_RPM_STATE_NUM]; u64 max_agg_avg; int ret; diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index e3b0aa9fff3e..eed3451af3e6 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -8,7 +8,7 @@ #include -#include +#include #include #include #include @@ -106,8 +106,8 @@ struct qcom_icc_node { u16 num_links; u16 channels; u16 buswidth; - u64 sum_avg[QCOM_ICC_NUM_BUCKETS]; - u64 max_peak[QCOM_ICC_NUM_BUCKETS]; + u64 sum_avg[QCOM_SMD_RPM_STATE_NUM]; + u64 max_peak[QCOM_SMD_RPM_STATE_NUM]; int mas_rpm_id; int slv_rpm_id; struct qcom_icc_qos qos; From patchwork Wed Jun 14 18:04:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108113 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp155012vqr; Wed, 14 Jun 2023 11:43:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4pPrrb+Z2RnvOBdkQqW21aYpBtLgU5Hj0p45Ja23bwEn4+Nl8idH+yY09TBYPK9RBGvZJW X-Received: by 2002:a17:90a:13c6:b0:25b:8c02:13f4 with SMTP id s6-20020a17090a13c600b0025b8c0213f4mr1995762pjf.38.1686768203575; Wed, 14 Jun 2023 11:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686768203; cv=none; d=google.com; s=arc-20160816; b=T3M34eVTLmOMOos9vaN2vC6mXxMJsCxST+ml3iZdFuEzouCJebTSdC9jjK3ZxpiHGo mBMer+YDekcXwW1J4tPMvFDXI1a9wHrCVkLN0B8m0+kMSi/GbWlqzV4n0wZZcc3lUfno UXDtc3Ldrw/ANc+tVBwAzXEvGz/oYhkkANj14LHRDLtCDCapn1BYd4+JJ1gpLanHLw3k 4Nx+HNMUONF15ImvNj6b44hispuLazMkPWSwdavMOyS8ezxI/VHFj3LFxnCJ/NjrEN+H ZhL12kpfrkl1sfI73nT1yRvqDTsgb/1/sZbWt7e2p529lg1LLlWGTvUMAEe9JDm61W4t 7BwQ== 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=p7wfrKtOuiG3iOR2rZXazcj4Xb5KmwKNQQmAN1Tw0Tc=; b=G8BQTqnTlf/EZ5cj2hjlKHh7ajWm83V3pKtkmYWF3DCsqS1ClzfZ1Getbqvu3in6O/ 2HFdmQ7t0koifxpNk4o3Vh4oVVu8yA4S2Y6BQpl3VjENjD3sDFTQUrsxU8YkeVUOaqJC xhCHYSbgUiZQlF1/vabM8YjRLrnktVxHJFcsp8o6nIV4evcGusA2obPNnN9GtZLLwtUZ wqpt3VcZ51N1cKJok9eQg8rawO2OVqlIJKz9byqNcOp4owxrJFOG/FDoJGTuhT3NhC63 6L0H04kRVXzzupUtFTwWqlQZ2yVaRG91j6GPc3V3hQpx4VVz+vN6LDLbcC+IrzqHnG8b ZYYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dtaa1qLd; 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 s7-20020a17090a948700b0024686879af0si6713522pjo.169.2023.06.14.11.42.56; Wed, 14 Jun 2023 11:43:23 -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=dtaa1qLd; 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 S242074AbjFNSHM (ORCPT + 99 others); Wed, 14 Jun 2023 14:07:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241570AbjFNSFO (ORCPT ); Wed, 14 Jun 2023 14:05:14 -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 CAB002118 for ; Wed, 14 Jun 2023 11:05:05 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f63ab1ac4aso9007950e87.0 for ; Wed, 14 Jun 2023 11:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765904; x=1689357904; 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=p7wfrKtOuiG3iOR2rZXazcj4Xb5KmwKNQQmAN1Tw0Tc=; b=dtaa1qLdBJn9FVCuq6V7om4iAj14TdzP2WZ15HKihThdEmIg0Dew2TaKK0g/4z5YgA XyEf6BzRjNqWyTVrYX1cRiOEBuLQsRm0lJ/CyniRtH72K/HoBzVOrhzQ+ZlPm0YiuZPe sScQZhRE5d03EFjnGm1HUIP9SdkaYAs2W3YqdcD0XJvEbks3hejQ1aDgQ2aKiEFzwtXm NYqdcb2PWedk3+/m3OJNe3IvYPfLG4LEysaGxwvoGNd9+Kv5gIWcJGxtFMNFDBY/8KSw Wbkcij3KZwrvRQ98GKYfk33eEkx4bzltiltZlffupHSmzlFoBXgwiZ2YCjcwAio1pVRJ UBPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765904; x=1689357904; 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=p7wfrKtOuiG3iOR2rZXazcj4Xb5KmwKNQQmAN1Tw0Tc=; b=lFUMpfIOorsTxyZOtpA4+8cjLBfbqJb3yhysrqRaOOmSK30MiTg5UFvjMkjJgkFRya tQOo4WF4zj9IpU/VOleOOoPooyJCZTcKgPf9Mc7tG3IdOfcVyCF5+922bJzb3yK3AHLk amEVnhO+RLNTE4mvT14dioQUp/1IDLo33sa+RA6nIT7lCJ/pICV/CQ22ckXYb6/3m43h FdKwUvEmv76p8Mr90QsKDhdeb4DHmNljY5ZB/JekoDRNBBepRCUjjRgozgxvnGBX4esO lS+Gj+Z1popiuv1wzrg9EeJC1VCuseQkN6o7h5YKrkGfkVyYu3ajoiWF926Vw8+KSOPu fiNQ== X-Gm-Message-State: AC+VfDzTd9NSXwmExfgb9gSE5YBV8DitREcON5wZJvjdxCVYtwfuEoi+ mNbr580BBg/D2qNBwfdeE4JHlw== X-Received: by 2002:a19:4316:0:b0:4f1:866d:9b01 with SMTP id q22-20020a194316000000b004f1866d9b01mr7179579lfa.3.1686765904196; Wed, 14 Jun 2023 11:05:04 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:05:03 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:39 +0200 Subject: [PATCH v6 20/22] interconnect: qcom: icc-rpm: Set bandwidth on both contexts MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-20-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Stephan Gerhold X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765873; l=3364; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=bsPoz7/6rYieWdNaInRGuWSci4TnSHDkv7Qn8EyapGs=; b=S0bXzGhxJVHt1NWjywKU1NnF7/fNUBDhII8jxTuDH6VA+zH5Zm1LDmj068/IUYsd6DdIrd4FG GYcLSuL+QrUDfnyyuftgMnVilv4IAXYPfvduTC+q2qceBw+I/oBsgdB 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768704655943883692?= X-GMAIL-MSGID: =?utf-8?q?1768704655943883692?= Up until now, for some reason we've only been setting bandwidth values on the active-only context. That pretty much meant that RPM could lift all votes when entering sleep mode. Or never sleep at all. That in turn could potentially break things like USB wakeup, as the connection between APSS and SNoC/PNoC would simply be dead. Set the values appropriately. Fixes: 30c8fa3ec61a ("interconnect: qcom: Add MSM8916 interconnect provider driver") Reviewed-by: Stephan Gerhold Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 54 +++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 5f3bbe7e6a0d..928dc27c1d93 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -204,34 +204,39 @@ static int qcom_icc_qos_set(struct icc_node *node) } } -static int qcom_icc_rpm_set(struct qcom_icc_node *qn, u64 sum_bw) +static int qcom_icc_rpm_set(struct qcom_icc_node *qn, u64 *bw) { - int ret = 0; + int ret, rpm_ctx = 0; + u64 bw_bps; if (qn->qos.ap_owned) return 0; - if (qn->mas_rpm_id != -1) { - ret = qcom_icc_rpm_smd_send(QCOM_SMD_RPM_ACTIVE_STATE, - RPM_BUS_MASTER_REQ, - qn->mas_rpm_id, - sum_bw); - if (ret) { - pr_err("qcom_icc_rpm_smd_send mas %d error %d\n", - qn->mas_rpm_id, ret); - return ret; + for (rpm_ctx = 0; rpm_ctx < QCOM_SMD_RPM_STATE_NUM; rpm_ctx++) { + bw_bps = icc_units_to_bps(bw[rpm_ctx]); + + if (qn->mas_rpm_id != -1) { + ret = qcom_icc_rpm_smd_send(rpm_ctx, + RPM_BUS_MASTER_REQ, + qn->mas_rpm_id, + bw_bps); + if (ret) { + pr_err("qcom_icc_rpm_smd_send mas %d error %d\n", + qn->mas_rpm_id, ret); + return ret; + } } - } - if (qn->slv_rpm_id != -1) { - ret = qcom_icc_rpm_smd_send(QCOM_SMD_RPM_ACTIVE_STATE, - RPM_BUS_SLAVE_REQ, - qn->slv_rpm_id, - sum_bw); - if (ret) { - pr_err("qcom_icc_rpm_smd_send slv %d error %d\n", - qn->slv_rpm_id, ret); - return ret; + if (qn->slv_rpm_id != -1) { + ret = qcom_icc_rpm_smd_send(rpm_ctx, + RPM_BUS_SLAVE_REQ, + qn->slv_rpm_id, + bw_bps); + if (ret) { + pr_err("qcom_icc_rpm_smd_send slv %d error %d\n", + qn->slv_rpm_id, ret); + return ret; + } } } @@ -336,7 +341,6 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) struct qcom_icc_provider *qp; struct qcom_icc_node *src_qn = NULL, *dst_qn = NULL; struct icc_provider *provider; - u64 sum_bw; u64 active_rate, sleep_rate; u64 agg_avg[QCOM_SMD_RPM_STATE_NUM], agg_peak[QCOM_SMD_RPM_STATE_NUM]; u64 max_agg_avg; @@ -350,14 +354,12 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) qcom_icc_bus_aggregate(provider, agg_avg, agg_peak, &max_agg_avg); - sum_bw = icc_units_to_bps(max_agg_avg); - - ret = qcom_icc_rpm_set(src_qn, sum_bw); + ret = qcom_icc_rpm_set(src_qn, agg_avg); if (ret) return ret; if (dst_qn) { - ret = qcom_icc_rpm_set(dst_qn, sum_bw); + ret = qcom_icc_rpm_set(dst_qn, agg_avg); if (ret) return ret; } From patchwork Wed Jun 14 18:04:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108100 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp153699vqr; Wed, 14 Jun 2023 11:40:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4q7Pj7bcTOGCz/q6PJjfQD6A2kDrlTNbjw9oirheoJFvLQgAEVQkzUJCRRdilY3al9n/Qz X-Received: by 2002:a17:902:b489:b0:1b3:7de7:f83f with SMTP id y9-20020a170902b48900b001b37de7f83fmr11919271plr.26.1686768025576; Wed, 14 Jun 2023 11:40:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686768025; cv=none; d=google.com; s=arc-20160816; b=jqSvRvTf+e5a3pPewKmzfjr5nwN0juyw3YDiKs+/8TlYnY5+SG1NH80GdsiNDaY+h4 zc3utK36v1qfxIp82v24v9wdQ74ZUJ6mGh9i8expfZrwltkJOB0LcUC8UI6EFmE5Cin3 s+EtLexZ/KZrzUKcnu8gzRfyg+DSvT5eiwzDNq+Uo9NjUvvHIbjHrjDAPlsV6AaJTym8 U7kqv9zl5zPl4xXtA0UpsH08fr18fc9BoMn7j7HaU3ZInA5NvZdEDQzETLyxEYoFfsN2 8TczqZ8S5LSpxREnlzPdovYJogd1VNCdNJjHHZLMReuxzbG+oYzepQfkraNXfXI13JYC wlIA== 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=0jK7Krh6d5glAjoREUgnuuxQiDYi3CDuObLr2ly9o6k=; b=IGdzJ80EcFaEZSEuEMQSxH6AFFZrckaT9HDtREfBac2PH44E1c4tn4FBkcDyMs7V07 PJ05QuRBq2S/EDaW5D38lP68lRhllEeTVmtEw8rN7FHTtCkwzykbbZFzn7JOcLrJUsCe bcLsNOFWYd1HM80uE3WDejI0mPn0kJppVBJ+Fn9h9k/s9M3rF3KTVVbaCPep0lR2c1yT pUGL7clMt91fQyUHlsC+dvkkIwm3fENvUzkrGIm+viZbITYrWqCJ5yrsgHCiQocF9pNi DhwgtxMm/5B0uW0v4MMXsLiv8pXwuBmqY4eqZtK2l3gua3l2HZEF6V4bwO5mqrWKM63q Xq0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OwIo8UKw; 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 e4-20020a170902e0c400b001a52db202c7si1306229pla.382.2023.06.14.11.40.12; Wed, 14 Jun 2023 11:40:25 -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=OwIo8UKw; 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 S240836AbjFNSHY (ORCPT + 99 others); Wed, 14 Jun 2023 14:07:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241688AbjFNSFP (ORCPT ); Wed, 14 Jun 2023 14:05:15 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26ADA2683 for ; Wed, 14 Jun 2023 11:05:07 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f649db9b25so9040907e87.0 for ; Wed, 14 Jun 2023 11:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765905; x=1689357905; 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=0jK7Krh6d5glAjoREUgnuuxQiDYi3CDuObLr2ly9o6k=; b=OwIo8UKwEUo7vVB7txLULtay3a4jAcrT3MWK1c0iP3ThbEN+IkQFegbRMvtdp2SGuX AKlDiOz+EpNzqor1YyEoSPmAuj1xCvgS8VRe1U6SF+YO8yVfiqYBTH1LcnUkuYg6j3aT QU4Tqk+2qXErCsH8Ofbm817Sze7cbMGQsBqhlYFHUuWUif/AS3/zoQBHjlJpicHhrh1t CuazJ3hxtfkqcYQ4DFLvmAuo31qV4HVx8Fr0hwN//bycN7YzLPwsjmMNuhYTQqcFHpvz DNP5mAztMtI2VJQKXaKXSumZU9QRsItbuLJvAh7JNNiaQ2UqYNoi6v8aaJjAv+HvkfYb xoHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765905; x=1689357905; 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=0jK7Krh6d5glAjoREUgnuuxQiDYi3CDuObLr2ly9o6k=; b=iidGcjDlXxYlpNvNOIwOMsF5qj3am/ca1qA2N/4CjYP9tbdf8o5IEyS5jtu6MyXm4k Bd6AQjPKubQBcvPvo2Stx4SaGeaa1kYll2scTxCplziy7lkGr4NGzBadiL6mKHeB/AHn MFUsikLG0uTj5u7jqxMKqqGulGNyvYOmig5RHLBJ5mHL6PHqHe/pPR9TASULcLRKL2Fb iydkAs2qLdd7xhuE8H0bSGVheZ1cQaheuQtvJ12THY22C++TRzeBypLdOhehDXJEPdT1 g1oCOBjRlc1RAcZmkrEFYGGCP5T1rbTDdiEeuiqHW6KmJZd4k3hPDqqKxMoN47L50OWQ jsjw== X-Gm-Message-State: AC+VfDx66WAmTXH8Cg2fV1cR+cdoGRaa6tjlKzU8Oy6Ee0ZPRCrAn80x tHVCqCFQOpM1dbTU7F9vCdfZ/Q== X-Received: by 2002:a19:ab02:0:b0:4f5:1418:e230 with SMTP id u2-20020a19ab02000000b004f51418e230mr8526746lfe.52.1686765905514; Wed, 14 Jun 2023 11:05:05 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.05.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:05:05 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:40 +0200 Subject: [PATCH v6 21/22] interconnect: qcom: icc-rpm: Set correct bandwidth through RPM bw req MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-21-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Stephan Gerhold X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765873; l=1241; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=kbfzjw5doxXBVvXaQEAjOvlD1+VtGE/glxgCqrLn1Ec=; b=W1bC3r65t6nqniIfPxVvYWPx6IUPsJ8nB6cXGnLHWP9BPmWYGhSkPSt3L9gHWS2stPilvmxQS Jat4lkIfYasDBkekfuBzrvMHkRqqu12tS9rd9LNQmUF9RBWHUT1SU1U 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768704468792933481?= X-GMAIL-MSGID: =?utf-8?q?1768704468792933481?= Currently, we're setting the aggregated-on-provider bandwidth on each node, individually. That is of course incorrect and results in far too high votes. Use the correct values to ensure we're not wasting power. Fixes: 30c8fa3ec61a ("interconnect: qcom: Add MSM8916 interconnect provider driver") Reported-by: Stephan Gerhold Reviewed-by: Stephan Gerhold Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 928dc27c1d93..5733261d9407 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -354,12 +354,12 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) qcom_icc_bus_aggregate(provider, agg_avg, agg_peak, &max_agg_avg); - ret = qcom_icc_rpm_set(src_qn, agg_avg); + ret = qcom_icc_rpm_set(src_qn, src_qn->sum_avg); if (ret) return ret; if (dst_qn) { - ret = qcom_icc_rpm_set(dst_qn, agg_avg); + ret = qcom_icc_rpm_set(dst_qn, dst_qn->sum_avg); if (ret) return ret; } From patchwork Wed Jun 14 18:04:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 108114 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp155034vqr; Wed, 14 Jun 2023 11:43:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4rnsJqc8hpUOvcPMpb2X6v4ybhVCwbFEyhJSqDG4Ls7r52/O1CFO+VASwKvbQvmG+8YH46 X-Received: by 2002:a17:90a:313:b0:25b:f0fa:ab42 with SMTP id 19-20020a17090a031300b0025bf0faab42mr1884404pje.40.1686768206645; Wed, 14 Jun 2023 11:43:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686768206; cv=none; d=google.com; s=arc-20160816; b=h02aWpM1f0TL0XWrbmYOdzE+raAaq6B9pEpu3bl5HQcGH/90WhNaU30Jjylpo9ZfpY DRRn8xSmrzxT6Dnwqq4q2q89tDvOybnNxw5UYpcT7M/1v3SEMnb6ACAy8qa3/yHKPAnW BtRiTBiLRAnQnI4VUFN7j2If+h1KP/eGc3D3ckq3SU1/gYtPKyoHC5iyK5JorapRhO9a mw0mM6+EQHU2aqj8BZmBmGRUdr87q5lFnGzeZNS5gEQ9FEyWKNQli2Vthnh3OjosRaHl AyHouVhINxOYe2UZjwHi1fc6HK90VaW/gYpT/LGpLk03zUQEKSwS0j5RwUbkVZUDZcvr Cbsg== 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=5bcXIhURMNb0zAXxfMHWv0nL5TXiAv91yaE+1dFMG5E=; b=KKs5f++25T1gPVjDiYkfBbZsczNRmfJ1zxb43HzAXoBLzykYz+g8JWon9y7D0450U6 x04gb1l3Wlt58IGz835h8/P9gHaC/Bmac9RUfwcB9d97dVBVccfPJaiakxRakfSwGoaw sqwpoqZvZx2lu7QF20rQoNRz0moHGGj+hdmAxXT1cpfpr6D+5ONUCH9MtXdIJvWgXfy5 iYPPDbonm+g0APHFhMqkyHaInelcjDCXyXqNmIhzoPF+E6sI/dR4iLDbuhO7HPxmopSp Iym1lWbc6yqJx/8OUQbmLtSMG0Ze6hKFDf09z6lCU3PGKvuomyKjJDEfiUQoYu1cfMHu Y7hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pq6bw0cX; 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 ob15-20020a17090b390f00b0025bdaaf0d17si7204059pjb.33.2023.06.14.11.43.12; Wed, 14 Jun 2023 11:43:26 -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=pq6bw0cX; 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 S237071AbjFNSHT (ORCPT + 99 others); Wed, 14 Jun 2023 14:07:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241782AbjFNSFQ (ORCPT ); Wed, 14 Jun 2023 14:05:16 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01BA9212C for ; Wed, 14 Jun 2023 11:05:08 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f7677a94d1so1411273e87.0 for ; Wed, 14 Jun 2023 11:05:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686765907; x=1689357907; 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=5bcXIhURMNb0zAXxfMHWv0nL5TXiAv91yaE+1dFMG5E=; b=pq6bw0cXSTpklMxV25UMxnMsLsxx5Tc6Eb25fYs9CmWrd2LzuH3L4ZZ25tXXfMT1/4 WNNhfNlCuK/D/kdKixzZ67I7IuhdLNqZ9D4+d8r7palyPCiN0jICzuHr84vnyI9hyPxO OmZ91ZiVkIIhbV55nZQsuusIoyOOjwBHtxImi0cXmgPiAGCgPX+0ry0xsPilIY4E+Ujn Yh4pAnuW4m2+pJItNnFDWqytf997MXtz/dVHra2yFqaN5u3jXaIcJvj5yIwdwTJaP9Jt 931pdLVcYWp8ISnjcQpuA+wXcyEi1g7Stbpu5nRs9/s7xNw96IYtBr6CvFOfFInPip6p oxwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686765907; x=1689357907; 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=5bcXIhURMNb0zAXxfMHWv0nL5TXiAv91yaE+1dFMG5E=; b=R+fTziXDFbD/YbxwP3XxkDRU6TbqgCrHQF2r4tS3VlT4XcMRJ0Cw/0K2Q0ogekZ69e 3gh3IORui8UYPmUXffJ6xQ7OBIrZ2OBWfr6UrJ707OFqHDdvf9domYLV15U/sDMf18+8 rFpRqqooLM0fKQqNbcyd1QKq96Q00m3V0xCTDsWzdoRsOP+cv6wESQXV2Uav4xMdQWSH 9/oWnU+Sjyu9R7CvPv7TqjpEy8Ej2uyQIM9B5sqMgSMSgfWSvARfZs55qVNPuurAAGhh 455rohiczrn6SmCacgsfSKk+uKqCLFQpNzgb5U5PERJEdfNghS5pMrGGRVS1emWRZE4K ruqA== X-Gm-Message-State: AC+VfDypYnXhwbn8vhwcuiIJ9SlPCLGIEeXzR1cw+9mu9x/c5cTwIFWM EIYfRwkSfUjLK7hi0fpOsuHVnw== X-Received: by 2002:a19:7104:0:b0:4f6:3000:4d5a with SMTP id m4-20020a197104000000b004f630004d5amr7266979lfc.38.1686765907332; Wed, 14 Jun 2023 11:05:07 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id l18-20020a19c212000000b004eff1f7f206sm2224053lfc.9.2023.06.14.11.05.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 11:05:07 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 20:04:41 +0200 Subject: [PATCH v6 22/22] interconnect: qcom: icc-rpm: Fix bandwidth calculations MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v6-22-263283111e66@linaro.org> References: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v6-0-263283111e66@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Stephan Gerhold X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686765873; l=5027; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=tAzLN6zVkcV/6YKzpXaiTCXmJB8hBKbRsR3dIrek/EQ=; b=D2ggQXMuXsAaYFYORH7Xn4ImPyMS+lByHb8dqBMR8ngA5C+oEBTIgqB7mUrwAVgCNTKEwy5WK u2MZ94OJ/w4DnpOSuSecmyweXzoWS7dkBRw/6ssKhL+fzq1RcAfqkLo 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768704659027567639?= X-GMAIL-MSGID: =?utf-8?q?1768704659027567639?= Up until now, we've been aggregating the bandwidth values and only dividing them by the bus width of the source node. This was completely wrong, as different nodes on a given path may (and usually do) have varying bus widths. That in turn, resulted in the calculated clock rates being completely bogus - usually they ended up being much higher, as NoC_A<->NoC_B links are very wide. Since we're not using the aggregate bandwidth value for anything other than clock rate calculations, remodel qcom_icc_bus_aggregate() to calculate the per-context clock rate for a given provider, taking into account the bus width of every individual node. Fixes: 30c8fa3ec61a ("interconnect: qcom: Add MSM8916 interconnect provider driver") Reported-by: Stephan Gerhold Reviewed-by: Stephan Gerhold Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 59 ++++++++++++------------------------- 1 file changed, 19 insertions(+), 40 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 5733261d9407..3209d8de709b 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -292,58 +292,44 @@ static int qcom_icc_bw_aggregate(struct icc_node *node, u32 tag, u32 avg_bw, } /** - * qcom_icc_bus_aggregate - aggregate bandwidth by traversing all nodes + * qcom_icc_bus_aggregate - calculate bus clock rates by traversing all nodes * @provider: generic interconnect provider - * @agg_avg: an array for aggregated average bandwidth of buckets - * @agg_peak: an array for aggregated peak bandwidth of buckets - * @max_agg_avg: pointer to max value of aggregated average bandwidth + * @agg_clk_rate: array containing the aggregated clock rates in kHz */ -static void qcom_icc_bus_aggregate(struct icc_provider *provider, - u64 *agg_avg, u64 *agg_peak, - u64 *max_agg_avg) +static void qcom_icc_bus_aggregate(struct icc_provider *provider, u64 *agg_clk_rate) { - struct icc_node *node; + u64 agg_avg_rate, agg_rate; struct qcom_icc_node *qn; - u64 sum_avg[QCOM_SMD_RPM_STATE_NUM]; + struct icc_node *node; int i; - /* Initialise aggregate values */ - for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) { - agg_avg[i] = 0; - agg_peak[i] = 0; - } - - *max_agg_avg = 0; - /* - * Iterate nodes on the interconnect and aggregate bandwidth - * requests for every bucket. + * Iterate nodes on the provider, aggregate bandwidth requests for + * every bucket and convert them into bus clock rates. */ list_for_each_entry(node, &provider->nodes, node_list) { qn = node->data; for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) { if (qn->channels) - sum_avg[i] = div_u64(qn->sum_avg[i], qn->channels); + agg_avg_rate = div_u64(qn->sum_avg[i], qn->channels); else - sum_avg[i] = qn->sum_avg[i]; - agg_avg[i] += sum_avg[i]; - agg_peak[i] = max_t(u64, agg_peak[i], qn->max_peak[i]); + agg_avg_rate = qn->sum_avg[i]; + + agg_rate = max_t(u64, agg_avg_rate, qn->max_peak[i]); + do_div(agg_rate, qn->buswidth); + + agg_clk_rate[i] = max_t(u64, agg_clk_rate[i], agg_rate); } } - - /* Find maximum values across all buckets */ - for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) - *max_agg_avg = max_t(u64, *max_agg_avg, agg_avg[i]); } static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) { - struct qcom_icc_provider *qp; struct qcom_icc_node *src_qn = NULL, *dst_qn = NULL; + u64 agg_clk_rate[QCOM_SMD_RPM_STATE_NUM] = { 0 }; struct icc_provider *provider; + struct qcom_icc_provider *qp; u64 active_rate, sleep_rate; - u64 agg_avg[QCOM_SMD_RPM_STATE_NUM], agg_peak[QCOM_SMD_RPM_STATE_NUM]; - u64 max_agg_avg; int ret; src_qn = src->data; @@ -352,7 +338,9 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) provider = src->provider; qp = to_qcom_provider(provider); - qcom_icc_bus_aggregate(provider, agg_avg, agg_peak, &max_agg_avg); + qcom_icc_bus_aggregate(provider, agg_clk_rate); + active_rate = agg_clk_rate[QCOM_SMD_RPM_ACTIVE_STATE]; + sleep_rate = agg_clk_rate[QCOM_SMD_RPM_SLEEP_STATE]; ret = qcom_icc_rpm_set(src_qn, src_qn->sum_avg); if (ret) @@ -368,15 +356,6 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) if (!qp->bus_clk_desc && !qp->bus_clk) return 0; - /* Intentionally keep the rates in kHz as that's what RPM accepts */ - active_rate = max(agg_avg[QCOM_SMD_RPM_ACTIVE_STATE], - agg_peak[QCOM_SMD_RPM_ACTIVE_STATE]); - do_div(active_rate, src_qn->buswidth); - - sleep_rate = max(agg_avg[QCOM_SMD_RPM_SLEEP_STATE], - agg_peak[QCOM_SMD_RPM_SLEEP_STATE]); - do_div(sleep_rate, src_qn->buswidth); - /* * Downstream checks whether the requested rate is zero, but it makes little sense * to vote for a value that's below the lower threshold, so let's not do so.