From patchwork Mon Jun 12 18:24:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 106761 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp60996vqr; Mon, 12 Jun 2023 11:36:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6F5Zl85HZT/88V7o4CUHnwYQqlfYVda9vMH/eT8o6Wp7pGOaJ/1XDtgpVYEJy2SLAEMMFg X-Received: by 2002:a17:907:787:b0:970:71c:df58 with SMTP id xd7-20020a170907078700b00970071cdf58mr9573212ejb.42.1686594971798; Mon, 12 Jun 2023 11:36:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594971; cv=none; d=google.com; s=arc-20160816; b=o4BCE756sbQSuEJJOf3FBGdxq2ExnpzlqFcegliqrwFe5D8V1lpwob4PlGY2Ye3m8G +B2dXPLIc6P2bTnNig1SPH7r2d9uy3CzzPetTLm8Qe+hHYH5IYLlYNLMTcK+yoyUvz1o QHdTs9fTEPt2Sran+PXRz2JdV35Mkaz10v9lEReY53RDawr9w/Ji8dzH3jrWWHPJfC49 kycEkR4b/n2ie/ucVrz7/35z6asieLerXVMQYHr4goAxdfCjc2OKlFNdNN78/rad8Gcq hEN8bHOIMLGP3AAi0Ozjr99i+b4ib1WaqrvTPf6AmTzIenui7a8Jql6+fJTtrwuiUqJB 91VQ== 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=BEi5qpheZl2BQaOFoE3kkQOdFO7lJ+DrcH7akRlwpqQ=; b=A5bh9h38Gepx1x/9wR6S8rptN/iZ4VvWHJ++QanVhmFUmqA51hFaXg6QTebY5RuoUz VgZHWs8MoV/eBzaYvixUy/W5csnJZQTO/AFvytmtioGjsvHl43fCePuNDroET4r1BLpB Kqy5h4r3mw+FKmM45swIj4cgD+IGUUlG/3Xe/tTdfe6szAhHe83liy0GXDEAjZa0YIF8 dlkbZcrXBT4ruyO9vqVBweJXOwm7yRIhX8ZCoHmHVV0Epj9lQU0O2G88yXmSUqpmCnzy LeZzx2Ci2yJkgrsB8/fYk7c/x8Z5Ok3MwoPd59ZPJcIKgoDNtR6rxLkMY4/tHMOxBnCT I3mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AEvWiL5C; 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 ju25-20020a17090798b900b00977ca868696si5911044ejc.243.2023.06.12.11.35.46; Mon, 12 Jun 2023 11:36:11 -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=AEvWiL5C; 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 S238398AbjFLS0S (ORCPT + 99 others); Mon, 12 Jun 2023 14:26:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237588AbjFLSYn (ORCPT ); Mon, 12 Jun 2023 14:24:43 -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 03413E7B for ; Mon, 12 Jun 2023 11:24:41 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f6454a21a9so5513820e87.3 for ; Mon, 12 Jun 2023 11:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594279; x=1689186279; 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=BEi5qpheZl2BQaOFoE3kkQOdFO7lJ+DrcH7akRlwpqQ=; b=AEvWiL5CQwyLRex0IfiH5wBk6r1CyDyBAbbBy4kaWDDim0oBPXxRL7RBaZs2IBQ3l7 qp1OmAADeoxQ1cd4KS86PhNBxxOTeyKk+GaThXC8kkv1TiHX20upsGR6momGd0MV2PQJ B9iDBnjjovOIxtQfvlnkOOUx0vcpQgMLTZGVG0PPL+BkXEyoPfNqNokYKY9oue85WsKQ iY8zouPXv9151NK8y17VV6LMGixxNhKYVqHRjPZEjf6eCt4BQnOKKf9fYb9JVJWS4yha 8WaftODBStZM0cBCL/meWkOjVS6PRK7fASpa4MaN7DW1ASG+4tBfiX4HSJl1PulWit4B qDoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594279; x=1689186279; 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=BEi5qpheZl2BQaOFoE3kkQOdFO7lJ+DrcH7akRlwpqQ=; b=FeRYQ3iZR4/nLU+w5cIJBFyFP/40ODaoDlzYEVGZe3nv+ne5/NYy2iRe4ggci6H6C6 9Ugn+Bgtz5RXLqTCpJIDIi2gY6j68RCN/dQ4UceOr5BVWb2ZWytuNBKiL0Z3Ye42amKS VRu/44ng7E5eSRGQDrhS/oiQBx4/ixYrYNsRw6Z0zeF9VDleKt6uCI689RJz3WYPSqPX iCN1sIFQ4Gs2++v+O2RpV33zZqTW0+oPs4osDlBWXLyET/9vB7d12R3hxdECE5lxAlQ1 gL+fkEcUSE3XmYFiU/Fc1DvmGaf+goZA05VDsjT8ij62W1ZNNOuTnObtxHcUJz0AkoMy Yj6w== X-Gm-Message-State: AC+VfDznGNeeBeMaOhNU79IybV5igNzq45baFC5Ay39FIl4J9Rgpkjp4 Ml9972QWzu9avYWyN89G69JEog== X-Received: by 2002:a19:691e:0:b0:4f6:26fe:9e7 with SMTP id e30-20020a19691e000000b004f626fe09e7mr4022151lfc.10.1686594279359; Mon, 12 Jun 2023 11:24:39 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.24.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:24:39 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:18 +0200 Subject: [PATCH v3 01/23] dt-bindings: interconnect: Add Qcom RPM ICC bindings MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-1-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=914; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=WkcyB5namzazMLShg6tQtS2xLtUOn1uXhB52w/vW+S4=; b=N3RAdLW3q/eh3dgOQwlZl4DhmB3Ou3ae5Bqj7LaNSkHzmsPzpF3Bjl4+5dmYaqTXuH0bDIUU9 8/0JeuRSKbdA6VaeQeJ80kMWxigbimQTLMrI/7Hlq7pr/zmOK1LiUkK 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 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?1768523009318407127?= X-GMAIL-MSGID: =?utf-8?q?1768523009318407127?= The SMD RPM interconnect driver requires different icc tags to the RPMh driver. Add bindings to reflect that. 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..ef61006c9c58 --- /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 BIT(0) +#define RPM_SLEEP_TAG BIT(1) +#define RPM_ALWAYS_TAG (RPM_ACTIVE_TAG | RPM_SLEEP_TAG) + +#endif From patchwork Mon Jun 12 18:24:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 106757 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp58637vqr; Mon, 12 Jun 2023 11:31:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7AWfqHG7GJLrnnbMoXtDuANah/bIrhyHOno/Lkr99vTODhOt2XwHThF8f1FrTyhxe8wwms X-Received: by 2002:a17:90a:f185:b0:25b:d977:466b with SMTP id bv5-20020a17090af18500b0025bd977466bmr3997697pjb.29.1686594688220; Mon, 12 Jun 2023 11:31:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594688; cv=none; d=google.com; s=arc-20160816; b=JUgCVVBMQuoFmNTm/WRJBgGVI6uKHsnuKskqB+9SHNg2QeqpxcNT02nx3ZfZnlITOb 7tGNnfR60AQL6cxcuVUA98+UsOSRGlVHkd/3HDwjfbtR63BQ5TjqtbZpQkeOTojNlZla 41/ffphfA+T+9dsA8QmD7v/k5OwrODf8QaCPDFDd6LqtwqTvG5uaEn0TaC0h1sbvKqH/ XptV7d2yGgjmix3ODp+q8BNF5z2FlBhBcYWQxJ/1uHT1VgJaH3Xrf5XNYw6UVb0bzqeU JBffBUdtKAx28aOFyRazwGsdXXBpZP7s5l2p2KEU4wvKNj/MrKDAc3Ji67iPjzjgvTE9 RApQ== 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=N9/bp3+n4Njl5q00+lgu7fmuXWpJ76PzA29mg7/ZO87OFcozdfJeiK4uT1Q1b4+Ij8 l79SUO78EC43gP4WcIAG+DvXiKB8WX1meeLdEVcpiArbzCrcEQraybkCOiLsc1NWypEz TwOGRieGDBqttwd7Du6PphxkTtHxGuw9Dm765PTawL+KEb12OzOh0RuSQt5yYNG60Lr4 Nxi52WV/VeCV2BJwMXzYknzxggbDy7i9BSU6EhxZo6r0xcIhK92tSq5ilemPL0ViuV7S dqkJGgEgctiPYal1Ucn1Np0VTp+tEH+jXP2ARx/I0QvzhvkqD6ifTcGQs3WnUSUxBI46 GD9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PCvP9cs1; 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 a3-20020a17090a854300b0025bb9fc0fa1si3727967pjw.83.2023.06.12.11.31.15; Mon, 12 Jun 2023 11:31:28 -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=PCvP9cs1; 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 S233767AbjFLSav (ORCPT + 99 others); Mon, 12 Jun 2023 14:30:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237636AbjFLSYp (ORCPT ); Mon, 12 Jun 2023 14:24:45 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07984113 for ; Mon, 12 Jun 2023 11:24:42 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4f62b512fe2so5755073e87.1 for ; Mon, 12 Jun 2023 11:24:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594281; x=1689186281; 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=PCvP9cs17qBaf62as9MDWOKExq7NCk5ON/MclnOAlvR4MUsiKiLbRegl6cuDGcfKQi T5tq69pg6qUlvK6kj5HEUzIYb6+tbp+02qYR8VHLqXm9g6ZqYwMPfgJjPUV+dQXgNOup h93xhIXi1A0Fet8PTwla8vBS2Bsf2e+PekPjeAakLX+eBGcr+Oop5UUiGwPTRCZ2Yb6X eBZ/4q5qAN4Hv8p+h96JUV6HHuFrwo2SV16vAuzYFHjIksSfERjY2KDR6ciIgcm58ER0 xrEaatG2RNwHw8D+SofCr5C1tjArvG3vB1O7is3D9hHJnldAoVui7flfJG5v712gd70J oZlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594281; x=1689186281; 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=ZtsLWyPIAuzspo5b80u1XR7KrRIba/7k0JfQgPmxcBk+MSYzFVPkxEDjQQFMLUsx07 QLUcUN8wt3QhVTV3ZrkuWMO7XR/tnaK42oITegWQWhwwYwHVWgV2/GUWqBHpXDSFXyH+ HMb7xvEqeZP3h/xC0sjZN7OxxwDP5Aw5KNL7J/4mN8kSK7rgi8QS1WD2RKdwyNDqys1m M2KTKu8KCWxz5w+DclKe24N/ztHeU0hYUL2WSgoEztYe2FNFzWEjpJxCDk4pvACKoFJW 8lrfhHEtmLIu5o5bMvi24bcuheeUx7WTDVXeovhJJIKpD2T0K6gIX48e4UVF2dCaTPrV KoPA== X-Gm-Message-State: AC+VfDwquejhCxdFF1/k2PAiwOjW/sEkl/1MZkmwC+lZvbmqLGGmfzMQ aSw+RzhDsqqyjZIV9YYg/CqlnA== X-Received: by 2002:a19:4357:0:b0:4f6:20a8:2656 with SMTP id m23-20020a194357000000b004f620a82656mr4018758lfj.29.1686594280772; Mon, 12 Jun 2023 11:24: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 v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.24.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:24:40 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:19 +0200 Subject: [PATCH v3 02/23] soc: qcom: smd-rpm: Add QCOM_SMD_RPM_STATE_NUM MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-2-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=664; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=XHE1WQYZzaLo+c3xD4ALM/GRb1VwY7GuxNqpdL0mBnk=; b=UgnSsD/ZMCPV95S+X937A3q269KBqm/jPKgp4HLyljIdENs8MSPHoc98VlbXAKg+6mjm3UeWx SX3SBk8iMfaBtfRbHi3/sbsb+8X86VtsXx3bgt8nMvFePsn1CSjlbV2 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 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?1768522711728218387?= X-GMAIL-MSGID: =?utf-8?q?1768522711728218387?= 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 Mon Jun 12 18:24: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: 106760 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp60442vqr; Mon, 12 Jun 2023 11:35:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7phUywXQvHq6ikAG/MAZizb1bUJhRiXjkX6y5QrSJeOsNNxXDqqXqg01TZ/HhcRqvQDjN+ X-Received: by 2002:a17:906:eec3:b0:96a:63d4:2493 with SMTP id wu3-20020a170906eec300b0096a63d42493mr10751083ejb.40.1686594905861; Mon, 12 Jun 2023 11:35:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594905; cv=none; d=google.com; s=arc-20160816; b=uwvkGNbZoogPWfWJ3vr0Oo5XRe823iLVv3ibO60H9AmavXetyS0QIWLziBCB0K1iV/ cCSJaas348Ji+QLP0y4SGfsx2a6RmEVr+2ejbi1flLD7Cgg75TFW1XdJlJDMsKQuIHWO zqA+8apHDKraFWNiER/Vc2JrILzWVf0sHuPd91JulWt1gk2mpGNHaO8bhOhfHQtInaL9 pv4PMWMwjXa30v9Ettl6M4RVpu0lzmC+mNifpG1K5ewS+ZcSPpfcO+kZcN/n5Ap2+JpM Vvv5QHOD0PPd1ay/9E9p+MpFvTX8SW6XdFoQ8TN4RkDYb2hhzhxlvSexK8a8Td+m4NBL 3NjQ== 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=agw7du9bvG+AfdfdOpKCEitFlw+aeuSfRQaYS/oS3HszDcyobaB4i8ohZ9FFU8hIM9 JirPoGpUh5Xwi8w24NIJdw4R37c4szCO/MGWTLpkzJfT5ZJ4fIVRPYnzZJ+Ey6x4yp7R bYyGj5EvCHlf0oRzgNM0MpC96iV0XsTYPghFujsW5LWMXiRjeJzjTHM4Bn/JjUtb8C0f Ci2rh2kGQgpwznTEo48nLcHczZjeJRh9q1wkXa9vGVmsATERU9ZwBI8X8LYOo+8KKklr VFZQicP1cctnMoHZLFE6qj5WDfswUwlE1C2va2oAn3PlVPIL0/7i+zjoLnwlrmmr5TDv Kvtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DLAoC+YI; 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 kb3-20020a1709070f8300b0097866bc5113si5670261ejc.461.2023.06.12.11.34.41; Mon, 12 Jun 2023 11:35:05 -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=DLAoC+YI; 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 S235720AbjFLSa6 (ORCPT + 99 others); Mon, 12 Jun 2023 14:30:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237655AbjFLSYq (ORCPT ); Mon, 12 Jun 2023 14:24:46 -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 CC192E77 for ; Mon, 12 Jun 2023 11:24:43 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f63a2e1c5fso5589098e87.2 for ; Mon, 12 Jun 2023 11:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594282; x=1689186282; 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=DLAoC+YI5ihmdO8CNl1QejkU5ba9vdx06Z+NI7L/nO1cVIUcxwExm0xIpmipS22YdC GW4AlOmy/eF5P6nOW/I466ueIgqcQxJl5RDYEXdafLMUX5yUvvSWYK6WVVWF09xDY4j1 51JEQkgGY751aEhBDdmqs92WZiP4vBHHbePfmCTHrYzKO7GG6AIlpeCC90hAi5Ria4NP wq9AILrsfen14FoV0pjuxAbG+dMtoSDhp95uIhe4ej+aALqzYIqCERjSOJXpxt9RkXPK izMUxgPCghgJhMKCJ9yluUUzsmLSh4xFevPDe0myB1YI6a8RMKJavfwt8/y/hvovKaeO VMAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594282; x=1689186282; 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=G11dbjh08qljwqQAjzJ+Tgz2Bh6uss/VSALDnC2UvpN3mJnJW4THENNGSH9lK9/dLy 70MDWpXhtdAPu4lW2PdM/V4UuludVDwuq8sI2tujctoqLWxnmjgFsKMZ9AH+NcpH9MO1 KnQqmBy4Xja+DcaUgWVQ4EJUp78e0L0HmRHJCjR64WbMS/z2l26WEUX6qjI1u7vxsQrw 1sz1jK3l9ERMm8Le3ksWe6tq4OfbKzMmzuztFOOkVDCuDZQudfy7MIFKE3vQWSZHFqGZ vYH+ucsCIJSznHV96t/rH8dDvGtIKT/YdH88Rwywm8oNppQXsMIpTmaB1eEYmG0uyDvH ydmQ== X-Gm-Message-State: AC+VfDz/1J8PmXeuDnQ4dP3avK3pOiZCrmDTxRb+GzInrVhcqts2YlkD bc0miWlBBfJs6iUjvftR6Zx8SQ== X-Received: by 2002:a05:6512:459:b0:4f6:2e5f:45cc with SMTP id y25-20020a056512045900b004f62e5f45ccmr4498200lfk.3.1686594282057; Mon, 12 Jun 2023 11:24:42 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.24.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:24:41 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:20 +0200 Subject: [PATCH v3 03/23] soc: qcom: smd-rpm: Use tabs for defines MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-3-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=691; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=7uAPa6YDjXHLJZjqpcpTS8PIWFtwDRP9qtCSKC7URyY=; b=ESZpNbzbQ/xt/c2RmUiCpmrjQGbD9w+h5/bdbMHoNBU0InzGeWvrebWATOnYlgBtX2nGiySlm 1vFrFqFhhcGCNGEDWGrdGayN89gbDg6nnUMZG/RFoUgsXDTDqHWaTZN 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 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?1768522940168302411?= X-GMAIL-MSGID: =?utf-8?q?1768522940168302411?= 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 Mon Jun 12 18:24: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: 106759 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp60389vqr; Mon, 12 Jun 2023 11:34:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5J0WDGL392Zuum841zdxRSR7m+G0/RxhR1ynVCUtBFS6mUsRpa2vXXGm8JRyTosiRgP19D X-Received: by 2002:a17:907:848:b0:96f:a891:36cb with SMTP id ww8-20020a170907084800b0096fa89136cbmr11355823ejb.0.1686594899569; Mon, 12 Jun 2023 11:34:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594899; cv=none; d=google.com; s=arc-20160816; b=U0C9/03iR+2281piVvQCsyYS0I5+3dzLrz1ru5bSQurocDH81elZuGVcUUxAXwOHT5 kl86ovhE4RE0XAlXWa8zDpzM4RCYD5iO/e9Bxz5SEKqRB2DGkBQj5y7uvTCPFAU4Uho+ GSl+2AyAwubJbjeC1N0BfA/RIpfXcCnO+8k4COmLueE7cz2BMoeDbH5sA6dg6Ou63x/O HQ3f/sg8ufJ5RSg8BwTkRNnsS0ciPHvNx/gKaI6uuFwtCLQCx0aGzKsIbuY+L+hARZ+l mCr0g3DSjJzBZkwie9tQTXSqG1wNdsGk7fDxTB3nxGb8dBgO7hZt48hjreylvx6z8Vbd /MIA== 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=o4TG88G8lz+fAZ9zU8d6rxSrHlYur3wUM1VMDavTyKo=; b=xvOpps3n79Uck4P6NOHBAxj5QMRyYbz1Yc73GYwOBZT1ErWuss3QgFSYxaAQ+ZpAsz cQ8elC3Ten31dZw33MikQjyYfuxCpcsYgOwTn2u9RefacfbhuQ5gos7tP5Il59DZOyBs 92aBxnUzWWinPySmF0a2OLAIhMFBNLLdgW4SUQ4LcrAJnm86rfLaMV2YjYZ7Z769sPZ9 cliySwzNAZF8ULyHT/pBWigp7sqntGMMg7/wJQYsFDkWiy49mztIgeWDdJuIr/O/LImK 9VlCFvSM1ISBO14vg/hrmvwtNuWnIwtQkfzo9ZH1YdpFHS05OUGxPRWdTr3eacbrJRiD NDQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=loBipD48; 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 kb3-20020a1709070f8300b0097866bc5113si5670148ejc.461.2023.06.12.11.34.34; Mon, 12 Jun 2023 11:34:59 -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=loBipD48; 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 S237821AbjFLSbN (ORCPT + 99 others); Mon, 12 Jun 2023 14:31:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237671AbjFLSYq (ORCPT ); Mon, 12 Jun 2023 14:24:46 -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 0AC8CE7D for ; Mon, 12 Jun 2023 11:24:45 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f62b512fe2so5755136e87.1 for ; Mon, 12 Jun 2023 11:24:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594283; x=1689186283; 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=o4TG88G8lz+fAZ9zU8d6rxSrHlYur3wUM1VMDavTyKo=; b=loBipD48bZ404WlmVXrHE9OF0fwywsGH/JnBUa99Fda7L2FYBra2kMzYykhiYL74eh 2OAmACB+Nt5QE4OXbVNpeV/2VOwd/Qr3kDkRjwifdpkmSghUHz1Nr5XOzLnOOc/jepf0 vOVvn7pU8gqGnlgQWOhm+TVVQBwIc9QHsCwUY8DM+yzPXaeXHQBAaImt5LOMuj+D9KMR mHTLaUjvJv2uf0WTWubjOZ2pO6qGvmxIhit5PQrXJaby5vdElAjAP8snqdn7ai+A+Euu 82uuyiUio/p9kjATJ09ue/fKVn6j0s/GeXR75nujCfDAga1QRA639M/Lx47/dMF2KKqq tZiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594283; x=1689186283; 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=o4TG88G8lz+fAZ9zU8d6rxSrHlYur3wUM1VMDavTyKo=; b=RBsmZ0LI+90M4P4hwZ1uIl87IEMI7yigrM4avcG+/HugiUkYNtDtCVABT4UgFVoU6j ah2l896l/yZlhZDz293ITROZwvEFR6QySkNMor9p9Qoi62ZdW+ZUODz87g0kbvo69qOa zzotQUx/KP248aXvtZzpFYs4PzknF2/MJj9alsAMDnISLkmvviSh6FkFFcR0dhiL9kpp CDotb+m+TsY4aq+JzhIoZw4oXIaxi4pMSMj2xKnnvdmOjFAMHKYLAtL/T+PNWUBylUim cDcoiCumPekcdqQ5Eo3+FFdObjuyPE3h8ue2afBHkIgbelw47Pri5wfUoO4HwK9S88KZ h9cw== X-Gm-Message-State: AC+VfDzNcAszfUGjVIZvab6x8Rw88uTKjH1Q9tNj5BFa6+gyvFAHPc1A f3rn/AFTYYw+g4JjfuwT4aQyWg== X-Received: by 2002:a19:914f:0:b0:4f3:a483:557 with SMTP id y15-20020a19914f000000b004f3a4830557mr4254666lfj.5.1686594283376; Mon, 12 Jun 2023 11:24: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 v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.24.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:24:43 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:21 +0200 Subject: [PATCH v3 04/23] clk: qcom: smd-rpm: Move some RPM resources to the common header MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-4-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=2437; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=UU7GtjAFC9F3/14Sgtv72aSDwAe2u4JL+0KQToDCmwI=; b=iX5fHRl6tir/I7qMgS6vwBY+LdMrYMhq6DtPXkBDkzFQZbIfwPo0YpBIUEuqs0CTpvFej8BXE 9XtHBB+AKhkA2PRGTSxGEoUTlRk8Yij5oLMWIEe2hJiV66hloeyZbpg 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 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?1768522933412761774?= X-GMAIL-MSGID: =?utf-8?q?1768522933412761774?= 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 Signed-off-by: Konrad Dybcio Acked-by: Stephen Boyd --- 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 Mon Jun 12 18:24: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: 106758 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp58955vqr; Mon, 12 Jun 2023 11:32:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5H1DBQs9N703b+vasiD75B+908yqK9c74aE8/Op41jlW+xdCyCwQWV0FPCDQQ5RMIwfeMd X-Received: by 2002:a17:903:41c8:b0:1b3:d759:d2e1 with SMTP id u8-20020a17090341c800b001b3d759d2e1mr1901267ple.5.1686594726239; Mon, 12 Jun 2023 11:32:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594726; cv=none; d=google.com; s=arc-20160816; b=AltVFPU6KTTrecX1r5azdVdO3ffCmlmQI/W05SuAwjNSOdgLR4DzDiW+dG6Sq99w8u 28auQeVntt2Bz56RaPGLM9TlLmgcDFBSEJ97Byi1XTJEXpKnVNCtjvY8cJK5oToemk0V s12/OABcKAVqoQFJUV30FQcU7OhAVOVVfuPNNnzWUSX+s3sQFYtPjo3dXhrDYe1JoAVm TIc1geYCrrX1PacU7254uo0ILRQjlQ0l54oUibi1g4nUvC1s6ByhpyxiTLxELLXaYGPt IOIzY+3jjM0zRPE4L0pP1Dy/pGI8wCxhevtvLm+Xe/jF1amnDp1PJ3MuGKzrkbw+QKLU m3qw== 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=eCy7STwPQguvSNXF/hCQ4j5BFOyuDUsQ8E/cZCUelP4=; b=06KJSfuFebgvUZr9XeGt+Zq1qHAzoxGgFpr2Zs3v8s1Id6oN3cHwTnJCbMJFv/ObPx KWPQGShNapUSa47905TMBjMge82m8BSV1NMMNC59CSJQQE3J9jre1z6AJB+Pv4IvGYsU WmvjDLaTS7nk8gbZu9IyjoQczqMZeQXmBc/5JGkwnEUP1DHk8fGtJ4sg5+2+M8qD+0Wm n3zcR+bcInJ0kNpTwShlUhUknO4j+KvMaEeO9w7swLtb56KcaQR4zD+ovLgxf74A6V0f lNV7tHJEp/fzaWVpltIB2pDHaI/auBSOh8eyvpXM4SpLTtpWtis7ZoQEo6vQ1vqlpYco txAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G4oYaGxA; 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 lk5-20020a17090308c500b001aad9b73ff2si7139567plb.285.2023.06.12.11.31.54; Mon, 12 Jun 2023 11:32:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G4oYaGxA; 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 S231175AbjFLSbK (ORCPT + 99 others); Mon, 12 Jun 2023 14:31:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237683AbjFLSYs (ORCPT ); Mon, 12 Jun 2023 14:24:48 -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 7B923E0 for ; Mon, 12 Jun 2023 11:24:46 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f61d79b0f2so5747333e87.3 for ; Mon, 12 Jun 2023 11:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594285; x=1689186285; 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=eCy7STwPQguvSNXF/hCQ4j5BFOyuDUsQ8E/cZCUelP4=; b=G4oYaGxAqeEmVL2CCO3hv38YyrJcIKojCs3Vh+ankfaH8waqiFXAOtsKk9Qn1QXPSk pxBr/2G4q3Wt5UMBSzkCRTagGyg/FSofzHYJP85wasMmMZsz1Vs7Vm2nnaCBjhOsbv5A LIoPw8uOw/AX1VxQ5wtdFQuSIgJ5dscLsWy9kzdqTWAhAGCUSSU1AKmi0ddB+t0wdk8m us4OEwBeD2ze2FHX1zB8S4VeNJ7WDvpMuRlMis9P5DQ4JRJxuxqCj71ZPNnSNiiSuYmA D2yBfXyLM+YAipdUeixMYONA2f0IzYRqNjQ6c9XUPGo21YXtLAY+3oX5vVLI+QAKDGh2 uZgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594285; x=1689186285; 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=eCy7STwPQguvSNXF/hCQ4j5BFOyuDUsQ8E/cZCUelP4=; b=C4wVhWuIdee6jFc+ojv65OQaFYK4OMJjMyEB51cdO2InKDLZfxNao9P5l1Us3Skbnt O1LfikCDQcfl1MP31amqTQVO8uQKOaEx150NLg7B9AJEMBkH+uzgSA3ziDKZtSN2ZjhR YEtYDGXYgfreocEr/f44pzbLfndq9+eC11WHGh8NDJqxJkyxicDwQQb31yDd543tX/y4 Zh87jB6Mj34MEtyR9/w88t0FQXGeizFe1tHR8+6FWHm+XI2cxvRDLLQS2ItEFwcl2S58 QA/44Ws3yUr21SsghyJ3QhZV++kAZOrWS6I1ve++wenMNSmoSAO3eT7w/OsPWEBSwEOS avLA== X-Gm-Message-State: AC+VfDziSiQ9CQBNM5q9pN/iqxCsbJxhf4CivHpsdUcJnDkAeWKCOOX1 F4ceYxnu+iMVJxkL5wJvmp3mFA== X-Received: by 2002:ac2:51bc:0:b0:4f6:1805:6095 with SMTP id f28-20020ac251bc000000b004f618056095mr5139755lfk.8.1686594284758; Mon, 12 Jun 2023 11:24: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 v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.24.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:24:44 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:22 +0200 Subject: [PATCH v3 05/23] soc: qcom: smd-rpm: Move icc_smd_rpm registration to clk-smd-rpm MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-5-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=3906; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=5jxwMVCy7bliJJPeYw9tcAw9XDgLw6G87CnBeb6K5TA=; b=pTSpv7jAl37WWUaTl+0qjbAvU7VYkk18U8q9fyvaSeD8hy51vvTFBgtDYt9kqtn4DFF6U90x4 absnOHbqtZ5A2xhhozHZkx9gFRleVQTmtNpXvRSeL5A+xhmew+0lJgn 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 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?1768522751608953251?= X-GMAIL-MSGID: =?utf-8?q?1768522751608953251?= 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] Signed-off-by: Konrad Dybcio Acked-by: Stephen Boyd --- 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 Mon Jun 12 18:24: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: 106767 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp74281vqr; Mon, 12 Jun 2023 12:04:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7WTw6GNzV56sgC8XnGKGte1eIj9UmhAwt+kzIq7EVa9So+oBbYYWpPvrSU4HDh2n4FxVH3 X-Received: by 2002:a05:6512:3133:b0:4f6:2e4e:e425 with SMTP id p19-20020a056512313300b004f62e4ee425mr4811301lfd.50.1686596661234; Mon, 12 Jun 2023 12:04:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686596661; cv=none; d=google.com; s=arc-20160816; b=Qk5bAKNYJ3sd6Va9KzSbvmF7N8FMhKzN14qXmUgct73Nc5E2afjqu3UGMsr15D5vLU jNjGpaiwL7kTpKoBvFIaDSC8oeMEDf7tisqImud+EGfFjW324Z4xG3LeSfYkALWXtuV5 qLUEyrsFhcsBfEElNpNsAXNFJ+FlgCxsEVlQO+I7oP8/7QJVUwjJEPlYcHr75RXelHJi 9ynX/w3qyYh43VyHUzo5d9JbMOqvcctX5X0Fm1YmU1SqKxzQzHVF1Vf+9PZSAGkZM9yH WUmJi7xEXou+CAvKDS05f0lXOba/N7GAJK87wovT99kTK83js2B7glWWbUThi+OWrPwG 5Apw== 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=fXupPHhTVqmqkTGR5Sl+qM9cQC1XpA6QYIgunsJNNT1gNyQmajodfLzBqNWIPttDsG LPphdvwY3a0fEj15RvQ4996A/4rbQE17hu968D1ZscLd4aIlN4pGNmtj9wDSlavamnPU Iki/LuOABWlCDs5TJZosyAXCAXYNRnR4hI8I+WnKnEI9AmT2JopDAy3WJaxWqY265N2x mkKuq195wkAslWtIfp1gsEcW9hqyXEp4+IrnKdwncQptDFOlzKNBSA4MI+QLhk8naMda MchDSZUDy8p/bfbUiAkEJlj4ys030VHyp1uwLTyeL9ANAVblgB3KX9DC0Y2GQPSTDqSQ 0zvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QxrX68D2; 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 r26-20020aa7da1a000000b005149150f572si6623950eds.643.2023.06.12.12.03.55; Mon, 12 Jun 2023 12:04:21 -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=QxrX68D2; 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 S237945AbjFLSbR (ORCPT + 99 others); Mon, 12 Jun 2023 14:31:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237704AbjFLSYu (ORCPT ); Mon, 12 Jun 2023 14:24:50 -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 CA31EE78 for ; Mon, 12 Jun 2023 11:24:47 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f61d79b0f2so5747362e87.3 for ; Mon, 12 Jun 2023 11:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594286; x=1689186286; 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=QxrX68D2Q0CnBQRrU5Z7XnxJpiMAaoIMzUjNbgv0l9nX7xBJbpJxtbeYqsujIx+6WC BW1o77woT5CqzCagDGyRVhAZ09N87yoeU5ga12pHt2rou6rWZIgVcwF8p1wC5grYP/Bf 1r9lWgCbv1HHNw1WN4xRCCyCw0VRUxTbempy9HKbrv8bdFI/uBzwXDK7kIPSO6pfu+8+ cnc9SEano9dieAjY3olxYii3K7OI6QlxcR7pLW5Dg9cM3t+UQjBMpo9fSgqJ/fk2ozWi tDXhqzOoECYlSecgisAUvZbhyT9R1O3gsckrcQ3AYY8g9qN8mrtqOoMv0tTor8JxhBLV eu/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594286; x=1689186286; 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=kScVSImpsdK1NQLomalsCkIDo6086/qDqCk2KIGeKx7Kz6SphjcVu+5ZdqaDCZHcei vhsH6hBMBBt+DWaN1Uj9hKrHBzBWfXOTxyOw+V5v7Wk7E4PZrzO/rQjYMOgTsmFuIn+T E+eIZNEUWb4h9GK86e/vmBPsAq6ilenhe//jGnZ8lrB9moCC7k8j+Op271Rz/5v46EYE +aPAcBZkvu4rUX7bH5KBMwEWAeG2I1c6ySpA1yH+FEqi3qd+b+jF2yWb/lzewqKY6jmI R3ScylNEZpafJ7KsT6ReKMPfj5IhGxQlecdhFmq5IkkE+pd65jGxtS14AVY5hCMnJZ39 uwww== X-Gm-Message-State: AC+VfDzHY6g6lsmSxAcXsWlSpBOA0ThLbeiPhAlr55LRZFI8ik8Rcz8W CsSDZlUxL0/rh8gYTi6wMWkW8w== X-Received: by 2002:a19:ca12:0:b0:4f4:a656:246f with SMTP id a18-20020a19ca12000000b004f4a656246fmr3823925lfg.18.1686594286170; Mon, 12 Jun 2023 11:24: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 v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:24:45 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:23 +0200 Subject: [PATCH v3 06/23] interconnect: qcom: icc-rpm: Introduce keep_alive MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-6-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=3661; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=g6kESh9vFn5cUExPwamnhleED6tFd+S7dtFe11cmEVE=; b=I69+kjQXJVdvJApsPmJL69bq4YZqdPPzfGBOV6wtwjtabEuvPTbjEbGOECIlEH7SPoByF4Ei/ meXGMqh9pcnCUIcKf2O2vCo0umGdZmJioDwoFaAEG/1wX2ih8grFS/c 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 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?1768524780540034864?= X-GMAIL-MSGID: =?utf-8?q?1768524780540034864?= 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 Mon Jun 12 18:24: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: 106763 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp69684vqr; Mon, 12 Jun 2023 11:56:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ730BDMclxrHjZUUk+X0r/l5XIGsGnY7Xp6GudaGcntF5OgTgmHWDjYcHenfgS8Yr4wHCou X-Received: by 2002:aa7:88c2:0:b0:65c:2ea:2c5e with SMTP id k2-20020aa788c2000000b0065c02ea2c5emr13116590pff.29.1686596171472; Mon, 12 Jun 2023 11:56:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686596171; cv=none; d=google.com; s=arc-20160816; b=R/3U4tbaUF3AN3dHArELmdVlvEJRbiHKrfTZoy4Ao5axCgnmFsvwwu0qKHUz5kN0nf 0m5/KKW+mff74sEBiWhBDXR+1DFHcklBj0UQcQHFds04Z/qvxlNU+uTZDQGHxnq3511z y8LhP1X6EkrGXd1BeZ5c6DFuHtq8TqgCxAheMXwo0BiWaCbhZTNWpKMWlC3xtVfai8AC DIxNz81DUyP6yEnoo8VtS0oRwY9ZHYqSryslT34b6FsBRAJDwg6J4HMThBtzc6MrCOmj /ibp61BUCYpvN1bJyj9x5cPItqJrTO8qVOxf5kxa4pk2l9I7T61PSLqtccUOIX5JJUl2 uNYA== 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=FsjjWN/3ExrWWr4Y2ppq6JQGmoO1NTS4jkjNM8tw+cY=; b=n6xim4VFnlyJMbwqEeqfCmbxNv29zuFAWMo2Db8IDCksTjRqf0GvN9uO2MRP2Ugn+l TbSelV5ZR70AXTNYwHgsacIPD2KMOXOWh++8yxQrauZDnZdeYb0NB0X707IvPod0eThz ZVvY1leIILEZ4v294ZY39BheBLmSCcauTYQ5WEGRjProMneHmt0cdaD6Hfmlx/XTt7W0 adDs1z6KktXM09OL+JAbRoWQ5icOptDfehM9SHZFDqroQwi1BXahCYV1psjmm6tywh1z nhQCtylDLzGib6a/T3LPjs317S8Nq8UD16ra5sgDU6NGUfeT/YlYQ3Kk6ZnOtzqL7nde +UcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K54KstXC; 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 r2-20020aa79622000000b006581d3c44d1si5029930pfg.89.2023.06.12.11.55.58; Mon, 12 Jun 2023 11:56:11 -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=K54KstXC; 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 S237975AbjFLSbT (ORCPT + 99 others); Mon, 12 Jun 2023 14:31:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237709AbjFLSYu (ORCPT ); Mon, 12 Jun 2023 14:24:50 -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 19ADD10C9 for ; Mon, 12 Jun 2023 11:24:49 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f6454a21a9so5514142e87.3 for ; Mon, 12 Jun 2023 11:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594287; x=1689186287; 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=FsjjWN/3ExrWWr4Y2ppq6JQGmoO1NTS4jkjNM8tw+cY=; b=K54KstXCd6kINZFUtZ3Smsy8fneDRssP9Duv/nwy9dWQ1mXbMw0Q3xn6fqjKVhyoRW UbP7QxyL4lzL2aiI4funWx4hQgIvgF1V6h3uBe2mC0aYxzG3AGgCocZpqXGrSZmvs9LY vlMIs6saA8UijChiRSWqs/UGCdQtuvgjdp4N7XXAEEmHQ7fUWyYSJu95z3E05avM+Imy KQgWoI13E96ZiKo6Kc+aAtb4KPHSdxxhMufzksEc272v5eA0/AAQLtbSnJPbIuZqGU8m dN3+gcPe3Wt0DSJhacABEX51q8dZWDNty7clvVR6d45SQ2zlBRZj5dp2WTPyuIlvDa2A Qq2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594287; x=1689186287; 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=FsjjWN/3ExrWWr4Y2ppq6JQGmoO1NTS4jkjNM8tw+cY=; b=fypnH5m0zPPEVeb783NFX2+NMyRKM5CpMkjmr1SZtNJlCUl8Uc497oEdpCVoYMNibv G4Or/3zwdjD5FhYVp6ZHiH3g+01eQ/48d9j51INJHum3D5YOpQogEXcSOTex4orZ7b/x XyyHJTIbHvh/gdRJk7/AbpPGkJv12WvQloJYxQbN27uPeliNBTeTIHpu3YD6Ix7IulqK SgE6hdGthfMa7C2rAuO82K8zZRg6ghFE9KuVUiP0iS3oQkGAyzCi5eqSAquv4ggv/BCo LnYvCvCuKn13dmp/h9Fs+QYHWA8v/oEs90AOVQ0l1+a64j5ZSFdE/G6alNmdruZTOU4+ dylg== X-Gm-Message-State: AC+VfDxGz0jyWXutRqiclIU/+01Bfg9GxZA1t1KW10zKoGg8oZKahUIQ Njfd+SEs9Ck93xm6KDx32xF8JQ== X-Received: by 2002:a19:9101:0:b0:4f6:1863:6b47 with SMTP id t1-20020a199101000000b004f618636b47mr4603716lfd.42.1686594287470; Mon, 12 Jun 2023 11:24: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 v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.24.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:24:47 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:24 +0200 Subject: [PATCH v3 07/23] interconnect: qcom: icc-rpm: Allow negative QoS offset MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-7-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=1945; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=rgTDM+URKWJ36SFNnllBnyQwiFYuxKTtmuTacUJ+85U=; b=7UiBzS0n4xsdfHTqQtldUSL1Fr4X4ozDE1+IvyrfLr7nbeJycdVlDkurmHFJcs6oCBEdTQKJS fsyt6fTKUY8DDiVa5bFEWu8qEZXRBe/GT8V7EuZ9RnxlbiJiTJftXed 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 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?1768524266949280675?= X-GMAIL-MSGID: =?utf-8?q?1768524266949280675?= In some very very very very unfortunate cases, the correct offset of the QoS registers will be.. negative. One such case is MSM8998, where The DDR BWMON occupies what-would-be-the-BIMC-base which we usually take into account with the register calculation, making the actual BIMC node start at what-would-be-the-BIMC-base+0x300. In order to keep the calculation code sane, the simplest - however ugly it may be - solution is to allow the offset to be negative. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index d2c04c400cad..ba840a436cc0 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -29,10 +29,10 @@ enum qcom_icc_type { * @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 * @intf_clks: a clk_bulk_data array of interface clocks + * @qos_offset: offset to QoS registers * @keep_alive: whether to always keep a minimum vote on the bus clocks * @is_on: whether the bus is powered on */ @@ -42,7 +42,7 @@ struct qcom_icc_provider { int num_intf_clks; enum qcom_icc_type type; struct regmap *regmap; - unsigned int qos_offset; + int qos_offset; u64 bus_clk_rate[NUM_BUS_CLKS]; struct clk_bulk_data bus_clks[NUM_BUS_CLKS]; struct clk_bulk_data *intf_clks; @@ -108,7 +108,7 @@ struct qcom_icc_desc { bool no_clk_scaling; enum qcom_icc_type type; const struct regmap_config *regmap_cfg; - unsigned int qos_offset; + int qos_offset; }; /* Valid for all bus types */ From patchwork Mon Jun 12 18:24: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: 106768 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp77255vqr; Mon, 12 Jun 2023 12:09:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7l6ktseSylVt4JAH+e6gW2I3lZmzOJ3On/Ag5D2I5SD1/R+OceGN6A3NBEP2FXwPuNJky/ X-Received: by 2002:a17:906:ee86:b0:974:e767:e1e7 with SMTP id wt6-20020a170906ee8600b00974e767e1e7mr11117286ejb.28.1686596960767; Mon, 12 Jun 2023 12:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686596960; cv=none; d=google.com; s=arc-20160816; b=Y5fyLM6WlIqWcDN9LQ6EiHqSMfuXBKKosC453Kt0hiPMGRVJ/hIxtsuZXoIvZlQgPS 2rqC+n0nH5OsN/yNPwDVDo18GVz/tojaCFb7fbGAryrkiICRorZFpsy9TfB3PSuIKxlD rnED6UB7qOKw698AWq5mtEII8VHMgI9Cory0oC5/dBLPnrFNZ0Ck8jyNe9K6F/sk1Ior +BQXE/kvrtsucfMa8TOPK5dRuHfntJFk5d5ah5LBkILBkcdvss/d+z75tB4zJeW/ByLl CWvY5Kp2G+WcDQ9yYFKEc/Xd+Z29W/18cN1tdtpb1VyI3vwbeqnwlNzwUViZhL1ujuhj hqFw== 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=6yqoaw1SJxAVA4zfoNJA8WPzYaF2aeMvPE6QC7WXXuk=; b=SexSZDsIDVxRrZGfHsxQpOOjje1Ruh5FeetD2KrWjQVWWu/FoRrHsZryhcpOVgCpK4 ChFz0o0LsO3etX2yKgG1vhQsA39BJtJjq8GLd4ovN/2ymBlx0a8HvtiljvZt5Gpd0DmH ajC0VicbBVf00tus43ZRDQdde9bflhOa++/oj2FAxE426pos4E5UoqzisprzCGOdXssH PS7ojuifEvQ4B+hNvPLt6cKj/P0RGk9G9M2fi8XEGTfAeHeW4QH8GK85uxjLchlL3mF9 S4+kHjAYn1sAnxqQnkD72Ap0a2zSNOhnKMmPR3t14bX7BwSCDvo/oarWjjWp16lrRtMA jdWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HXx7O95G; 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 bn10-20020a170906c0ca00b0094f40b0b072si5246442ejb.978.2023.06.12.12.08.53; Mon, 12 Jun 2023 12:09:20 -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=HXx7O95G; 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 S238014AbjFLSbY (ORCPT + 99 others); Mon, 12 Jun 2023 14:31:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237728AbjFLSYw (ORCPT ); Mon, 12 Jun 2023 14:24:52 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFC08E78 for ; Mon, 12 Jun 2023 11:24:50 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4f6370ddd27so5471649e87.0 for ; Mon, 12 Jun 2023 11:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594289; x=1689186289; 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=6yqoaw1SJxAVA4zfoNJA8WPzYaF2aeMvPE6QC7WXXuk=; b=HXx7O95G/RxZlr/mrQToR+gmTUHWaPGJXfTN9fxyN8X6+pDD5XFk7ZBOdetoZwk2GY C701tdr+7Pnbadb50ClG5RbxTUX7K0cT7ieko+Thqfjxi25oyUbOqsBAvLg2Mvk5SCR0 17vmvdnynmfojyUzQcYbftj9KbksPukOyZPq+Aru6WQrxkHF+WwCmbCYCtw1ndVWz7Nk Q+fnoDKK3TMoMPqB7Hjwenqh+rsTK6K1kiwaeJFwQ+m/gE/UYqhpEd0m8/NHBUjgTfyL /rABWTTFXBfA9NEce6Ge0F3QuGq7Y2UvnkFKNMGx5C4fjDbsXKqxo91VUg+VVTIfedwB T9mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594289; x=1689186289; 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=6yqoaw1SJxAVA4zfoNJA8WPzYaF2aeMvPE6QC7WXXuk=; b=WS16W/kSLzCa7LSVonVIq0QruieYhJiqiP4VYd/RmRBLXMvXRKLG76pMGFuSTeqnb5 sXWaZ+oUnuta6XrD9ZQqZSmIheipwsWpBL4J+aSPTpMEHhS/PBg6LLbdVxnPFGOvqPxa jrqV6b830Q2d1WIckvcv78WcyTcNDVW4ErF8W6S6tq9AvanZDahTFaajZfMm3Gikqa4j shQA42/1bqS9wjz1bhshh6bJX5mKC3wxW6e/QoO96Vpne6XB21NsbAwjGxANqtUfso+h ipoS/TTYMHgqw9Ay7Vq9i0C/iHn3tWVoJ7oCeiIZEK8RMgBfg4O7soAkj8E/ACSfSp6h gE3Q== X-Gm-Message-State: AC+VfDz65KBPW1RvcTJTjPJyCizzO4MB6leylu3cUQjUDjLLqVnr+a9I QulfmQF6kLcgrrULlhUSz5bh9w== X-Received: by 2002:a19:4412:0:b0:4f3:872d:10ff with SMTP id r18-20020a194412000000b004f3872d10ffmr3873606lfa.64.1686594288899; Mon, 12 Jun 2023 11:24:48 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.24.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:24:48 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:25 +0200 Subject: [PATCH v3 08/23] interconnect: qcom: Fold smd-rpm.h into icc-rpm.h MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-8-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=5451; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=byYAlps9wH1OSJiblDOBqmeTnt9HlHHvwOPwDsuq8eU=; b=I+JaIJ0OO3wATvn/WbOE5vZyifDRhakulgD5utYH8IUJJb37PWyxiWYbJcxxhbc+mEubpEaxC tJYhhXuRjnNBOSC11lMB/zedkTjSZHFJxX/+X4WecOL/aCZmh/TWH4u 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 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?1768525094637894332?= X-GMAIL-MSGID: =?utf-8?q?1768525094637894332?= 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 863e8ba1daa2..b8ecf9538ab9 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -14,7 +14,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 ba840a436cc0..9b4ea4e39b9f 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 #define RPM_BUS_MASTER_REQ 0x73616d62 @@ -121,4 +123,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 5c4ba2f37c8e..196b05879896 100644 --- a/drivers/interconnect/qcom/msm8916.c +++ b/drivers/interconnect/qcom/msm8916.c @@ -15,7 +15,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 caf0aefad668..639566dce45a 100644 --- a/drivers/interconnect/qcom/msm8939.c +++ b/drivers/interconnect/qcom/msm8939.c @@ -16,7 +16,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 20340fb62fe6..1f7e88a37acd 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -18,7 +18,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 a29cdb4fac03..cb636e67a5a4 100644 --- a/drivers/interconnect/qcom/qcm2290.c +++ b/drivers/interconnect/qcom/qcm2290.c @@ -19,7 +19,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 fae155344332..938283ddd0e3 100644 --- a/drivers/interconnect/qcom/qcs404.c +++ b/drivers/interconnect/qcom/qcs404.c @@ -13,7 +13,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 7ffaf70d62d3..003fc7d110a7 100644 --- a/drivers/interconnect/qcom/sdm660.c +++ b/drivers/interconnect/qcom/sdm660.c @@ -17,7 +17,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 Mon Jun 12 18:24: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: 106752 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp57621vqr; Mon, 12 Jun 2023 11:29:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4jIzmozmx/1iXiUQwS6bKyztF3NkUKkOQV9UsVH8yH9R3Tu9xEXt9T9llFwt+w95q4a4/I X-Received: by 2002:a17:903:244d:b0:1b0:56cf:b8c0 with SMTP id l13-20020a170903244d00b001b056cfb8c0mr8550187pls.13.1686594576430; Mon, 12 Jun 2023 11:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594576; cv=none; d=google.com; s=arc-20160816; b=ssHG/MypPb2olXPfUvb3msPs3H0GPZncxQm/s6c6xWmxXOwOzL71F/JRDTFpHyuZ8R BS9sjmanT8yQjEX7ZnDSCENSQiXYHxK2QY2aHeRTwZA6Zk83ap+Pbvk8mJ2PscIR2GT3 hrkILNyOzpC+s5Dm7mYLHXFhM6+hVmJN/kjiqcI9LBPxP1GrnUjGvNkiGwcJ4JZbRV5s An3n88wObnEibucnNhApheJv3hp1/tDPSfyBZ9R/2kiRqLQifLlW2lVhI7xYwxUnjUfv UtnxqZG4RhkuOBX21PLyANle6mkuKRSu6g1WWw34UNhvCEHj4CzBW74uQT4uApHSeYKa XWHw== 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=qoVwErVMHDjHjayDKUron2vfQdiFrlJxkN0o/O5bBtA=; b=A5+ByU8MLzs65kuUsQpyFoV2c4UhT9b44OsjCahQwOoD66XNMS+KAFSQQahmAaiype TRlCcC9zOxEvjHKXJOotZ8JJKcFKcqm5tV0pG+k2rqvUswQ249LaYQIIDVAxk5R1jt6/ h6GOsZC3UoZZFYih95EVZOK5QjPlUBn32PrnAauQzdeozM4mH96BAhkfBLZ3tKXiqZoi LsyiKEngJi6AA/rwDl7xhtxvIGEiGiEdh2fvFG5tQKVigTmtO53cYu2wmxblebMbpJxh 8B/iJnAqFIzMsc5gtfPODF4+pDa43smspPZJBrelmWige4QyFzbtqPoZwCCjtQlWAQCd rP/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qXRITVAt; 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 q21-20020a170902b11500b001b3c274fa2csi2442400plr.187.2023.06.12.11.29.23; Mon, 12 Jun 2023 11:29:36 -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=qXRITVAt; 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 S238144AbjFLS0G (ORCPT + 99 others); Mon, 12 Jun 2023 14:26:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237761AbjFLSYx (ORCPT ); Mon, 12 Jun 2023 14:24:53 -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 3682E113 for ; Mon, 12 Jun 2023 11:24:52 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4f004cc54f4so5580732e87.3 for ; Mon, 12 Jun 2023 11:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594290; x=1689186290; 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=qoVwErVMHDjHjayDKUron2vfQdiFrlJxkN0o/O5bBtA=; b=qXRITVAtc1dn+CSZ4LgYXqwiWtNcR9mM4H2dFeg2jwOiGmILmjhh9sOyoG9fN5rCmp WLYDkWb5McIecYyfKkI69ZqYiLz5SGzxRpDPGg4lk/5GFXMklr7T2H1jtr8HLvPkTJyt xZAALrjt+tnR+90+QknVaEAGd+A3NQo7TxDQyDzrEGLCT+5l/oqfs5pU3gCpZcBweaXS fsTalvBFG3SQs+djzENhPESI5/lCFktIy0OSAE05yT6V3LxjInpFAMS7uj6tB9VmZ+BU pMxJ+wiD4EJ+qcLUq/xIvhfe+ne+1KP+1WgB4R8+EqNSehSgLOcf5ptXcB842i4PThoV 6kKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594290; x=1689186290; 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=qoVwErVMHDjHjayDKUron2vfQdiFrlJxkN0o/O5bBtA=; b=cwYK0+uK2PeY38mkRIfEwBLAmbgqX2sPBlu9BiTvKwzBvkQJZv/0Vkfj9yZ4kK16Qa kWWeHoayVhWgL8LET6wy9rL+EnwKIIux/2OgA90lSBmABM2Vrc5jtvDZEE8Gzbi1dNb2 ZQVmmXnUg/5aQoyvIM6RXKUulqRDQfmzaExv6re9viGg6wghTClEhpug+uIjt7dVMydc Af5OrRpSWkUpRDtgK6HmjJUueBlckA1r/IzH3bG2WKAVWlUg0rmcJM3CmKw3dMdCAbzY J+9zb8VVof/rvUIYUacDMjPvCT7V1HJGoW51uQZRalh/lr0JRvuM0eQiEy7AjHlE3ir+ KU4Q== X-Gm-Message-State: AC+VfDwHg+byqzlFj91rFExgQmHkC3K+8/w84vvK7xEYmd1lOhyQyHp2 Cmib84W3bWmeXMhw647rgCJbT/kOhNgPlRsLDeM= X-Received: by 2002:ac2:4da7:0:b0:4f6:54c2:35bd with SMTP id h7-20020ac24da7000000b004f654c235bdmr4391451lfe.11.1686594290517; Mon, 12 Jun 2023 11:24: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 v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.24.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:24:50 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:26 +0200 Subject: [PATCH v3 09/23] interconnect: qcom: smd-rpm: Add rpmcc handling skeleton code MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-9-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=3554; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=CbTTRxJto8qrm6plde8cKMqpaBb1rdIRss/XEaPuhyo=; b=V8ybrcxkJtmQI9Y0OyQAx8gGXhOVsVAWAmYQeFQkAko3KQzznKBDzT0BSCz3JdRdcGbYuLwET JS0y1CmqbY2C6HAx8dSeEQJLyW8lRPvW8sLXe5nSdgeM03lyxl5a3/L 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 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?1768522594559159053?= X-GMAIL-MSGID: =?utf-8?q?1768522594559159053?= 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); Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.h | 15 +++++++++++++++ drivers/interconnect/qcom/smd-rpm.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index 9b4ea4e39b9f..aec192321411 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -22,6 +22,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 /** @@ -47,6 +59,7 @@ struct qcom_icc_provider { 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; @@ -104,6 +117,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; @@ -125,5 +139,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, u32 active_rate, u32 sleep_rate); #endif diff --git a/drivers/interconnect/qcom/smd-rpm.c b/drivers/interconnect/qcom/smd-rpm.c index b0183262ba66..433276f1e671 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,38 @@ 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, u32 active_rate, u32 sleep_rate) +{ + struct clk_smd_rpm_req req = { + .key = cpu_to_le32(QCOM_RPM_SMD_KEY_RATE), + .nbytes = cpu_to_le32(sizeof(u32)), + }; + int ret; + + /* Branch clocks are only on/off */ + if (clk->branch) { + active_rate = !!active_rate; + sleep_rate = !!sleep_rate; + } + + req.value = cpu_to_le32(active_rate); + ret = qcom_rpm_smd_write(icc_smd_rpm, + QCOM_SMD_RPM_ACTIVE_STATE, + clk->resource_type, + clk->clock_id, + &req, sizeof(req)); + if (ret) + return ret; + + req.value = cpu_to_le32(sleep_rate); + return qcom_rpm_smd_write(icc_smd_rpm, + QCOM_SMD_RPM_SLEEP_STATE, + 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 Mon Jun 12 18:24: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: 106749 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp57365vqr; Mon, 12 Jun 2023 11:29:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6kUD2wEuWV2Xhgg9medS7b54/SIwlx/Gt+Ha2Tf5UJ/vcXXzNIGYkJcgDVu1+pC6D+g811 X-Received: by 2002:a05:6a20:9593:b0:118:a48:8977 with SMTP id iu19-20020a056a20959300b001180a488977mr8820468pzb.3.1686594543162; Mon, 12 Jun 2023 11:29:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594543; cv=none; d=google.com; s=arc-20160816; b=p2Kq+NVqOB/qnfYoTLrpT7aMjajdeNj6IzxxP7xB8v0W4L6/gTmmb8U7EHe8qCmpW8 Xd8qdJvCSvZA8H90NMWT30a5ARjxTXtcRLSXoJW+RJJMpbYVueMMa7B6L/m+Z0Qjy/cy AuSjNHFEdGKAYOUtLvSLM3IKMuBMr0KPhSnkBWjcoZALdCxa9wi2gGCQwAadT3XpIEp0 PHzHcLkEvyiLrk6/ZjfCbLTtEkzfsfY95fE4k2LmXcZiyvp4zg5xXU4svGHtjseS3HHM vYg/hlJ00xKaBP5E9dGpPi1rmEGermJUNyB8xxG6lT3ZVfcO4m1tXvd84Wzq0OuT3mQe w6UA== 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=snY4D3sGE1e7ie+yqodjXNQjLORoB4Le2XvDi4Nyvxs=; b=KhAR50KOelMPVVfCUnFj6I9jmI81ph+5U2wjBhGib7JwZdac3qPz+En0Erf2DrELzC fDlMndu5cHNRuNseMAd/uW6MmocJtfjyy9w3CN2XUXtZzmFE+rXTD45orE8OTseRBjHk Wn9bnkT98GOScBByvSmP7gJFVxBGBImIgcioOiEaHCdYywZvC6w2Sgj0vitNDfRx9s/c CNAa9xRT+JGRDNqZU8mKWL0aIuvRrGypTSES2FjMy20UcUe+7dNA2ACQC33Vtugs/Zrx hIOev02U3RBA+u60JHlFeTrpCHbAWcWJ37vpuxDdmPFjG0OLFjVdcKUpyX8i0kBXXd4l 0Yfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A9iK14Dv; 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 c68-20020a633547000000b0053fbb3f1581si7544678pga.701.2023.06.12.11.28.50; Mon, 12 Jun 2023 11:29:03 -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=A9iK14Dv; 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 S237841AbjFLSZl (ORCPT + 99 others); Mon, 12 Jun 2023 14:25:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237782AbjFLSYz (ORCPT ); Mon, 12 Jun 2023 14:24:55 -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 89902E7D for ; Mon, 12 Jun 2023 11:24:53 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4f61d79b0f2so5747507e87.3 for ; Mon, 12 Jun 2023 11:24:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594292; x=1689186292; 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=snY4D3sGE1e7ie+yqodjXNQjLORoB4Le2XvDi4Nyvxs=; b=A9iK14Dvr2fyZJ5EIB5ihATVXvBrLUGYQxQX//LCY6bMn/TPCEPQ6ytS+JPXHdvgHz THwyJ079Kdd7lQai4ZyZ33SBUHovFnNxdOpVCG6txM2+pEzg4YOp0dNIPrBk+eHg7xYn cbIsVDuuarrrGSiPHx8354Pm4OxZ6OJO8Y78TBp+ZZU6h/5xFgieNhpxwd0W9T5mTTvr SEiMmF/jjOFTTtqBgPm67jesiZxT9U7sNujAf8hgCYuz65kt/0i3l8iF5nNYQ2h9hcce H2Owv887YQZ1VeoXg87COdI//BlEzihdiqoXdG5LlTYj/YpUMFU7xmxM3DyaLMCQr/Fa rbpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594292; x=1689186292; 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=snY4D3sGE1e7ie+yqodjXNQjLORoB4Le2XvDi4Nyvxs=; b=NP6BBe2WdTrfAKI4FWVMYW8edqhH4Yn7psYh4yaTLexY85rr3PxiO5PnttXMgw2QXu 0U6I4UCtRMqGO6InHuRnQhLukbOuWKCZSlXkJHr822+EmifogF90kqIKL7oj9MmVBQO7 RzAmaqgkfphjwPmTcNSOxRd6d9Z0vuaCP766yHJCHvizsIN1gFWN+x8DpznmeqULNc3j FWubcer8V7RB7cF4dB0Q7G64qdabNxP9Bct08/lG4g7Ek/8F/4Rekt/3I/4AxNHPTXJk vxMF9axpwwNOIrKykRmYb8LnKnLLihi8Yicp6IuFqt62KjWcM2+drm84tmFZJNfUr1yV b1SA== X-Gm-Message-State: AC+VfDx35oC7LNzqlCpJ4KHZCuwAWXAXWY2qWx9Kaqyh9HbTaW9Fd+Tu Itm+eCLP6T05jt+pB3AUvFg/OQ== X-Received: by 2002:ac2:5b0d:0:b0:4f4:b3a6:4135 with SMTP id v13-20020ac25b0d000000b004f4b3a64135mr4507963lfn.55.1686594291853; Mon, 12 Jun 2023 11:24:51 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.24.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:24:51 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:27 +0200 Subject: [PATCH v3 10/23] interconnect: qcom: Add missing headers in icc-rpm.h MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-10-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=801; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=FNDzStoIOSOrT5/ip8w/4v5ja9884ytJ2coU8jem68w=; b=HNBzvkKcu+W5oIrXHelkzZNLblTXWh+NlsrCqJcptnuJDB3Gi+ZQ1Heon94MsuDL/nfdvODc4 AaDMcoxC0AEA2B+JlHMVrQWlcaiCPprNS9cWwynDu64G4EBcgd62MvO 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 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?1768522559634346225?= X-GMAIL-MSGID: =?utf-8?q?1768522559634346225?= Currently the header does not provide all the required dependencies. Fix it. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index aec192321411..057a1a8b3cb9 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 From patchwork Mon Jun 12 18:24: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: 106751 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp57589vqr; Mon, 12 Jun 2023 11:29:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6tGU+AF78xXgtkqC/ZIjm/uTR8TEuazpbKGqPaJv/wa9PC/RNhA2V74pmeHy7Z5QC9yWEN X-Received: by 2002:a05:6a20:734a:b0:118:e60:35 with SMTP id v10-20020a056a20734a00b001180e600035mr11610765pzc.5.1686594571613; Mon, 12 Jun 2023 11:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594571; cv=none; d=google.com; s=arc-20160816; b=IcA8lq0i4UjdHf95D+tnHkwXzwzvsRjl3Y6vlu1AYdQZl2zNJCvYWpdvxQKjTDxvM2 vq5/KasvZQ0Dyz/E0S5MhBZNT7gX4OAh4OpcODjBVChEsgEHxfKY3QaOPH9VnW3uN6op masQyUInWt/xJD4P+0+Ht9IazM1tfDoLL90ODTW2KvY4gjzaVT9JV/jg/lxa00mGgkSr lWdikCg+m7ed+Cb7VyV71g27i8v1oaJNkPEjxh7EJ4un0K7REJsNsiYkykbihYty1Svg EeBpn7E7kmRxix0TRvIPJE2CbLVpFbEioRU/zh4iQ+aBd01Cz+RHanCeTjkfJ9ngjSc6 W3TA== 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=h+fKLnlHalDuAg33z9Jtbv/mJQQ+EEa4+LdoMppCsko=; b=AjEOeyFi6f+lTleTLOdI98JkS7xKHq7+BLDmwb27ZH565m/YXG5VMJ+fWrEzz4k366 7E0WAgkzz47TFnK2WKXZsf8ZOnPPfcD+qbr6qYAKwhDQWl+WxkWlfzvCG4keqQINIq+c xRyHURVEO1WKDfTTyto89Bf1FCda5c2r2yDyZygvL9Zckz7Kj/GTBIUTYFgKlNdh9toT m8Whhis7sZWsj9cFbUQiFplG8DHiEqIxfLHbgKfGHcxDMT360Pmh6GB5hpdgcDOBtOiU EMVt+NKykGJMefG1PZKBTYCi80imEAVs0H1h5JQq2MF2nyjDEKjgFp9wCC/xbYZIkXLA dCBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=La2OgBxv; 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 t70-20020a638149000000b00543f3aab2besi7321938pgd.674.2023.06.12.11.29.19; Mon, 12 Jun 2023 11:29:31 -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=La2OgBxv; 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 S238376AbjFLS0P (ORCPT + 99 others); Mon, 12 Jun 2023 14:26:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237817AbjFLSY4 (ORCPT ); Mon, 12 Jun 2023 14:24:56 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB987E69 for ; Mon, 12 Jun 2023 11:24:54 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4f62b512fe2so5755358e87.1 for ; Mon, 12 Jun 2023 11:24:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594293; x=1689186293; 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=h+fKLnlHalDuAg33z9Jtbv/mJQQ+EEa4+LdoMppCsko=; b=La2OgBxvBFrtW4m4CplAemsIBFvAxmMnIWokZAFiAB+Q697qjtl40sY1Io0vhc5RgD GYMlYKRYh7RIGaVZGmmEbKspnsSxR8R0QoXUlcBvJoAikFOrRij+4ELJAjG/1KKwFjwx LgGFvEoeiTZh/NMFhZOJYeJ4OZNk5dEjCcD+e3o42mxNRiVzWT9D+Pw0NHfnSQT7/dWF 4nhtr6l5omaRV+a8ZI9kmvi3kLzksYMG2AViYtKq9MPDXsTXMGM9J9jR5gil20HRW+qy bi75dm1OCv4vLeFcGfPe+nQGrQju6UZMTZVIDHliFZMfqrxDbNXw+JzPpJj3VVi7yefQ Tkwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594293; x=1689186293; 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=h+fKLnlHalDuAg33z9Jtbv/mJQQ+EEa4+LdoMppCsko=; b=PJ9Dft/AvbyDQN6jjg8iImGWb6CnekAaDb/j+M8KCDej7q73ZUvOLdC9gRnab9WaVO 835cqbrunuOa8pcnF7dFB8H57fcdGF94tTPgxw7ZjG9dV03atZ6MznJaNZs9+aSUP74z 1x1bY24eV2m+AYhVdGso8KEQhIA4MBp94Zf/nR596qYdcG32fQSV84yLjWe/kSjOCqoK 3XoM/MwJaO8mX+FGc7+8k/20ZgYuXYW4wOo7P3a+bkw3AmTbAWItG7Ku9Y3KbwhBCAPc GlDOPikpmEQi1QlRnOvypsKJ5eybnDM4X4rX2P576M1phmUp1wfsUUIayL4xOJYiW9xl S/dw== X-Gm-Message-State: AC+VfDwoq4j8uOIN/ASDWKFgaz7UzrKOEIlR7w/pY+It3hmBM/iEQs88 NUT98QE03CNae3hWsm5DuK2+ew== X-Received: by 2002:a19:5f16:0:b0:4f6:25a3:95ab with SMTP id t22-20020a195f16000000b004f625a395abmr4056807lfb.25.1686594293179; Mon, 12 Jun 2023 11:24: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 v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:24:52 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:28 +0200 Subject: [PATCH v3 11/23] interconnect: qcom: Define RPM bus clocks MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-11-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=3759; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=x0HK0TeLMEP7kpXmLD7jervQe77EX+FiCHoc2go6cXk=; b=RPPe1rZlc5NDivCFl9EM8aDcII2KaEHhRxDvpA2ebjzmGlNHBMAS8MvdmxDBbf7KBp+W7FBR/ jwBVMenGv12Cb72fuyw7x2aoLv1z5QfRLp3nTNsoib2yRCsIDNh5v8b 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 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?1768522589241309808?= X-GMAIL-MSGID: =?utf-8?q?1768522589241309808?= 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 | 66 ++++++++++++++++++++++++++++++ drivers/interconnect/qcom/icc-rpm.h | 13 ++++++ 3 files changed, 80 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..a195bf32aff4 --- /dev/null +++ b/drivers/interconnect/qcom/icc-rpm-clocks.c @@ -0,0 +1,66 @@ +/* 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, +}; + +const struct rpm_clk_resource aggre2_clk = { + .resource_type = QCOM_SMD_RPM_AGGR_CLK, + .clock_id = 2, +}; + +const struct rpm_clk_resource bimc_clk = { + .resource_type = QCOM_SMD_RPM_MEM_CLK, + .clock_id = 0, +}; + +const struct rpm_clk_resource bus_0_clk = { + .resource_type = QCOM_SMD_RPM_BUS_CLK, + .clock_id = 0, +}; + +const struct rpm_clk_resource bus_1_clk = { + .resource_type = QCOM_SMD_RPM_BUS_CLK, + .clock_id = 1, +}; + +const struct rpm_clk_resource bus_2_clk = { + .resource_type = QCOM_SMD_RPM_BUS_CLK, + .clock_id = 2, +}; + +const struct rpm_clk_resource mmaxi_0_clk = { + .resource_type = QCOM_SMD_RPM_MMAXI_CLK, + .clock_id = 0, +}; + +const struct rpm_clk_resource mmaxi_1_clk = { + .resource_type = QCOM_SMD_RPM_MMAXI_CLK, + .clock_id = 1, +}; + +const struct rpm_clk_resource qup_clk = { + .resource_type = QCOM_SMD_RPM_QUP_CLK, + .clock_id = 0, +}; + +/* Branch clocks */ +const struct rpm_clk_resource aggre1_branch_clk = { + .resource_type = QCOM_SMD_RPM_AGGR_CLK, + .clock_id = 1, + .branch = true, +}; + +const struct rpm_clk_resource aggre2_branch_clk = { + .resource_type = QCOM_SMD_RPM_AGGR_CLK, + .clock_id = 2, + .branch = true, +}; diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index 057a1a8b3cb9..99e34f684c85 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -136,6 +136,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 Mon Jun 12 18:24: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: 106750 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp57384vqr; Mon, 12 Jun 2023 11:29:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6HCMMgtOo8UkWmathsoQRpBA+br2a5wH2unwknA8FFeQvJbOiLBGnh80DWfiDYo0okHAjL X-Received: by 2002:a17:90a:7104:b0:255:d878:704a with SMTP id h4-20020a17090a710400b00255d878704amr9392818pjk.4.1686594545328; Mon, 12 Jun 2023 11:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594545; cv=none; d=google.com; s=arc-20160816; b=K+cfnorZVGKHlCn9TGbNBd7V0Cx+mdV836CeqW6XxfWsJ6FYD+sD79GIsBqV1FvjXZ hWz8c6xHM3RVML6XMjL+/8RMMcABSN8bNujl5cbjDvDs9y2bt6ja4T4+7RDylQKOkUVU UEtJRvnJNxz/vbMJHfENXQK6KLfoklJrdxweoeR4rGs5PW+JS1Uml00+Eflbgths7neW sdqoi/cvCCqGeA6sLDMr+KlkWPx4Oep8UIHjre5N7d0Ue0kbD1JT8VF3ew4sZgn+8l6O xhRA3gc5FIviUqWFSlYDpHRdgdLM8vKhibFiaCEDPhC/uaqdaUAEBy47CRlXaLuWfUur JL6w== 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=M/J5ZhP262QYGYmarLd4yzENGlRt7ikJiCOlHTeoidM=; b=qBW5VsRPrTSM/G6mq9JiTZQuyQMoeDIQatNM2y03aUrTbDG0aeXLaLNkjpfDgncyBl eMP5AQvuxoqELqbW4Z74HifwToe8yPpxy3zJ9hFoBgEhGPEkiBBd/D5QVWhZ7locjEyf 7nkaUOMRghorgs8RQsgzYmdKQB/mmthaIIqBQR0JUEQhvTAE7oYO3l+bNcWSoQHAhHjC +ZA6EJ2Ac1MUHAd2GLmQucXcimz7XXIgwhXKpLiQG36Efvuu8+Dk35YU5F8thfrzaEYI x4hrrmrB22SI0OY9k3frYCXDndSWN7l5oR/LAEjJVtCn26JhJO7PbgvGPlyceUhL9a9K rLfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IoVMD+Ti; 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 o21-20020a637e55000000b005481915c0c6si6914599pgn.31.2023.06.12.11.28.52; Mon, 12 Jun 2023 11:29:05 -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=IoVMD+Ti; 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 S237873AbjFLSZo (ORCPT + 99 others); Mon, 12 Jun 2023 14:25:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237855AbjFLSY5 (ORCPT ); Mon, 12 Jun 2023 14:24:57 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EF66E7B for ; Mon, 12 Jun 2023 11:24:56 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4f624daccd1so5290685e87.0 for ; Mon, 12 Jun 2023 11:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594294; x=1689186294; 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=M/J5ZhP262QYGYmarLd4yzENGlRt7ikJiCOlHTeoidM=; b=IoVMD+TiuZhJrqc7PYQ7KI1ovsCwOXa745dfeJW1GQPxD82LaWmBb1suS9dFnCtpMJ 4su7szZfcCP4vHzdF3b8+yTY91TtMjZBnWtx9BrHgZwXOqXAAzNGKyK7SKc9OolIZnLA GB3e+IR2/8FV7tQAwGKbj64cq9JT+vCj9wAhEKQ8mDIy05wtpMOqzDsCCyYyzdE2sNog xXdrjaLwcBjB4i+t3Zoc9XJwsh9vsJHTsNwGhH/QjrW4MGtNxqyP6xciAJ8TRweF3m9V d5/lghZHvzyHhs3o/FPKYSGYQbgBqR4pEeagMvkTeGJNuOiLp0UiN/Yc4vJ63Ark4YoM F1hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594294; x=1689186294; 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=M/J5ZhP262QYGYmarLd4yzENGlRt7ikJiCOlHTeoidM=; b=AqhtK6IBIyn4ICWX4WDZAwwRdMHD2ZGNVlTrDpRId82ak384Kt3yEg9StDUpZ4FReQ MzMDiE12R5KLZQCU4n7IQRfzpwpEO0o/WK1C/nbV0dWaGdq0zhpdwDPWpF+kV4bXoBpO 2LHQJMXT6oe7ukNIKWOEnHhB2i+nei+TZ5WP0qSpEHeflPPJbXH7KsfkBjQYrkZSpf79 39SfoJv6Thewxby7leIY764E0hXAiz3KE8DWZkVkkIrQPvdKbFHXoq2MotjAYGHllxXh N5ibN1f8k2R3d80zcbYe+P8+BrQX6vkio5s3nkXTaObav2fYC7M+EUT8Bxw9bEbPyxMs riog== X-Gm-Message-State: AC+VfDwor/XVwmOxGBvJTLkAzMvlMjkzRTEeU7zUftTq8MSi19OX5mkJ IgcmzjE4iN6qi+epnxYBrMYyTQ== X-Received: by 2002:a05:6512:32ad:b0:4f4:b3a6:4140 with SMTP id q13-20020a05651232ad00b004f4b3a64140mr3521735lfe.42.1686594294494; Mon, 12 Jun 2023 11:24:54 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:24:54 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:29 +0200 Subject: [PATCH v3 12/23] interconnect: qcom: sdm660: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-12-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=1986; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Krc2Kcr5fnOQoU3m0Y+nr01slcqtM3Q1E0UfX4Ye6Q4=; b=2b/6IkjpCVKop7AxhdWXBvUWfBCet//VkgmSPfHfy9/tAb7joqNwWZfuErOaQBTMCHZ4ldl5y 8uuZqPW3SYkARThKexAzyqY3OElO4UfWWvZPrJo9AsdqEXfpaRasoAi 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 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?1768522561897980489?= X-GMAIL-MSGID: =?utf-8?q?1768522561897980489?= 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 003fc7d110a7..5743ed680e8e 100644 --- a/drivers/interconnect/qcom/sdm660.c +++ b/drivers/interconnect/qcom/sdm660.c @@ -1511,6 +1511,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, @@ -1539,6 +1540,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, }; @@ -1593,6 +1595,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, }; @@ -1655,6 +1658,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, @@ -1692,6 +1696,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 Mon Jun 12 18:24: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: 106756 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp58117vqr; Mon, 12 Jun 2023 11:30:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4qigKIySsArd5roNqh5w4BCTY2kMyulOFptu2GHUZnEnDXTJAxWwVY8Zb+z4Y+wL8tVo04 X-Received: by 2002:a17:902:f542:b0:1b1:b111:dfe8 with SMTP id h2-20020a170902f54200b001b1b111dfe8mr8731358plf.66.1686594627340; Mon, 12 Jun 2023 11:30:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594627; cv=none; d=google.com; s=arc-20160816; b=SSE52mApYgHd19Gw8LVTOXwXgXY2UXAkGrn/+hOXNodLErAy8XWe/q/ySX9LQjpomS h2eN6wzAgQ2KKLis/QLi7Yhyv4iLB9mD+fW5XouTaxtzuH2hn7jPirOh33JsOJUN/PKB ykayIqAl3RWiYv4ilAOjBxvrykKvm2dhwMAFutUMEZ/WWiEOFDxW1vFr507T+vw8gzal FSrksU9+PG0/4dMu6wuZH6KPeXXprtcMuFOS9+c7fX9Be2cMD1GUC5r0oqSjle4FLQNW G7po1wh63WiobzM9lbW4NWFbkdkBI1FTZ/tfVsBiF2Lx1tAMsODbq6myfhlaSXWBo8cq iWiA== 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=sfWaXpFcH3gkTKoNeoEghs9YVVozZ9w4ELuAa+IL8Vs=; b=fZzZPEtFwR0FP50fVWsIqYJIIHRThR2R3ECBZU6Vd2mAflAbv0TK+KBofEC48bKBhc Ew0EvQFvoiMvfJQaAhpvUDAevmjsbTgxYEY2sW4KpXYx3qTX+QL6USSI1P12tc+UG9vl /ClfQNHRn1mgem17Zx5Jig3guZOEcTGTtP9ybGNWCeQC2tzoUHpTsTUHuNqHMSDyYNup AMvDk+LOqUQh/nVdDfwtPl4aX4DO892UYBkDIMK0OXtadU4z+Wybr7J7N6IVZhTHzSIo t2xhRqTOKs8I9jpf0L5y++1vpWh2IW3KPbvZhQGYcxvjlU/fotREbJiMobBssdZLeyQ6 rN8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XIsC1G2D; 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 lk5-20020a17090308c500b001aad9b73ff2si7139567plb.285.2023.06.12.11.30.13; Mon, 12 Jun 2023 11:30: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=XIsC1G2D; 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 S237816AbjFLS0b (ORCPT + 99 others); Mon, 12 Jun 2023 14:26:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237887AbjFLSY7 (ORCPT ); Mon, 12 Jun 2023 14:24:59 -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 8B773E69 for ; Mon, 12 Jun 2023 11:24:57 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f004cc54f4so5580856e87.3 for ; Mon, 12 Jun 2023 11:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594296; x=1689186296; 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=sfWaXpFcH3gkTKoNeoEghs9YVVozZ9w4ELuAa+IL8Vs=; b=XIsC1G2D8EwG8+1D/loBnHpn5UxIpqZb55NFbT+lEQRoG7kzsngHepGnW6+na08ORS 5+sQ0GcsVIfunDM+PYnVk5iP/gFg9WUXB5xXTxjzhJTxQB0okVILgNyFkBZH9/hZgni3 HgS5vk2hj0ifVQ9+r98qXt8H0jKtTEdtL98sG+91GNnszerrQtpHZrq+vgjeMoi/JsSe 8hQvf6zNojIXyEuer11y3loE8+tk0mT0qyl66hnOx5HXgJCcRDZjuZKdHIoVG/BcPjGd 6klgkmZoMMm/08lMry/b8cBE2RIKsFamHtAcrj0VL26pXrbeRuC64ujHG9KsVyNWrtza 38gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594296; x=1689186296; 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=sfWaXpFcH3gkTKoNeoEghs9YVVozZ9w4ELuAa+IL8Vs=; b=eNybyOrhrkM3Rx1v2qxL+Mh3q23P708NjTW0nEmaz8Cq5KxXIHlErBotN48VS7nEw5 bULHUz6BY1X0zdMEXvqMh+0eD1O9dg1PJ6i9IHMF25v1uS80bwG+l3+FuGImUoqEN9wQ xp7f5uUMPIOPvtGmMVeZpeE8ZoRnkpmT967YZB/0kjSEmGMbNv2yeh+k3CWmC0QLepen YtAdk1HRps9Yjvf4UgFOxB2uY7BMr/HUFlOWrK4y3ZfSqIUvcvVpPfMn/de/XZIwuISg M9jvvPZv4AMkvMPmvm1AAV3PItr3nZ7hl3dGtEmyrH03vxpzjXG51bmRU7r8iSQ09VMa c77A== X-Gm-Message-State: AC+VfDxwJ6aZJX3Be8N0hAS5rLeadumPrqV0U/EOh5mSPliGj8G/vZJl HronEYUT3Gv7oHRY66JdB97l1jB4AcOQgpt1eWY= X-Received: by 2002:a19:3854:0:b0:4f6:2e78:e4ee with SMTP id d20-20020a193854000000b004f62e78e4eemr4056080lfj.68.1686594295784; Mon, 12 Jun 2023 11:24: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 v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:24:55 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:30 +0200 Subject: [PATCH v3 13/23] interconnect: qcom: msm8996: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-13-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=2380; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=jls2pE5wAdO3X2AaNe/A0wroCOxxq+TCympGtPIPMpo=; b=TjBgCWvQqb8vhqBQkI/DzSJTFhkWboMLTMy6WoIygXL8SX16SGuUaCxZA+uOLSDD1R3WQWhDS hWHXP0C8xvFA+8WCbULhh61DTR1jNeWpJ9DDGDFB/Oc6Cpbi9lf2KzK 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 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?1768522647798952041?= X-GMAIL-MSGID: =?utf-8?q?1768522647798952041?= 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 1f7e88a37acd..a596f4035d2e 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -1840,6 +1840,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 }; @@ -1861,6 +1862,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 @@ -1889,6 +1891,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 }; @@ -1947,6 +1950,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 }; @@ -2000,6 +2004,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 @@ -2038,6 +2043,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 }; @@ -2082,6 +2088,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 Mon Jun 12 18:24: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: 106755 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp57869vqr; Mon, 12 Jun 2023 11:30:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5cmwtSCs/13uk2ebCHA8WTm+DDbmZ9l9BcdbY725qpRIzIrY5Kj0qUH3SBR3TilUOacHf+ X-Received: by 2002:aca:3bc3:0:b0:39a:bcdc:c0ea with SMTP id i186-20020aca3bc3000000b0039abcdcc0eamr4497127oia.16.1686594602739; Mon, 12 Jun 2023 11:30:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594602; cv=none; d=google.com; s=arc-20160816; b=NL5167UfGkux9Mma5hxErYzw2JE5LNcmkZ+ATfdUmb++hYwgPPf+/Tq+b8wnso11r8 Vx5PvioGhIQ3XOqrAQC+baO8wbaPdz5cISz2NxEG6jPH+9+Y4uFCgsEsFXtcQ1wLcnyz /r/+GByPhpK3IUbge/9lvGgI8vmClIYIYn3t36AUcE63F1WO+w5ihi4R4BghrL6jKkN/ Yu6enZzbuFVNVKtVZa3DvfFlCoykE/gbxddgQ8fXy3UtOUZH+MBr3Okeo65E7xvLjBl9 Sk5qlotBXmLxSxvebPkT4AVCF9fWj06f3MG2F50khsDthPy8JpnbSakrRVqUfaPcNRNj UW0Q== 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=oxwAlvsxTG2NJKirdi7L920nJWliszLcfh8qb5HaEiU=; b=Dz+4dZ94lKlwM4XQbCOZXpF7gOBNkcmBPtMyvCIsqru51uWOiY7+AfnDN2lUmhphbw fGWYZBetj/1XiccNWyVWUuJq/2Jv0gaCSHB23EW8bfupXj865ZgfQ8hocHqwjHbPBSXI I1kqn8K5JDAIlZZFvNjHWWB4TKTRK9IOrSd99PczfR9zZgFRt60sVyQShsZ9dhwaZ3TH C1UK15P5DbLtq2nSAa0l/qMLrDY1yrjOkSMHbViU6EOuZpADTdqRWitbzXumYz+W5K08 on7hRZ5ZllevYBnXlUQ/JuqkoKe2FbpNkt4IyEidqMwB7W/pZIT9J7mLVmhLmawJ+3bA u0IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KrxKoZAt; 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 k10-20020a637b4a000000b0053b29394937si7406672pgn.816.2023.06.12.11.29.50; Mon, 12 Jun 2023 11:30:02 -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=KrxKoZAt; 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 S238336AbjFLS0N (ORCPT + 99 others); Mon, 12 Jun 2023 14:26:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237903AbjFLSZA (ORCPT ); Mon, 12 Jun 2023 14:25:00 -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 BD722E77 for ; Mon, 12 Jun 2023 11:24:58 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4f74cda5f1dso1115921e87.3 for ; Mon, 12 Jun 2023 11:24:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594297; x=1689186297; 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=oxwAlvsxTG2NJKirdi7L920nJWliszLcfh8qb5HaEiU=; b=KrxKoZAteRQDDN5hHVT10/mvSJUs3GSrKyx9wHMwt4dGs7Ui1g0JYCvH/AvlxeJdM7 8V/eSMvAZh2aSep1ShcofRbjU+7mGzRhNRZ3YUxMYlsGe7EBiukq5F7P/ed1NS1nFTtY mP4l/9Kbc2YK66VTjWhbqirbsoe+Z0uMWjaunbEfD7nFlEVnFJorXOKZ4BZHhD/o/33G OBx4VXQY0ide1PAXexByFEv8RNdkVs9QSIe3MoHEHWZxhK5RVl7ForR/IdwlCHA2bZNH GVlHfTZWzK1I7UAO7G47vuNkn/4RLJ44iN4JoSxWtfVcV/9ypc7yR+nRkB89UNFcZwwR e5rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594297; x=1689186297; 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=oxwAlvsxTG2NJKirdi7L920nJWliszLcfh8qb5HaEiU=; b=HFQdzu2ObeSVYWOF/pMsHjN/RT7wke40ygANyzBIDuGCJOTaA6fl4YZcxSPQjk8qPA dnN56qKqLHvlriUY5fvVndDyt4vFzze0Jiu6aWMwA+jDIfrGCU9gxIskmwuRuLciR6qD 2+G+zQHmVQ8yeoJsrt2NiHJDvWz9mJ7bGROAG+NZ/H/Kjyexya4aKQJgjLxvgmjQ1Okz EdpBhfN7LtrIBgxvDrk/bJK6yG2vib+muF4NzGrcFXGX9uSmOgFgLfXVDrRMbbcLm3/r eaKbfjg1q42hVCxBuJTFiZ2zXvaHSvPU6eyFTi7Bc/exCRcuywhZl2RlJHrv59brUXeW hUOQ== X-Gm-Message-State: AC+VfDzQbLUd1kN//4K8+pYuEZM04keL7CQk/GR/e4rZCmaYmjdse+Mv dSCgbA0pPs4NYoICXzjv6HTmrtHobpqNNq9Ohu0= X-Received: by 2002:a19:f205:0:b0:4dd:ce0b:7692 with SMTP id q5-20020a19f205000000b004ddce0b7692mr4500967lfh.46.1686594297148; Mon, 12 Jun 2023 11:24:57 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.24.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:24:56 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:31 +0200 Subject: [PATCH v3 14/23] interconnect: qcom: qcs404: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-14-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=1291; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=NibH4RmX92w9jFbYbYmeVzyLtbX9fV3dfXE9S9JnGAI=; b=vYHOmrHPf2khIR+4l0Ku4Kx0v4SMVzTQA+pWwvGePhMzB914Y/Y915j+Ii7EJoq664w3zSQNm MlSw8cNNRLXDgr3saJcF5EuuvFEWnr3IsKGW+wWyoc8Q1xlYuOly/6h 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 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?1768522622165908391?= X-GMAIL-MSGID: =?utf-8?q?1768522622165908391?= 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 938283ddd0e3..9deb4d81104e 100644 --- a/drivers/interconnect/qcom/qcs404.c +++ b/drivers/interconnect/qcom/qcs404.c @@ -984,6 +984,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), }; @@ -1038,6 +1039,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), }; @@ -1066,6 +1068,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 Mon Jun 12 18:24: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: 106766 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp72531vqr; Mon, 12 Jun 2023 12:01:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5IJ6BZxWxG5DhCu+k8jzQi9F+UeOECqT6WeWQwleIz8QBCh71cAUDbVBbIT2URLmU2KXQq X-Received: by 2002:a05:6a20:e48f:b0:119:c5a2:b32b with SMTP id ni15-20020a056a20e48f00b00119c5a2b32bmr7576180pzb.47.1686596503453; Mon, 12 Jun 2023 12:01:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686596503; cv=none; d=google.com; s=arc-20160816; b=Y3Ra9Sb3S1lqkmyKrsGI996bHTLNo/A1W5D/KHJVDd9J4CnWGKbYNpIPWxnzF7jjMi UOXWltzbbCwwkps5W4dyFd+vv5yO+stcvzrNow9dNzMpu7116Rlm27H8s6FAvrw4JgKn ZtjhmbEUFSvbuJje2W30t00eApEbIcLZN2h0r9XS8256mx4A9zhpnQOS4+t7ncz2KSyC uffcsev/cw5eJc1eAyGXxpH43KqgEsFwWOfBhmTFvte3Qk53qjoGhC/cIJlS7TMF/4ci 2H1cGAPvi2+VHo0+Mplfn9emGuIHB/nj7WqePVA4HtB/Voov+Xlwh8r9pqPlS1X9goaZ fxgQ== 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=eHA+43B3syu0x2pUChrYAxljP6/us7hNfim2x8e+Qms=; b=QzRO73hNijM2H3AyROZRQi34eVl2ka+CLgeFehN5SDandKGv4zgvncb5KiyIxUplMJ aoLZb/4d0ow/WkzlBqlFERzUl3z+GFcp+WNrU2evV9mJFfFg1i9kDhMCNQpbAMDmL1bk rb2rucoyH/Gcrdq+b63s/kS3IC6xCpIusHMOsJP/tzyzWzIr+GCf47qsMPxOhv38hx41 w8YoPFRpjq+wkEmRQuFMaGM4/ZA0CEdXrhJ6uW6211tXkUHwmMbQYRIepsTk+ce7X0zC mo2RY/SlVyBe1NzXGWI7CCZBe+wroqH5kXk9MbLc1XY0zkoRrpViWINYl3QSd2K2oAoq cFXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NfKrzpun; 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 r2-20020aa79622000000b006581d3c44d1si5029930pfg.89.2023.06.12.12.01.29; Mon, 12 Jun 2023 12:01:43 -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=NfKrzpun; 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 S232213AbjFLSZv (ORCPT + 99 others); Mon, 12 Jun 2023 14:25:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237938AbjFLSZC (ORCPT ); Mon, 12 Jun 2023 14:25:02 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7EF5E1 for ; Mon, 12 Jun 2023 11:25:00 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f642a24555so5627973e87.3 for ; Mon, 12 Jun 2023 11:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594298; x=1689186298; 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=eHA+43B3syu0x2pUChrYAxljP6/us7hNfim2x8e+Qms=; b=NfKrzpunMVdpWMjPG9voSJeMucexL04h+BduTpiCgT1+Zullm2/uL1Mb4m+46lZhtn 6XMX4qXMA8KA5dgrnMfi0zOMX7WcnKbF8/fuu2g8VcHcCo4H+I2trCAjaDD0JA9/bMJa 35u5/qMcIMyb5xYuEJAWJpT0lG5J605IusXXlBcaTFYVWIrrxdA2nugMgShaXj4hCW51 27ZDUtuP3mfgpWTmpz0YsGU+iSNFqhJxX28pjWzWXAD1wPHrwjFrmygwMTCSqkzz4YrS GWT3Ink//XdE/yVMdjG7EGPQ6sjFNVTqF1yEU2+pywwQuwD64EHmqvf/6E+Gv0ZTYAMe kNvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594298; x=1689186298; 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=eHA+43B3syu0x2pUChrYAxljP6/us7hNfim2x8e+Qms=; b=BXO+cGv7yToa20Z+G68sfzNwSV3KO2FQm7mv+B8HQd7J8iZmCdkTlwob1BTddzU9j6 u+y28gdEPp8/LYh9CTkbQAuEjswv5YyWJUrXfYxBwjYvf54WXLrCaT58IwdS/V13m6Zd mnxwqrBh+X6Ks38NwNPpHw2d6meHFiC1Erkt8YmuO60LNiyppOz1PR+HxmAcEYMO1b/F vnjMS8c8KHL6Udjxo5U1CrErbPpn75Z01z/eUJc1Ldfj53SATxFrynN5ofoLW9CWYlyS UOqz3skLS/D7t5XubfIyT7gX7CauXpCZ31PcBFbIUfgjFy5xGcagq+Spw1o142OZzmi5 2tMA== X-Gm-Message-State: AC+VfDyeUGoYEC9ch9kVJaXvl4k6eT+5krj/Di5pZEFhja3NEXsVuPox fd8G2AXy/RP8boqsBS/XWe+ZReH7qmOzSdSljY0= X-Received: by 2002:a19:ab01:0:b0:4f3:aa09:5566 with SMTP id u1-20020a19ab01000000b004f3aa095566mr4439806lfe.65.1686594298549; Mon, 12 Jun 2023 11:24: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 v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.24.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:24:58 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:32 +0200 Subject: [PATCH v3 15/23] interconnect: qcom: msm8939: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-15-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=1734; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=1B8WtVx3wEojfY5dydOVxe8YjeFJXTMa40iYBVHPUpQ=; b=9IILqMRi23Bstk6wlqfTWuZtWda1m9Lj1xzdDTC/WaKfvRaX+YgXn4P8vKd97L/pcYu8RoNNw P0uj+LCNi4UBoMn2PMQh2Sun2+1Eq+YjfqIKcvvt1Rz4zDY8kj3k8wU 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 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?1768524614842618406?= X-GMAIL-MSGID: =?utf-8?q?1768524614842618406?= 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 639566dce45a..94b11b590a8e 100644 --- a/drivers/interconnect/qcom/msm8939.c +++ b/drivers/interconnect/qcom/msm8939.c @@ -1284,6 +1284,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, }; @@ -1304,6 +1305,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, }; @@ -1332,6 +1334,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, }; @@ -1403,6 +1406,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 Mon Jun 12 18:24: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: 106765 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp70642vqr; Mon, 12 Jun 2023 11:58:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6bUdq2appv1i31SOdcY4vBwDBUgOiPaa/DKYa5vBDwLAUPW970NvIM0DfqoCkSK/8w3O6E X-Received: by 2002:a19:4f14:0:b0:4f6:1bd2:66c3 with SMTP id d20-20020a194f14000000b004f61bd266c3mr4223715lfb.25.1686596314766; Mon, 12 Jun 2023 11:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686596314; cv=none; d=google.com; s=arc-20160816; b=w9U5xtFqNpl8SMV7qTX89ZD+GnifonmhgDv0HLUYAehsm/rYCV8jjjoegIaEHN/QfT s4Ym7RRVzMaE2mJiqzvD0LcQ8RI5f8t4PFFx4HTGv8fM6QuLuQpOFCCH+w/q8R75cQ6Q HjFP1Hy4l7WYPElyhvsPO0ln7YweQWWgpWih4Vu8EICxaTbSZWGxZy5Ijy9Ie4VZlHm+ h+3DOg76wTuqdhcS0JFe6BFuE3YTCUwr3sgWgpA7c33CipIkGxvzKlquH8nhCzE2tRQ1 xf6SVpMIxW0oIfUqGQlmV3/5P4ndmXaXPeCQD/X58aXvq2Xpl/cs11RdQwe2Faq0v0Vw T+bg== 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=+nc1+n/UQ2y64CZL44OODa51PjPBdbRWsiaTLI2r2o0=; b=aXMkL5+Lky55MrXAoUjpbfmryzkEDw6y53LgKsXipy8Lb9aUccJt2/81d1pQ1oTVzv 9yuRRZXhirxNy0gM3h+Yqmuvd6D4C2Abt0E8YbgbNkl7fNOOAYgfBYkhgwZo2quZtYru IW1ZIz9bhGNO+NyQQn38B+5EuO9EXMosQUjvtypnbfRAPihfP/Z+wAQezMwTtArdTB0i mtoWhht+GFjfHGip7o2n7nw1RDSh5KJGcWeFovc+6F98vj9CnvXBhLOqxZzKot+cEQHO perM4sI+44mAI3Q/UdLmkKRefgJX8dRrhlRukGdlqTxSYX5lE3IHNHlC8YuRuzgtV/lt LdCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Kwril7gk; 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 s15-20020a056402164f00b0050bd4957988si6096058edx.455.2023.06.12.11.58.09; Mon, 12 Jun 2023 11:58: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=Kwril7gk; 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 S238301AbjFLS0K (ORCPT + 99 others); Mon, 12 Jun 2023 14:26:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237964AbjFLSZD (ORCPT ); Mon, 12 Jun 2023 14:25:03 -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 1C161E6B for ; Mon, 12 Jun 2023 11:25:02 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f6370ddd27so5471843e87.0 for ; Mon, 12 Jun 2023 11:25:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594300; x=1689186300; 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=+nc1+n/UQ2y64CZL44OODa51PjPBdbRWsiaTLI2r2o0=; b=Kwril7gkjpeQmojfltoNDZDiXw13Zs+Vvqa4LrWMRMfKWSiK6s8tPWP1x76TvroBHu ytDxHlb1s9dRSeGviSNmgglcdcGysAneLyNQYeBhPi9nNynMGcMYzQUo/3mlorT0oI8h PZFyEq0JT9HgwwMf3ctPHFaE7j9KqJOWDJiot5gZf9HN3bmPMvb+xID+H9tYpiakp3hv sI6DsZuNE+gABtvjODs4wd4QerHlZOVUmsQwft+tlgIbrehm7y5dUZfcw1MElw0fYB7x xwKVZB/Vv0IVXy/7c622Yw5ZPyodLiA90WDIqqoOkaCcTMnHgWgAkqOhoG/yvf7C3+VR T8/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594300; x=1689186300; 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=+nc1+n/UQ2y64CZL44OODa51PjPBdbRWsiaTLI2r2o0=; b=drjG3w2BTSOE+7409cefkT7+eoZurv05BOzzO36VCOKhTRffAlYOVHkfaoXgi+fraR Io5UxuKgJZ1lz4fs9jLWzF2JQkDOz5HLs762bG1FcvrbhPpyvdj24dwln75SdJPU4g00 tFdIoZVVWIuEjE/A+Qbp93StA9fJgSBhCG62N8CQI0nUMTVm3Kvcsxs8ffltb5LmO2CF nhZkYyHWv+NgJP1QloNTKf8mL7XWIghLkw6ZgcZjVQgrZ94ufpX+kdXFREH3oCalpCnG 5Nvb4CdqQ0ABG1SnT2Ww20AMPqFvkueCLa4QoPN/iXuW4k8thdT7zx4i7Uu3SvNuvWSQ L5BQ== X-Gm-Message-State: AC+VfDzmG3z460Ay9G+QnkpeTGNlMc2OkbYd66LJF5kPLCt5NiBBsDqZ JhkT546125rOe+4FGv34m42w96KL0GLe7j3AHsY= X-Received: by 2002:a19:7915:0:b0:4f6:13f1:38a4 with SMTP id u21-20020a197915000000b004f613f138a4mr4174718lfc.41.1686594299917; Mon, 12 Jun 2023 11:24: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 v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:24:59 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:33 +0200 Subject: [PATCH v3 16/23] interconnect: qcom: msm8916: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-16-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=1438; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=U/V7/Y31OoJlewUp8cNNSi57yg1wtDegefv7cGiM7Cw=; b=nsKAwCSQtKK2LwzqCfgZoSGQsHxkpuRh+dW+5NcBXXbc6qg/N88MW7VSJDyd30DHLxfA9dCih iuDlO54o6SZC556r7rOX6undfSxnzdB8l2Zh8G9KWnA+DEps5Ey5GMj 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 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?1768524417485880370?= X-GMAIL-MSGID: =?utf-8?q?1768524417485880370?= 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 196b05879896..be2a190a8b52 100644 --- a/drivers/interconnect/qcom/msm8916.c +++ b/drivers/interconnect/qcom/msm8916.c @@ -1231,6 +1231,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, }; @@ -1259,6 +1260,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, }; @@ -1328,6 +1330,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 Mon Jun 12 18:24: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: 106748 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp57322vqr; Mon, 12 Jun 2023 11:28:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4orOA3AsSUKiHG5b5BVc1abVC3gj6IOiqXej9T6rVVkpCLn1owYM/65YWOo+JVQqTFy+9Y X-Received: by 2002:a05:6a00:1408:b0:65b:945:f221 with SMTP id l8-20020a056a00140800b0065b0945f221mr12361896pfu.34.1686594538052; Mon, 12 Jun 2023 11:28:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594538; cv=none; d=google.com; s=arc-20160816; b=Sv+4cQkneCQurXZLO16XFoEivJVKCu/ju49nHE1H1Fgdh83cFp2LtGX21nG3c3A8Xi LitZhgJwBXwMIGw+eNhTKDLZeBNnizCy+vsDUlJ0BKwJLFkgoyQAHg99ikX50WEb+iCH TgrWE5umPGR/sRi8Gd1pm3l2P3QcYnC+5eeW4wcb5yCOhDj0hpi2GiECpGQacmmwMYRN iX5T2dnIc+gLPGJCWXvf064hZ03bWC5+zKt6uKVfBOICD3lF95Fl+Qm3dgb0K/ayHLX6 R9J/I8gT1Y38hkiaGudyZQrMv4D0q2MTOLATVgWM1gfLJoEYDuzqHUjhid7q4zBovZLZ 8ojQ== 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=o0XnmH13ivRPPHGJLER9uxu6PJxvQI4F3jOrAVZw55g=; b=EeizeVuXgAtFp2gV/H3gbjGVy7POwsgkuzlUgab151cEmq9y7gTA4tnBek+dEZWXw9 bBKzYQqFkwW+1gxOQ0WbLSQXmfqa47i0YLvatK5v8zL/DbIQDtG7HuqTG5YdlKxblIeW IVmZMfopreMkEUby1HdRoqSppyLQrpoNCojZeph/dwkBvGPK082N52zpwV6Avm1VAKxd AvbxmYPVq/VNOU6D1vMn+8wn8I1PNm9o7O9igjYjnZify9E+DnS8jsqRhBIiN3i2lJiY wP3Pm0a2yfzdhkY0fR1884t9vAgHk+haumUS+p+9AosvQUTAZ5cbgR5+C2e7Z3EEqqIc P3yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xWUnJglb; 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 l29-20020a63701d000000b0054f93b0f943si1618365pgc.4.2023.06.12.11.28.45; Mon, 12 Jun 2023 11:28:58 -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=xWUnJglb; 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 S238086AbjFLS0C (ORCPT + 99 others); Mon, 12 Jun 2023 14:26:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237986AbjFLSZF (ORCPT ); Mon, 12 Jun 2023 14:25:05 -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 1D4CAE1 for ; Mon, 12 Jun 2023 11:25:03 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f642a24555so5628026e87.3 for ; Mon, 12 Jun 2023 11:25:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594301; x=1689186301; 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=o0XnmH13ivRPPHGJLER9uxu6PJxvQI4F3jOrAVZw55g=; b=xWUnJglbfMZ3rGAv4MqERD3xkoTFovYVULogIGddo4rqrnYrZ3CQo2pzIvvixci7ZF cvyZiGSZNclBDpIO/6nnnAUkchkfgtAvY0KJMTFCe0FM3HcWR7oiIG+UPE88Ke2y8kdT ZGZAo5ZszB6fr36DHkEQpVhlHuYPXtkGD/ZULQIkKV2WyTix7j17zyOj+uU6jaaN/WH0 f8mK2tNmAVyrJ0o6GdiR0oIVtBjcwC3xqJvOdlXphVDatRLU8W2b/AFyQSIgYlQMfRET dqEMYl6pfRD7W4/Fpm2e4fMNFadl7huGo9CJXqWWix/uGXisUj8PHUUd25awOPEkkynR s5bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594301; x=1689186301; 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=o0XnmH13ivRPPHGJLER9uxu6PJxvQI4F3jOrAVZw55g=; b=ZBkRoOWbKr3E4nNhR+nBdHccdh4Wvey4EdeP4YdlF5S04/zC9lvUny+bU4Q8zT04IU UUTvby2TCoRTBOBflt/AmNxjywNFty9QELik2TsFoAwBbO51TJ7jbsjlCWYF9uokYExb Y5xmDIDBZh2tJgLOwOWgyG7LDRXa0nDzpBUj4y4Cf5ExGNCbob8Vg392BH7/Onki+Z36 rbjArxZnCS1/pUT15R208GA/PH6Z+qNa3wtemiBPwj3Qt9c4cerFTex19JAwBBPRhrgQ 4t6JNpui1GrS8S1qGLPoDXTwWAW1ms+77mhX7y3r/pVJGNsyg5RjbK3/rdJAzKOfuXts 3N0w== X-Gm-Message-State: AC+VfDy33IsownR6s+tLKbORkOrESQPMpbKvEFLInzULBB+ZPgQodFLp GpENNZsvNhnEw/6xXJTdH7az6w== X-Received: by 2002:a19:671a:0:b0:4f1:458c:c4c with SMTP id b26-20020a19671a000000b004f1458c0c4cmr4275294lfc.43.1686594301435; Mon, 12 Jun 2023 11:25: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 v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:25:01 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:34 +0200 Subject: [PATCH v3 17/23] interconnect: qcom: qcm2290: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-17-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=2388; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=tSBMAPt7cmsb0YEEInMBYypPFAnegUdevAoSi5GlaYA=; b=j3W8fpt5zJJ9oVdPgFxRoSq13t7pBvjjzWlle1WJxmfiI9hlpvAlSXDXLRgCqdSPcavaI0zec lmxSOhAtaxsB82oAZy8+HDTap9uMpOfS7mykGamlmTqy1qjtzGM0Edv 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 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?1768522554689827705?= X-GMAIL-MSGID: =?utf-8?q?1768522554689827705?= 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 cb636e67a5a4..2c7a76fab83c 100644 --- a/drivers/interconnect/qcom/qcm2290.c +++ b/drivers/interconnect/qcom/qcm2290.c @@ -1196,6 +1196,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, @@ -1251,6 +1252,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, }; @@ -1292,6 +1294,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, @@ -1306,6 +1309,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[] = { @@ -1319,6 +1323,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, }; @@ -1333,6 +1338,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 Mon Jun 12 18:24: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: 106754 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp57676vqr; Mon, 12 Jun 2023 11:29:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6W7qMvpyGyUcT+EMw1jtNiUJMvXDD0OBoKsd9xtTv7sqINKP4+udzOzQAc3vySjSTSp3d1 X-Received: by 2002:a17:903:2689:b0:1b3:e595:2e4f with SMTP id jf9-20020a170903268900b001b3e5952e4fmr479596plb.41.1686594581972; Mon, 12 Jun 2023 11:29:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594581; cv=none; d=google.com; s=arc-20160816; b=bG2JhV0W+MTJyE+4/m4oTNLbpLqVdrYT0V3VY5d1ZLE2eFMDfHTfPBehQlK+aJezj1 a2aSvfg15kooUewbxXv1yysmMgY1GpfKr1hq0dT3I/rJrL1NKG9cbFpkGjBBVf4OKLmw G//ak9yARxamDrlzjS9LjmVB+jpfadGiLnjHBh1ovjPGHW7hnBv72+JiNML9heXh66yC N6gWxVNWI73CFalxST29p0KAF8xBFukw362NYekCcVmnDjV8YD16A7ICqdKjx0pNNLKq r+8AEnI3Tu9e3aoBwSq/Mecs0z0NmSPjujwivPCgrH/E9qd9ZnXEjBCKdNcwrJgpmQ// Cu+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=gWGDiMvAgFF+OdWB74Xsgx0SHSngeNCDg4kZzFrghW0=; b=kmV0kkkzCn4zpDLJo+v8MMp89suSAm9eG2+/lWJjHURBBXZN3aXK1Zw2lns1NwsSoc Eafmr9bHpxDag1ROXP4JfPZSc3xx1TcIs1XmTImfpmuDPOfNwfj7WNm/D0gfRil9O4XW fsArQC+vEPbL6xHVwcSZ6j/HezSn2SpMAiYKsRjdcZsrXBXoNCRJj2ZYywJHeBrrquDh XZeVo2QDmsFE2TnCo8W8kXI7PMDoz2jV0ZDVEqHiieO3gI7Khli3PJkjzrJxWuXox6nm bJZ34Np1rTV0HXwWUfyPdjcDbERRO83eYWoDf8HvPiIB2hNofBsMvnG/9DOWJiOR/f5Z l3vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OPesabt7; 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 lk5-20020a17090308c500b001aad9b73ff2si7139567plb.285.2023.06.12.11.29.28; Mon, 12 Jun 2023 11:29: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=OPesabt7; 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 S238288AbjFLS0H (ORCPT + 99 others); Mon, 12 Jun 2023 14:26:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238011AbjFLSZG (ORCPT ); Mon, 12 Jun 2023 14:25:06 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E4F4113 for ; Mon, 12 Jun 2023 11:25:04 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2b203360d93so56540241fa.3 for ; Mon, 12 Jun 2023 11:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594303; x=1689186303; 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=gWGDiMvAgFF+OdWB74Xsgx0SHSngeNCDg4kZzFrghW0=; b=OPesabt7YCHIKAugfQ0T/OH8pOlmT8Dkfswr9SufNap3vnlaiL5HzXEhpZVZoHz30N JuB89JRtQyHtXqMYi7oeSLqQn3BiQBNv4CLhdyquzWQbLa7GufmXwOtNgdfmNXGU46ob hrA8Aky772VSxNDw7HpGB4JIEmY+nB/MTiMq1g2keUtRabteToMdVlIl/U01TO9LlEmp 6tTWFIIICQydhHNb8JmzeBNvKPIeHzdcxuwIhK3Fxh7HbWrtUHyf+H3X6txyoWB3pfRu KRDsXH09+wPNxwmp1cRGW2phi+c3yq7aB2d95meIOnDF2FVu5qCijLZSEu8VLrhYkIrs OUkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594303; x=1689186303; 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=gWGDiMvAgFF+OdWB74Xsgx0SHSngeNCDg4kZzFrghW0=; b=NRc7PrxfdgsmBBj9eI4SSlUsj9ackNVwJn0Y53Y1FpadTfughRtFX/2phNwCLudFfC gymClYTtpGyWA/uOOUXrwUVrlcyirLw7PE9/p0+EDvIB61KrfER8S9erFc0DxYSb2mp9 4pplHZ7bXo7Mk4zoqGIJ1vBJ8xqlnHa2SEGADtIrLuR0VmFJ+mpKp5wt6ZORE1z/VmHL /BY2Yeu24jybbnfsIZC1fRB5YGB5bGkcSoC0p3H5sQRZghHQyZJObj+vjrdkQdeWD44L 3Ygj8M6CqFFO4Ou7asY++BZXDwIym4r+t/GwR1SAH7izmFRmzXkfbXVXYCa1GokorFov 3b8Q== X-Gm-Message-State: AC+VfDw581J1E4Sjqv039FODEuS3JonYiqlq8IcOHqchJ8hzHTL5/Oyd 8m3y5f3CjUVQOD2qawgPfJrkf1M6u0j0D1wz7k8= X-Received: by 2002:a2e:91c1:0:b0:2ac:7472:5486 with SMTP id u1-20020a2e91c1000000b002ac74725486mr3358296ljg.17.1686594302808; Mon, 12 Jun 2023 11:25: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 v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:25:02 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:35 +0200 Subject: [PATCH v3 18/23] interconnect: qcom: icc-rpm: Control bus rpmcc from icc MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-18-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=10166; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=CO2LFOPrCTWmeDyN0EPHffVwVl2L+JKeMRIpR9L5uyw=; b=VmvLwfiMhMK9vnaZWqfbbpou9L3FQbRHwvEm6b9qqXK+yZ4ljlnjVTtRjpSDzUtqOkJTUxVh8 88wc7CxK88cAbIE8Kgv+9GhduFpxSOp1IHjdh1ojcsDvdQzQgbBr1UE 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 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?1768522600111539239?= X-GMAIL-MSGID: =?utf-8?q?1768522600111539239?= 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, but that's a mistake in and of itself). Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 114 ++++++++++++++++++++---------------- drivers/interconnect/qcom/icc-rpm.h | 13 ++-- drivers/interconnect/qcom/msm8996.c | 1 - drivers/interconnect/qcom/sdm660.c | 1 - 4 files changed, 66 insertions(+), 63 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index b8ecf9538ab9..5ffcf5ca8914 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -49,7 +49,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) { @@ -338,11 +338,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) @@ -364,49 +363,54 @@ 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(u32, active_rate, INT_MAX); + sleep_rate = min_t(u32, sleep_rate, INT_MAX); + + if ((active_rate != qp->bus_clk_rate[QCOM_SMD_RPM_ACTIVE_STATE]) || + (sleep_rate != qp->bus_clk_rate[QCOM_SMD_RPM_SLEEP_STATE])) { + ret = qcom_icc_rpm_set_bus_rate(qp->bus_clk_desc, + active_rate, + sleep_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; + 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; @@ -448,6 +452,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) @@ -457,10 +475,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; @@ -490,11 +504,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; @@ -566,7 +576,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; } @@ -578,7 +588,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 99e34f684c85..11e7d503e4d0 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -36,32 +36,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 * @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 * @intf_clks: a clk_bulk_data array of interface clocks + * @bus_clk: a pointer to a HLOS-owned bus clock * @qos_offset: offset to QoS registers * @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; 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; @@ -118,12 +115,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; int qos_offset; diff --git a/drivers/interconnect/qcom/msm8996.c b/drivers/interconnect/qcom/msm8996.c index a596f4035d2e..8081b3cb1025 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -1818,7 +1818,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 5743ed680e8e..211fa1fa569c 100644 --- a/drivers/interconnect/qcom/sdm660.c +++ b/drivers/interconnect/qcom/sdm660.c @@ -1618,7 +1618,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 Mon Jun 12 18:24: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: 106745 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp57144vqr; Mon, 12 Jun 2023 11:28:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5PW2MJrbtYT9euwUCR1OaFEPg5M3hVmK0kRu+7LnTHkGLVXxxBG6jo10MaMW25tiV+Sq4G X-Received: by 2002:a05:6a00:198e:b0:656:c7b2:876f with SMTP id d14-20020a056a00198e00b00656c7b2876fmr12879404pfl.14.1686594514432; Mon, 12 Jun 2023 11:28:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594514; cv=none; d=google.com; s=arc-20160816; b=MIoNt8djGfsqEf4Y7Mzcwm0X5vyUlNwb8MvmMqCo1ookM1WMKwDE8CU68xySDOEkih 2HhkKAYg4b4WCxVf6rA0qdIYB9AXZnWv6wQJsvJ69JwxD3A5d1eD2+zQ7N3s4A0J/7mr OkBx56MjtMjjvJe9Jrav5LEz+L1HglH9p89Fu8bwNkvjV7fK1Xq/9L6ejsYnvB8xiFIr ODmN0uMKPiyz1ismZw3TgbMvzU5dlK/Z+LiKoDWH+O/3nIwjX57Lzw5jeIXzlQXH4oEB 1IC7S6kuug9YmgS2geNX0S8iSo2BwScz4gk5GOH6eLoDr+q7LtavaU2qMmnbI8633B82 vbCQ== 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=1Ie/OSwgrWBHLm1/FH89rVTqtrYtYjfPK5t6Q+ZwXr+D1bAuJnWzC9SS/QWVky88hZ fl5L6Gn9r5V4tmMJVq/43Fv8BJkiqJLUr3xxt0JGr8XCyzDax98ufLujFftf1ipBBXow s1qIgSDHOh9MRf7cM6hEeNFz1SW6YHwxqZpvEl8D81m9GMXJz+3tnvTpC8tim0MXh5Bj 6w+DZjtvkyH1CNdYfnnMT6zys5AhXM0cHwmA1T2aDGs8sX6q6/1xRLpWhRxl68qrBFbK gjU3cmyBFriL1CGxw2ex57Swl5GYTqQEQ/CimJnwsc3KlxI7RuvRlecOnOV6tex07OSo UrRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VLh3tzdf; 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 t70-20020a638149000000b00543f3aab2besi7321938pgd.674.2023.06.12.11.28.21; Mon, 12 Jun 2023 11:28: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=VLh3tzdf; 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 S233410AbjFLSZh (ORCPT + 99 others); Mon, 12 Jun 2023 14:25:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238054AbjFLSZK (ORCPT ); Mon, 12 Jun 2023 14:25:10 -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 15264E6F for ; Mon, 12 Jun 2023 11:25:06 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-4f6255ad8aeso5612478e87.2 for ; Mon, 12 Jun 2023 11:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594304; x=1689186304; 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=VLh3tzdfZtY3mQfs/cqpP3v9KSxoe+bHBgKUjDyj8DiMRDkzqndiXZs2Ss/0MxISUb SPtOvmO7YcYLB2WH4Fe6BLoe9eRu0QnWmRJpCGAgp/xYTOUJjBELrbqyPix+rwjmc03T DN6/OUeLouWl+UtsmQZnaugyTBEYkf5wt1N1i+4jZi988gYKG+EP7tJh0AOj/p9fvPxr FPS58LiXSJdBup06mIwK/6NV7QT3T8bL+/zrtVVkuSgcQtFWcY3cr9rkM6Bx5iUb76wi 0qH1mMcHoqlu+5tMxq0MdS8xCKTfkkCam0tslOX7jnji7BQfLeuNkH6J+0dmrKy696pb 0Ysg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594304; x=1689186304; 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=F9O9nPRg5CB5kxxJXoUrmLbmKq0NQBM0tGyIkxNETNERXSo6hCLPRZpUTIseW5xyOK tgPT8l88iyoljgxKCbRnIpPysAQaeLLbwqwQS3dTJG3379ByXZ3Kdzp81vSfjkDinubi SgjLNkzmC8QT7Z8tL12tHQxveHCqmXyrNcY5FcAFvd7Xo/0cToLCKUV2ssbGA97jP2iH lCK+txy2qjSC+bqB+Vn9gSk+zuS96KweKtDyp1azMDHxPCom9hnsgtFYwdYYSzlHUPzv r55upU7nM+mrhTocyGLqwP9wGTbkRqqldol+YnsKVyed9NYF/xzSdqc8sXhMo9Wp8pgD vUQQ== X-Gm-Message-State: AC+VfDx4mGI0Ck/c2bbVeB2o9FlpXt5om0meZaxQeVDO6qCfP8dRJsFm svukedAwQFNNrJlFYS+7MdXW3Q== X-Received: by 2002:ac2:5b4e:0:b0:4f3:a051:58df with SMTP id i14-20020ac25b4e000000b004f3a05158dfmr4304022lfp.59.1686594304301; Mon, 12 Jun 2023 11:25: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 v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:25:04 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:36 +0200 Subject: [PATCH v3 19/23] clk: qcom: smd-rpm: Separate out interconnect bus clocks MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-19-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=26677; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=b1fcpW1FguL43YfbPVvUZKbf1hq8/EEzu+HzcWkLj0U=; b=XR/Suq+cy2c280/f1YdpB6CIcwZ6vuAXnyQ3R8oVNxjjUgn8kzmrLkk9GBXVYaKXHM/tJaVdE DO4Rl4PfOoUDxqGWl+OBgEAic67bEYznS5PqL3bpi0t6xyTn6ky2DTK 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 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?1768522529050779377?= X-GMAIL-MSGID: =?utf-8?q?1768522529050779377?= 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 Mon Jun 12 18:24: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: 106746 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp57247vqr; Mon, 12 Jun 2023 11:28:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Nzc4thZBY4mkizo1mXLn15fucmXlomxUmF2Wok+jFDTW3A02axsnWcPAYBkcsDCZJvuV5 X-Received: by 2002:a17:902:d2ca:b0:1b3:8aea:cac8 with SMTP id n10-20020a170902d2ca00b001b38aeacac8mr7337431plc.49.1686594526499; Mon, 12 Jun 2023 11:28:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594526; cv=none; d=google.com; s=arc-20160816; b=bA+h5fQTIiBN1XBWz+Do5x1qnwl+ODBarS8hyjmafqJ/yj4YYhq48ihwM+xOpcqmvV CS4UgPA452syzN1DxaGVZHlo3SsrD9cYajw/k3ehmh01e5X6x+eL0mrmX7psMjLt4IKl 8CkDwsNOZvbLxorAhDIVNxvAHQGPs/6/5nQFSlYsG9UbaepWOpL6uOClhriFDbUiJgjP GC2WzEPQ51vSbCTEWbxzMm+RUJBfKJTRTMIfVa2UZv4SJpy9iPZSz94IUirm7m1XRhJn cb61P8ugWSB1YP1p4fBfbv5IglJwd+EmF9HosXlHuYWRdPH9NN0iqeb+CCz1X6kYpR6S zq5g== 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=Mn+beXrwy2rPvtKCwVV286nxF9lnxFFy0NVFWPVQv9o=; b=muKpJgvxbgwBRWexycpl7ZmaNGQpd3jfIsMJQwFL+cN4jaiZ5pjwJY8X6Ixf1bDc4M a8XT3iFdojUQNHxN1GnJLHLeI73k0HGG33OOSYM/SEQLK5qTXzR14eQDvaQ6FeyvtaDV lEQRJHJucUiIO65g0tA9W38SMRAV3oQZRgNV+tigjBSx/eKyWtlu8wK1/58l8bp9TLc8 /243UOSyZoPC7DqR0BwPCUlVHlhTRbZq18iniq8idnNCziIwNCh7hP3DiWGtEb/t6BKo Q3bQXl3TxDHCc68sPVai6DsXh93MkKUJt/A9LoEL/c97Q3zcz/m6WqKSR/g64TeTSWfj nXyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Pt4xpM9f; 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 ks3-20020a170903084300b001ab109ea531si1938521plb.558.2023.06.12.11.28.34; Mon, 12 Jun 2023 11:28: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=Pt4xpM9f; 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 S235117AbjFLSZ4 (ORCPT + 99 others); Mon, 12 Jun 2023 14:25:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238082AbjFLSZL (ORCPT ); Mon, 12 Jun 2023 14:25:11 -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 4998DE78 for ; Mon, 12 Jun 2023 11:25:07 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f6454a21a9so5514730e87.3 for ; Mon, 12 Jun 2023 11:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594305; x=1689186305; 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=Mn+beXrwy2rPvtKCwVV286nxF9lnxFFy0NVFWPVQv9o=; b=Pt4xpM9f3Qyc33kGH77l8LRYN4vUs7uRVgooyKzVrLk78tpiXun9l3IGfrtR7R4c39 V7sJiqJjpcPi/zHXuvcGbs6l4Pc+jMiqo636edIcCRHSblafFZMkXZ1oElc0XfvPexqi WX/ls61YdvgVTtr48P+04GBaVEOwRVnhZwoDEfhXo0TSL07ZawIB6hNIsIRX6qAz1f6v 0Gvl8DryQf1kTTZjjXnoMlXM4N9gogKQYrKACFSMEkHzXLSQSs0xHP+8CWqsuNlW4aqK 0lhFOwSSsUST6FeD1mg3dhMCvIkEicARUuDOQmLl9orT5HABcp1d3DOknoh14TgOkQ0T iGkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594305; x=1689186305; 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=Mn+beXrwy2rPvtKCwVV286nxF9lnxFFy0NVFWPVQv9o=; b=f0qgtPsyCiWqG9vLvVTiETZl7Y/lu9j6Dhh5p2u/XK/vtleyXekoEY0ZF20EoLSz9O 1q9IrOD/jg6bivjVS2bPGtIB79gulEWXmPPdaPic1EgkadZx/gIwH7qmFqzRzgTSYBhU RsWJ9Me8UJf6d8xj8cNEhjWMtD9f4OiXBfwO1ExXb9CGmdWx/zeY6Hw+bql6RbD6AqRb jwb3DxLTf9mS3GWwUwqD1H6kxEdCMhVXO0fkErj3DPToUNaUtSQQQicAbCi6jHI/jL3j O1uIuzfyrXRuXeAjrZhl40sn7K/7beUEyH1QjGqtQJfUCSHiGzbEENa6DOecUhkFLBjL XYbQ== X-Gm-Message-State: AC+VfDyTWM+zflAeAvShr1UYnWAW9Va5nrPzmlXdHX1cw025uu0H+Mme T+kfe3cI9e02Lsy4d4QGFm8SNg== X-Received: by 2002:a05:6512:44b:b0:4f3:a44d:6982 with SMTP id y11-20020a056512044b00b004f3a44d6982mr3863592lfk.45.1686594305636; Mon, 12 Jun 2023 11:25: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 v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:25:05 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:37 +0200 Subject: [PATCH v3 20/23] interconnect: qcom: icc-rpm: Fix bucket number MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-20-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=3689; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=r8IJnX3qpOJzlF+OYLs0u953pZXLOvcuUdYv13KgtFg=; b=k3gf+FAYDkzQT+/HlLdEN/dP9KKfMwgVvu2qiQ5y7XDAmEwPVCr2EbXClt4BpWPSmnhKxLvtH 3UzXiUR9axaDNroi6Lref/Ck9F+NIasdpuRYYu+uN0omrXoBfG6kDPZ 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 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?1768522542213210809?= X-GMAIL-MSGID: =?utf-8?q?1768522542213210809?= 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 Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 14 +++++++------- drivers/interconnect/qcom/icc-rpm.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 5ffcf5ca8914..54a9999fe55d 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -249,7 +249,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; } @@ -275,7 +275,7 @@ static int qcom_icc_bw_aggregate(struct icc_node *node, u32 tag, u32 avg_bw, if (!tag) tag = QCOM_ICC_TAG_ALWAYS; - 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); @@ -300,11 +300,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; } @@ -317,7 +317,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 @@ -328,7 +328,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]); } @@ -339,7 +339,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 11e7d503e4d0..ccc5541605ac 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -105,8 +105,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 Mon Jun 12 18:24: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: 106747 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp57255vqr; Mon, 12 Jun 2023 11:28:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4x941tdjA1k857SAzqMdIPyhIklaKHG9iSPwxw4jdekbc62kB8/SiW8fzSnWZYE/tqDOf9 X-Received: by 2002:a05:6a00:150f:b0:64c:9b56:6215 with SMTP id q15-20020a056a00150f00b0064c9b566215mr11732866pfu.25.1686594527925; Mon, 12 Jun 2023 11:28:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594527; cv=none; d=google.com; s=arc-20160816; b=hBtA+sMy/jUL8GgTAWMbNKLmCNs06chjubBvVHR80odUVoyKw1fh1euMT+k8d70aEL 6Lp35yD8Py2FECSae6R0z5YcUOv5PZioJbZJj3bK3ltrDNuh98kLdZsrAb+PFzThiOdN tBNotlOqK9DfIj9IUwjB5qLirZpGOKT6pCug0kdKEfbX9CXDOqlBDfU3IS/EFFMqoetz +HW/zaEnjj4H2tsUugNnTzYsjipOUQoNdO035PxMpQiA3jjDN47fBtPaMUCRnpTpbA1e GIojZ8PrmV5hRatH2vkhGIJEXqEx4SplJKCkrijKYpEKabt45fD6Ql+XZTbGBhOc9XIm nWiQ== 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=yiXNUpKstCZigcjDwi6CczeSWZkgKbJft9NnoaSwCv0=; b=v8w30nxTPdUcsLWQVLvePZrkQYzuYw3rxh+dFRSFRglN3WQq/AqcXhGDe2EiKdBXBJ ormUP7np54M/wpP1n6b+3iIi8JkETTL6K+PccoN7UVHoDhZlT+NXOpD7kzCKh1a3nZ9X m4VvKa61oaryoXGmCYwB/4MSIooeCYid0Gm/LW3ow5K0wfCeMdT9t0/T6mQaN2qwxgXW xyu3MUTkAFQ32bsj6R2VWitVxYlt74b1ZMjHBDiZzq51w2ARn03MLyztOgTVft7zBd/y dVLBgo0uw5lEq7fDHcl07DM7++rfUp9Yr9F+vdjghfkzZRrF73P9bYDE8yyoP1+C8F5m rYmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lEn0atd1; 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 c23-20020aa79537000000b00656f1d69ec6si3316567pfp.292.2023.06.12.11.28.35; Mon, 12 Jun 2023 11:28:47 -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=lEn0atd1; 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 S237938AbjFLSZ6 (ORCPT + 99 others); Mon, 12 Jun 2023 14:25:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238086AbjFLSZL (ORCPT ); Mon, 12 Jun 2023 14:25:11 -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 8BC7B196 for ; Mon, 12 Jun 2023 11:25:08 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f60a27c4a2so5277181e87.2 for ; Mon, 12 Jun 2023 11:25:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594307; x=1689186307; 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=yiXNUpKstCZigcjDwi6CczeSWZkgKbJft9NnoaSwCv0=; b=lEn0atd1doB+7QTFowfl+HhHhteJyAGWaVvMnNhyva0OFHYzVaz+rEvNXPK4nnF/qb OXqXnUXrIxcu+48zMpxkZ/iF0GoN66mbp253q3VSgUP+DUwT0A6biWiDhO5W6KrSHuSm K2e5n0TFzpenRtoOY3AUj+l0c2ahkBHy1OJ+O0KqEYYLWLrQgezhM3cUX1lMj96a8mG8 RFbU6TFp0Gaea0gk6ALlAnXTEj2zXu+XLI4WjsYvnxCjY4OeYRVCSmq/cUKC02ib2rb3 ycKjs7HPsLuzaNTIr91dM3tbFp5QJSkNZzXeFjg8TJf4ItCUSEGdOZp/GjWZPks6S2py IClw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594307; x=1689186307; 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=yiXNUpKstCZigcjDwi6CczeSWZkgKbJft9NnoaSwCv0=; b=f9sZK87tRA7vXGSX8UR3tWoUF4/UYmuP137Yn0MmvFG3gWQhcH0ad+zfXV95WxPh3f ur/bSMQK4+zA3w5Bq2jz4JnfEO3b2NENH8Bc62nT0noilZlUYL//U0eJzO8tyhqTXstE 9dnT1y3Y+OirGNxMgevotVEPuNSw2lsv16/rAt2H4NQwNUiH9IrXj93OgkIHmCj4/9VM Fh5hIsZfVDLnPhBDpQv1DYFXCblxgbK7wNcj+sHzxPTHGNy/Llkz6HBicjk6QP40ngWf QUr9pd0EqQRkGf//ybvUTp2gwy+6JmUSsEt73hFvZuNJ58f4UtLzKfO86+PwD82UKj7c 5L5Q== X-Gm-Message-State: AC+VfDzSX6TGhy3LWeglRIsOqVXcH9prIO5T64us1BOIV/UNq2n7Gt5F OPrB7v7znAdTdPBdsmSOEko32Q== X-Received: by 2002:a19:380e:0:b0:4f6:19c8:ef13 with SMTP id f14-20020a19380e000000b004f619c8ef13mr4055980lfa.30.1686594306942; Mon, 12 Jun 2023 11:25:06 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.25.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:25:06 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:38 +0200 Subject: [PATCH v3 21/23] interconnect: qcom: icc-rpm: Set bandwidth on both contexts MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-21-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=3312; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=MPi+rwYIYXZeBklOmqYOa88kWKK0Onm3BmECSi8XRMM=; b=gSI0Vjygc3kx3sImdlVouSfbLgogi2nszhA+a7YtqjZEdiRejhd14GhdUsf5L7xeLTiOoWwMT KSBTal+45RdB8X9+wPLC0rGe7OpoZ4BC5jbbFGjDoohNrn69w9IE87C 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 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?1768522543754644258?= X-GMAIL-MSGID: =?utf-8?q?1768522543754644258?= 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") Signed-off-by: Konrad Dybcio Reviewed-by: Stephan Gerhold --- 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 54a9999fe55d..8e4eb0b90905 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -205,34 +205,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; + } } } @@ -337,7 +342,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; @@ -351,14 +355,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 Mon Jun 12 18:24: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: 106762 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp65538vqr; Mon, 12 Jun 2023 11:46:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ76pF4so+m/O66mihi+VVYMP280sxrME8YPdzyemvQxHxGKTwdZb0WIy8lfnLVTR//P2oq/ X-Received: by 2002:a17:902:c943:b0:1b2:499f:674f with SMTP id i3-20020a170902c94300b001b2499f674fmr8131090pla.25.1686595582737; Mon, 12 Jun 2023 11:46:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686595582; cv=none; d=google.com; s=arc-20160816; b=isaY2VGMv4t9O9VoYlekqGdvhtfPQvsNgGHyQ5iGiQU1rO2PRrCoX8wApq2rEeewhu 3I3aahxBn2sepm/zbAhRUEIXg4OevpDGzDgsHcmFoX3IhoFDqnmzUON6T7nMyUcqy/dc kNFH7alUbkZVL8t0jLxgYEKcZkkI20lU3aVRS/Jz/I+Qc/+fwJ5W1ePUFUzPKecnRM3j tfCrNr7XwqIMNQw2IPsniBHwgN8HVBdKDTBV+hSsuQrAk4sleMZFKbFAAQFl8sdIB1ew A+51GsHIIEjsUz8IlUJAR2P6xicIbj4LMJ1VXQhmEdBA/U5iHyVoMrKeTQs7als2RKL1 n1Wg== 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=UIodkBRlayT0V/9pD2j/FIbmEOwVzB4ZwEjxODurwXg=; b=lWVdT4OAutypSsf7Otx8PKDxYPQhfM5ZeD5YygHj4iauKdFp5niWBKDGhDLlH5cWV/ k6X/qe7f6bGVo/mZlkQxg9KEYt9XgPctL4h9ETib/zoeA43TnuAevmZ4o4kBO/H+I1GJ y1iEoi1HJAHdWpT89tXkmAz/y7YDEXWS8VD0CCJ2Wpz4IoewbKroTRn8qFiVd3ec4FdV CTctWx9PqSUC/XByrQoZkaR56FaYGdF617EZYpHaqyS/wahJVpmloT5UCuAgXYySmEkw AtChe5fSMxqMp1bdK+4F1NqTCzE3C+6eFUL9++cSNCEO3YaPnAaIdr5wCCH+LnOyH3AI J2MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="TvL/4HpK"; 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 le8-20020a170902fb0800b001b24857d1c4si3839059plb.508.2023.06.12.11.46.00; Mon, 12 Jun 2023 11:46:22 -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="TvL/4HpK"; 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 S237801AbjFLSZe (ORCPT + 99 others); Mon, 12 Jun 2023 14:25:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238094AbjFLSZM (ORCPT ); Mon, 12 Jun 2023 14:25:12 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 098F8E69 for ; Mon, 12 Jun 2023 11:25:10 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f63a2e1c5fso5589626e87.2 for ; Mon, 12 Jun 2023 11:25:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594308; x=1689186308; 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=UIodkBRlayT0V/9pD2j/FIbmEOwVzB4ZwEjxODurwXg=; b=TvL/4HpKtWb+k6gMVu3rM/mxPnEc/LH21sIRnm6hq4G1BnkASKfttpKtNiNd3icsAS rgCnMsA+7Ovknx8I6gjBSwMijDDVDMTtHX/uErv7FvP255E1acNRJPjP0ntoUy2fySNE Pj+VgHbkD155XRUUzKo9eMaXLo2InLXH52TR/CsuXxn0E25rqU9mImrojU6ie3miDwNm EUv/s9WjEIRxrgErEeL6tmAiZET273qvn6+zzayO+KMMrn5TKI/H3LLogobR2p9c9iUK zSLvHJYROp6xRG13qkVHAYh6hVbu2qQpcFovt5WcXnxP9+iWFw9TyezFU7EbUV3DlluU j0ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594308; x=1689186308; 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=UIodkBRlayT0V/9pD2j/FIbmEOwVzB4ZwEjxODurwXg=; b=Yyi4aayzYuW9WbVj2qTSp2Xg6TTo8PSFcZAFbruTlh950t1zPky212ysXPq65fJqMY /20sbgFE1TEHHeM4quRj2ogtmH3DNXRR4d0SXvY3t9TmF0IPmfWCbPx+j7MsCWNeRuyx OPANvF0xP4RW3uXqf75OPXHzDoaTwWRFBEphjDq1flW0dDFYn0hH57KwHD0giLw2klhM vVda1mfMssqmmza7BxgLEvcA9dSttwYRohp+xEDsU34N8NHsjp9QdLefXbV/oW5dtQ3s pjeA2dHMzI9mf1itvx4SWM6rjEpTT9QZltI/qJbwcv6xBDTLrY4sTsfRXKiLI5i1Kofa KblA== X-Gm-Message-State: AC+VfDy4fPxGHDLkySOhXmOw48LM/6syWvBMq6xgL5vewmtT3RtZtLpt SjSx/E5BDdF8tbvOeZ1DsTguKg== X-Received: by 2002:a05:6512:46a:b0:4f4:cd03:cec8 with SMTP id x10-20020a056512046a00b004f4cd03cec8mr5499858lfd.51.1686594308282; Mon, 12 Jun 2023 11:25:08 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:25:07 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:39 +0200 Subject: [PATCH v3 22/23] interconnect: qcom: icc-rpm: Set correct bandwidth through RPM bw req MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-22-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=1241; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=9Ldf/1D6mnr+DmG72PIWvhQfT7N7aniAjBwqWygdML0=; b=0neN5UyCnSYJ6t+VeLO5GgXbU3AUqIZD2454T+xAoOEeEiGAVAdpNgAN0RwtWuRNKN9szCHIX 9lbs9imkG0tCHqVb43vFt1CdPrB8oSoriJlVZs0xB6n1AYksNjN2kjY 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 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?1768523649733286026?= X-GMAIL-MSGID: =?utf-8?q?1768523649733286026?= 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 8e4eb0b90905..989b8a1de6d1 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -355,12 +355,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 Mon Jun 12 18:24: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: 106753 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp57670vqr; Mon, 12 Jun 2023 11:29:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ53cTVOMhO2A8Xs83IAcQ3yLYhmFZQbctA6bHuRNJt7MbiWZY5D6exp4uEuda/3saw2m4SE X-Received: by 2002:a05:6a00:24cb:b0:658:6252:fe57 with SMTP id d11-20020a056a0024cb00b006586252fe57mr12563602pfv.24.1686594581624; Mon, 12 Jun 2023 11:29:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686594581; cv=none; d=google.com; s=arc-20160816; b=O3DEOxSK3nCjU2kfZrKbk/QkDT6tw//+NkYlXpVCyX2IWAk6wJBc9nLJ0nQZ0YfVMi d8Ib04vxP+aHn1e3eQnwbrdBT0EWBzE8hOGTVd9gf6cAGLFW6MJYJodF9vFWGK9Mn6Fs 4OtaXc5VhACNJOVusYzzmPjXG+6FbN+bgu8nnwHriSvAVwnafLSs/0aXxaaFC3VckvbH GxhuLgSEZFaX5ih1mCpu5r2Ym+I2VVAMxEfm2PInT6B+VrZxnkm/KZKp1nmLRArxPut+ Mbg6I7w0AocCgOwzS5XLpk59zr4hWULMarb5xlw/81cXlqcLHqJB7Iqs8q6icE6fcpqY RdlA== 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=J8A2feXIHSUNgM2OdPdrS+dK03yMSk0uFsk7ZEW2XJA=; b=NSmKFT7UpEX32h6fJ5dOmn/Szx3A5EHcAA8Dv5uOO4HBwVomurIYR3Hz+oWRUGbeQ4 H0aX4e63i3Nbo9SZ3ha5DzZeqogp7ZpF+hJooYBNJV8yHK7XzunKpw2RyrqM8rc/ZfZY 8bIv6od58LWQOF/WzCCDKB/ciyjy0vI+iru9AsTiCX+MRdbhi1TKyiw6NDAmvXxBBxJ7 yE14r6LjBnlwRp2r40pMDxGkmZJhH7vVPZsNqkSjFUpIlV0OQRjNuFNYCOfK4Cng/1Oe 9nnD7UgT3C1xuWplim/yfnaWKfUJMo8AeyXm077EzpKIrr5N3w74ECjImMr+shsVr2md tbSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xgjPbDI0; 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 y2-20020a63ad42000000b00548e140a1a4si5903029pgo.644.2023.06.12.11.29.28; Mon, 12 Jun 2023 11:29: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=xgjPbDI0; 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 S238432AbjFLS0U (ORCPT + 99 others); Mon, 12 Jun 2023 14:26:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238115AbjFLSZP (ORCPT ); Mon, 12 Jun 2023 14:25:15 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F743E7D for ; Mon, 12 Jun 2023 11:25:11 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4f649db9b25so5501721e87.0 for ; Mon, 12 Jun 2023 11:25:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686594309; x=1689186309; 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=J8A2feXIHSUNgM2OdPdrS+dK03yMSk0uFsk7ZEW2XJA=; b=xgjPbDI0zek0RiB9wGsuua67nKruU8TEqvWyZJqmOdbYw9zzFB4b3zWRdoOC0E0gky p1zJAYzuS6l4Nzzh+slVmdEWKMA/AsT2GZDfRb/Zy8L9ZE3BHL7AhQvoJuq4KPBW3auF ivzVE/A+aj0y+2SbNzj/D8hlsxjc4SedmJbG2F6ke1lBNyHF14379LDZSEJSnwUqr6X1 q9qChmF2h52S1+8wHwxUbSt8LqBQFp0/eGjfnXpYzpbn2iaDXlMkps9T5py39AMfuUui pmKvIUEELfz0j76/M237eJP4k5fhOssSFAaWR0FPwbPRj7f8UJ9jlJ8jhBW4vHtHqvj3 wKAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594309; x=1689186309; 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=J8A2feXIHSUNgM2OdPdrS+dK03yMSk0uFsk7ZEW2XJA=; b=Vfnb13ASPrgZ2XH/bou82qZZ/yYNYDkAZihgNwGxCPrOBPW/hLzyJRhIlE2NWtXfI1 8KXtf0/uxtzqYtRbOtXncHf6RxMd9B4+rIpf2VgbQ5T5iQiQUeLnzK3JVD8joApGghG4 OSVINtCEcQJ0tKDqOQVJl51shsv6rYYW3Qn3uWTV2tMcZUxUYPz8AHZeCp66LdIiWacz TEA0JwGsPACfD8tkOWEM9dP+iIZNU4zglraMe7Hd3RUhZ9BoQ83SNxbF9TzcV5IYMF2u m+I80oXbiwweBf70LLcHYwSKGfBhJzHpi+bn0EbKx5s/A7K5ojFeSH3T6SBCMZFk1GhH oLRg== X-Gm-Message-State: AC+VfDwFH32j74ITaHaJEoOVtjqIseU6wYJ3+wz3ZU8WqArwMkqCsXYO ngnXeDoplUuzi0TFhM6rpn8eRA== X-Received: by 2002:a19:6457:0:b0:4f2:5aae:937 with SMTP id b23-20020a196457000000b004f25aae0937mr4894276lfj.64.1686594309654; Mon, 12 Jun 2023 11:25:09 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id v24-20020ac25938000000b004f64073a252sm1502035lfi.96.2023.06.12.11.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:25:09 -0700 (PDT) From: Konrad Dybcio Date: Mon, 12 Jun 2023 20:24:40 +0200 Subject: [PATCH v3 23/23] interconnect: qcom: icc-rpm: Fix bandwidth calculations MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v3-23-5fb7d39b874f@linaro.org> References: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v3-0-5fb7d39b874f@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=1686594276; l=5027; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=bw+SFS+O9HQZI4rnBHu+stZnUYo1ywhpLaOcDFsBA14=; b=vd6hNzeuk27trlkCb+5Zbx2JzgxWx9e19Sk7Q1FiAEOHJQd622z9+NLnUuAbCdEK3zFHgyTy8 R+lZZLkb9W2B3N4LYapTdVMZcaVuAuuTGBW+MmDqqP7tEuAI0hpsZwU 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 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?1768522600306329380?= X-GMAIL-MSGID: =?utf-8?q?1768522600306329380?= 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 989b8a1de6d1..3441c43ae913 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -293,58 +293,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; @@ -353,7 +339,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) @@ -369,15 +357,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.