From patchwork Fri Apr 7 20:14:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 81023 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp514238vqo; Fri, 7 Apr 2023 13:32:58 -0700 (PDT) X-Google-Smtp-Source: AKy350YDs3eFiE09BsRukMNXRZyzEB2icgV6BdtHL126CTbWY++9saxroWkDLXOa8Luh1aQeZRL4 X-Received: by 2002:a05:6402:68c:b0:4fb:6523:2b38 with SMTP id f12-20020a056402068c00b004fb65232b38mr3394607edy.27.1680899578656; Fri, 07 Apr 2023 13:32:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680899578; cv=none; d=google.com; s=arc-20160816; b=edmqR9LzwQTkpC+H3NIb7pA5MBDBjmxl6mmEx5JfoixrhphUqaK2cC0smUqnQ5NL+v s/FLZPKwMLJ8suUvEACDojJ7jLgj7dd/345f9snojoEuFis4P4vKbIas+rrM9KguHLV2 bRAtCysGL4+Ec7u9jHTcte2eCGL3rLptE5EEHqUA2V1myH1PtM6Bpi6ruGo/Xb2mkoQ6 Wj1p+9Z51Kszo0rqQ1W0yBchjFsCNDADZ+hlk5GYwioRWAhX3exRJWeySfQs5YXWpQfL 5eIOrDFFPR53lkKfQwfBxKnylFK2vJPioJ0b858+pAjc/RbcMQ6iG5RNB0l2VLap8FSM dywQ== 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=v9z0aVMBBsZdRPEvNfuPfiehLWAE2y+k1IJImXazA+8=; b=mC1MpnYDb1zjI75k/mi859v82qrZOOGusQ1aMgwsdEobk4GcLJwN4qLSjGNWCk6r6q /kCYkMhaZe3pWGBWbc+QZoGe2BNuiL4DjgbvDiINADHhjlxsevWptc58zIN2eOUdrXsb eFzow0tbtOa0sJZauvLSuGZJ/+5Em8+yg1JDL3n5eqeZ5p0QJICDWaehhRIH27ce1TCB 8in6JezDUOoTn6npaM0g2XLZpTW4SlZvK2h6Cp1/8YbEK/N5DT7wSbKaqcr7ohk35Tx0 Z6tirRVHNdA1LOwvJx5FlnSqlOKeYiPfK2fiHOTJmjbVAVcQ5OazBxsSZrjKK5A2yfd4 22tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ykIoOEnZ; 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 n16-20020aa7c690000000b004fb3426ea95si3914463edq.322.2023.04.07.13.32.33; Fri, 07 Apr 2023 13:32: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=ykIoOEnZ; 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 S229928AbjDGUOz (ORCPT + 99 others); Fri, 7 Apr 2023 16:14:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229721AbjDGUOu (ORCPT ); Fri, 7 Apr 2023 16:14:50 -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 6AB45BBA1 for ; Fri, 7 Apr 2023 13:14:48 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id y20so55741453lfj.2 for ; Fri, 07 Apr 2023 13:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680898486; 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=v9z0aVMBBsZdRPEvNfuPfiehLWAE2y+k1IJImXazA+8=; b=ykIoOEnZZFRW29GcpUJJgS6XJcD/9wEvX7Ziuq4ikJe36Iei/vhcLU1eGaJfjpfMj/ 22YDJJa+vZyiyTlA3XDKnCZV5jXNp/uQDFS2FDKWMlO3iqXWYGYj1mCFvNXmu4XneTJo NUjPjAsFgVzVPgPIU8WjwwIMKOl0yemsHmKfnyGJiLeySX/yQwI2tN2mBB4H8/dqhNXN OuUulpi++Q5nSEaIppjg2DWPE+R2l3D8eWOcSS8kywRtC99E7Y8hGN8UvTchxCI6JsFT 5n+yYodlA6kBCwvCiZg4npLMNibabufYDWVgZGjWwDOg+ZyAYO5jxtdWvsqavtMHhnaH hUdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680898486; 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=v9z0aVMBBsZdRPEvNfuPfiehLWAE2y+k1IJImXazA+8=; b=VMzYNKphKXuG5w7pSMZeNjSW8X1CLMFFSGfMcazQRBscMl6OEDtMUdnvvh9LaH/pOc jPxWhzy2seEBd4cAGYCRkuG5XPPA6PvTxXNGAr8aGLiG+CpCbNVTmmgD32wEh3jn1CAw DIeAMBo+jAfLLlJuT608mU2VkUxeajutu1Ljvemd4FNeA2Ed8qsazxtATGUCLpMiYcVi LwsurgqjrRN1JEOV940oSiu8i2Od/JhErjSH17k4HwqOjqNypAYhREe6afGdS8mQSGQB 1dCg4jQe5cD4fxr2q/kPLLLNegvMekl0eo2X1ld6kgd0k0m5hgeXxrAU6x13jHKmwFel nZAA== X-Gm-Message-State: AAQBX9d+9LwOebx4ycL4TQ8QqA5fqu4OdFGR83vK+uPLzf7vX2Zj2LK4 8b9+qtTjniVaxk+vQFYPILQYPQ== X-Received: by 2002:a19:5503:0:b0:4d5:ae35:b221 with SMTP id n3-20020a195503000000b004d5ae35b221mr815021lfe.34.1680898486754; Fri, 07 Apr 2023 13:14:46 -0700 (PDT) Received: from [192.168.1.101] (abxh37.neoplus.adsl.tpnet.pl. [83.9.1.37]) by smtp.gmail.com with ESMTPSA id u3-20020ac243c3000000b004eaf6181a32sm842436lfl.75.2023.04.07.13.14.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 13:14:46 -0700 (PDT) From: Konrad Dybcio Date: Fri, 07 Apr 2023 22:14:43 +0200 Subject: [PATCH v8 1/8] interconnect: qcom: rpm: Rename icc desc clocks to bus_blocks MIME-Version: 1.0 Message-Id: <20230228-topic-qos-v8-1-ee696a2c15a9@linaro.org> References: <20230228-topic-qos-v8-0-ee696a2c15a9@linaro.org> In-Reply-To: <20230228-topic-qos-v8-0-ee696a2c15a9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Dmitry Baryshkov Cc: Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Marijn Suijten X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1680898484; l=4017; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=mQ36FvJbMCQvBQ0eF8VcxwSFpsUfeIXlhNbu3V6MP2M=; b=gN5Gn8/ZVeVJSPAfPBNSp1QLDyDW9tKyaitI3yL8CAaK7CwYoW1xu5gzNq874cKVoEPdh7quGHkw YrqHPplnDPFgb/XxGZAcsGtZqehqtEppQX6x8xRo9axDyEUq2Jsv X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762550956699911965?= X-GMAIL-MSGID: =?utf-8?q?1762550956699911965?= Rename the "clocks" (and _names) fields of qcom_icc_desc to "bus_clocks" in preparation for introducing handling of clocks that need to be enabled but not voted on with aggregate frequency. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 6 +++--- drivers/interconnect/qcom/icc-rpm.h | 4 ++-- drivers/interconnect/qcom/msm8996.c | 12 ++++++------ drivers/interconnect/qcom/sdm660.c | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 5341fa169dbf..ee3d09a6850e 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -440,9 +440,9 @@ int qnoc_probe(struct platform_device *pdev) qnodes = desc->nodes; num_nodes = desc->num_nodes; - if (desc->num_clocks) { - cds = desc->clocks; - cd_num = desc->num_clocks; + if (desc->num_bus_clocks) { + cds = desc->bus_clocks; + cd_num = desc->num_bus_clocks; } else { cds = bus_clocks; cd_num = ARRAY_SIZE(bus_clocks); diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index 22bdb1e4bb12..689300a2fd4e 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -91,8 +91,8 @@ struct qcom_icc_node { struct qcom_icc_desc { struct qcom_icc_node * const *nodes; size_t num_nodes; - const char * const *clocks; - size_t num_clocks; + const char * const *bus_clocks; + size_t num_bus_clocks; enum qcom_icc_type type; const struct regmap_config *regmap_cfg; unsigned int qos_offset; diff --git a/drivers/interconnect/qcom/msm8996.c b/drivers/interconnect/qcom/msm8996.c index 14efd2761b7a..21f998cd19f0 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -1821,8 +1821,8 @@ static const struct qcom_icc_desc msm8996_a0noc = { .type = QCOM_ICC_NOC, .nodes = a0noc_nodes, .num_nodes = ARRAY_SIZE(a0noc_nodes), - .clocks = bus_a0noc_clocks, - .num_clocks = ARRAY_SIZE(bus_a0noc_clocks), + .bus_clocks = bus_a0noc_clocks, + .num_bus_clocks = ARRAY_SIZE(bus_a0noc_clocks), .regmap_cfg = &msm8996_a0noc_regmap_config }; @@ -1865,8 +1865,8 @@ static const struct qcom_icc_desc msm8996_a2noc = { .type = QCOM_ICC_NOC, .nodes = a2noc_nodes, .num_nodes = ARRAY_SIZE(a2noc_nodes), - .clocks = bus_a2noc_clocks, - .num_clocks = ARRAY_SIZE(bus_a2noc_clocks), + .bus_clocks = bus_a2noc_clocks, + .num_bus_clocks = ARRAY_SIZE(bus_a2noc_clocks), .regmap_cfg = &msm8996_a2noc_regmap_config }; @@ -2004,8 +2004,8 @@ static const struct qcom_icc_desc msm8996_mnoc = { .type = QCOM_ICC_NOC, .nodes = mnoc_nodes, .num_nodes = ARRAY_SIZE(mnoc_nodes), - .clocks = bus_mm_clocks, - .num_clocks = ARRAY_SIZE(bus_mm_clocks), + .bus_clocks = bus_mm_clocks, + .num_bus_clocks = ARRAY_SIZE(bus_mm_clocks), .regmap_cfg = &msm8996_mnoc_regmap_config }; diff --git a/drivers/interconnect/qcom/sdm660.c b/drivers/interconnect/qcom/sdm660.c index 8d879b0bcabc..a22ba821efbf 100644 --- a/drivers/interconnect/qcom/sdm660.c +++ b/drivers/interconnect/qcom/sdm660.c @@ -1516,8 +1516,8 @@ static const struct qcom_icc_desc sdm660_a2noc = { .type = QCOM_ICC_NOC, .nodes = sdm660_a2noc_nodes, .num_nodes = ARRAY_SIZE(sdm660_a2noc_nodes), - .clocks = bus_a2noc_clocks, - .num_clocks = ARRAY_SIZE(bus_a2noc_clocks), + .bus_clocks = bus_a2noc_clocks, + .num_bus_clocks = ARRAY_SIZE(bus_a2noc_clocks), .regmap_cfg = &sdm660_a2noc_regmap_config, }; @@ -1659,8 +1659,8 @@ static const struct qcom_icc_desc sdm660_mnoc = { .type = QCOM_ICC_NOC, .nodes = sdm660_mnoc_nodes, .num_nodes = ARRAY_SIZE(sdm660_mnoc_nodes), - .clocks = bus_mm_clocks, - .num_clocks = ARRAY_SIZE(bus_mm_clocks), + .bus_clocks = bus_mm_clocks, + .num_bus_clocks = ARRAY_SIZE(bus_mm_clocks), .regmap_cfg = &sdm660_mnoc_regmap_config, }; From patchwork Fri Apr 7 20:14:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 81022 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp514082vqo; Fri, 7 Apr 2023 13:32:33 -0700 (PDT) X-Google-Smtp-Source: AKy350amcJ+F841f59KxBhM0F5A0KCVn9eEeRlupnyaXMl3D3EJaxDMQgJr/dWs0xQi4R1GySKYM X-Received: by 2002:a50:ef18:0:b0:504:6646:79c4 with SMTP id m24-20020a50ef18000000b00504664679c4mr3773827eds.36.1680899553770; Fri, 07 Apr 2023 13:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680899553; cv=none; d=google.com; s=arc-20160816; b=kYs9WYJ3oCu7S7fREqqGdmFxypiDudiV0HHBFXU9K4j0RXhiugi/3lgVFR9npTnI9A BwDZyWDhE06ee3trp62QsrNfiQDwU8J+neRItNDu/VdFlUFOP9AaWb6d8T9SldKq1H+b fGtzci9FBM0ltfYbgeaEBip8jVOZ/VtoNBRt91dqXJsx7tsJwiAczWKvTGR4Rzlhq/ts iVjy0FQmVoJFv+/Jw0Fnmd4O+tLvtPXoklJP8mE2HQMzhETeJkUfkxrZmUabyh1PcaM+ GIQ8Dz1exHAweQhs0ZJ1NteU5brT84mhWIX+nGdKFDt7LemosglN3m5TKM5I75rS8+r1 7RdA== 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=3aCo6YWSWC7QDyDOgnSdKQprMmsQavo7dczvCShoPH0=; b=jbjK53CenbnDPbYxYMj7TGJLXIJEUL1trFzLXl6kOGztXebI3KyW/MDHgzONPY9ARC AcCUtav2JlKi+gNaZ9tUyksP/rbRzGyg69eC4MiKGGFp/PiyaNHIB/c3EwtwJdX2U5GD 7hwqkAOwR1osgcd7BshzFKipv3qL0JLcYJGKGhRuOpbibVvl9GKceNCfON0IvI7ZAztT IjUd8bjliGwX7Um2ejHDOT37mNy6S5mXOx15Vcg9k38avvXbJlLPU/H95C2nkF3vDjhG Llsa46xlxZG2+qlWqyp37nEnxZTsx9Zbp/rJn9JYEZtCPxfVoc00HQbFKUwEDDUINWuA E0Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B1QnkTPG; 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 c5-20020aa7d605000000b004bd0d14881dsi3619603edr.90.2023.04.07.13.32.08; Fri, 07 Apr 2023 13:32:33 -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=B1QnkTPG; 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 S229536AbjDGUO7 (ORCPT + 99 others); Fri, 7 Apr 2023 16:14:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229846AbjDGUOv (ORCPT ); Fri, 7 Apr 2023 16:14:51 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D37D2BDDF for ; Fri, 7 Apr 2023 13:14:49 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id y15so55687335lfa.7 for ; Fri, 07 Apr 2023 13:14:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680898488; 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=3aCo6YWSWC7QDyDOgnSdKQprMmsQavo7dczvCShoPH0=; b=B1QnkTPGvvIyEvodHBYuu9LL3xe40OdQRgBTwdVVM1iEc5BoNzebvBFN3e2/oxXg5q cA0iMRDsD1CxGngS9MN+hNqQKl8MaTf1mdrHW6psnJAouLqolZkiAyu4k2KoSho3IQJP hX9Dp8H59wOyJnYL8bqqwax6hNPdzX5c0BlI0tBMq++2uSH+0BxK4URNrX1syN6BCEau DOYnHfK8OIaI0GoOQ+lQafgi55K+Vt1JuNpZqqtyV4WDFbYrrLKFY9bZ1b3I6eJ8b7cI BlebXXH8a9E/5it8zIbvnGBfb/WugaP2oEjhA06OEzrSZnIsSK/dup66VuNl5O6C67Ea CmGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680898488; 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=3aCo6YWSWC7QDyDOgnSdKQprMmsQavo7dczvCShoPH0=; b=y3+gemRYiPZxmQ1ztJICLxPmLP84SiB+6fqDax1NWwKqNgQVyj7Zf3TIJdoFu7YUaE 9Z8pIJfwzbeJmxbbj7f5GOqIBtc/NEy9cPMdpvoD6A92zaL95xJb8jLKKIPS0CqaFfTo yWk3kW/9N91kb5ZhfgqSgYpBEx6nc+BGzZONpIuoRwKqxqorg0vesh6/qBCdu3s8YaiM mKpsYWN6NNiYMAWFcayJQltCcqGZcFBUmg1p+oWYxChCFDVFaCOGac3wFI4gtVYI4kPE vdcxHwpPtJq3YKiABWOC+Spglh+svhyaevf1T1ehLr0DO1sqZVw/5ckltOms/n9BG0a1 nInQ== X-Gm-Message-State: AAQBX9cqFYQoJL10aVA8DIMyc+zPapV2aCSE6JevdzxFjAc/e4x5pMkA vNQdTOHejA2BR65wKWlObzWQHA== X-Received: by 2002:a19:ac4c:0:b0:4db:3e1a:fc7 with SMTP id r12-20020a19ac4c000000b004db3e1a0fc7mr182lfc.31.1680898488054; Fri, 07 Apr 2023 13:14:48 -0700 (PDT) Received: from [192.168.1.101] (abxh37.neoplus.adsl.tpnet.pl. [83.9.1.37]) by smtp.gmail.com with ESMTPSA id u3-20020ac243c3000000b004eaf6181a32sm842436lfl.75.2023.04.07.13.14.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 13:14:47 -0700 (PDT) From: Konrad Dybcio Date: Fri, 07 Apr 2023 22:14:44 +0200 Subject: [PATCH v8 2/8] interconnect: qcom: rpm: Rename icc provider num_clocks to num_bus_clocks MIME-Version: 1.0 Message-Id: <20230228-topic-qos-v8-2-ee696a2c15a9@linaro.org> References: <20230228-topic-qos-v8-0-ee696a2c15a9@linaro.org> In-Reply-To: <20230228-topic-qos-v8-0-ee696a2c15a9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Dmitry Baryshkov Cc: Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Marijn Suijten X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1680898484; l=3064; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=AL/5pHSAvV2vBdT049aGNYdnVcOJiOzItHlBogTY10o=; b=wcySxfPAttSxwn9WOps36nlx4KY+U5yuRwJOUN5PySwu0zk63hRzqg6cSXdop7Vb7O8irN7gk2oV ahgwNVKXA7+ESyhtSG/tyco/laQlr4+2aO6/nyR9yUJKzx5lancD X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762550930461227049?= X-GMAIL-MSGID: =?utf-8?q?1762550930461227049?= In preparation for handling non-scaling clocks that we still have to enable, rename num_clocks to more descriptive num_bus_clocks. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 12 ++++++------ drivers/interconnect/qcom/icc-rpm.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index ee3d09a6850e..8dce3dcff8da 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -379,7 +379,7 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) return ret; } - for (i = 0; i < qp->num_clks; i++) { + 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 @@ -464,7 +464,7 @@ int qnoc_probe(struct platform_device *pdev) for (i = 0; i < cd_num; i++) qp->bus_clks[i].id = cds[i]; - qp->num_clks = cd_num; + qp->num_bus_clks = cd_num; qp->type = desc->type; qp->qos_offset = desc->qos_offset; @@ -494,11 +494,11 @@ int qnoc_probe(struct platform_device *pdev) } regmap_done: - ret = devm_clk_bulk_get_optional(dev, qp->num_clks, qp->bus_clks); + ret = devm_clk_bulk_get_optional(dev, qp->num_bus_clks, qp->bus_clks); if (ret) return ret; - ret = clk_bulk_prepare_enable(qp->num_clks, qp->bus_clks); + ret = clk_bulk_prepare_enable(qp->num_bus_clks, qp->bus_clks); if (ret) return ret; @@ -551,7 +551,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_clks, qp->bus_clks); + clk_bulk_disable_unprepare(qp->num_bus_clks, qp->bus_clks); return ret; } @@ -563,7 +563,7 @@ int qnoc_remove(struct platform_device *pdev) icc_provider_deregister(&qp->provider); icc_nodes_remove(&qp->provider); - clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks); + clk_bulk_disable_unprepare(qp->num_bus_clks, qp->bus_clks); return 0; } diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index 689300a2fd4e..2436777820a4 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -23,7 +23,7 @@ enum qcom_icc_type { /** * struct qcom_icc_provider - Qualcomm specific interconnect provider * @provider: generic interconnect provider - * @num_clks: the total number of clk_bulk_data entries + * @num_bus_clks: the total number of bus_clks clk_bulk_data entries * @type: the ICC provider type * @regmap: regmap for QoS registers read/write access * @qos_offset: offset to QoS registers @@ -32,7 +32,7 @@ enum qcom_icc_type { */ struct qcom_icc_provider { struct icc_provider provider; - int num_clks; + int num_bus_clks; enum qcom_icc_type type; struct regmap *regmap; unsigned int qos_offset; From patchwork Fri Apr 7 20:14:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 81026 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp514284vqo; Fri, 7 Apr 2023 13:33:04 -0700 (PDT) X-Google-Smtp-Source: AKy350aJi59FJ73PrICicemL9X06lHu+0wjZ5qc8a0M2d10Kb1iMTF7xt6X6ZqZY0r980dnM9dTn X-Received: by 2002:a17:906:39cf:b0:933:be1:8f4f with SMTP id i15-20020a17090639cf00b009330be18f4fmr696683eje.9.1680899584638; Fri, 07 Apr 2023 13:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680899584; cv=none; d=google.com; s=arc-20160816; b=YC8ZN6yhDOO/W6V3zdAElrqikFigHFW8WUAfjRLcviR5190h41RS2E4JgvqJvpvMyX j6CGVomn/zGw926uB1ItuBnCP9df3OLUncSKFdWloTCRSVq6pgY3rOB27rVgAeiJ7FHU 78FgSx8JzIMLCO8YkJIeERm7rPupX3RJpVEsoyvCoPl3hdevUuMCtY+l38BdfC47urDL RroEboGXRssdVpw2SeRgdhiiMtMJT8z3F1L9h5quflsiKS1VwrzCMaYw6vxEDQsqfE5+ ATYp9nHiWG8AFQevojeC5OUKv7yoyLk1fkwgfLgF3dgs7CcpcGZJPtuU7HiCUO1Aw0o9 15kg== 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=H3nsx7fTooCsHlb+iQOPq8i6PDjNQ7J7ivbonnB4f0g=; b=XXG0/aHaomnMMrmCqzzpAIs5FLoendkeE76SI7NGrXm1TOB9g9mQYwRZVpDnXyYpNl mA/Rv3Ho8ecGbRc3vWvNRPTaAp8pV+i4DOnI7UowjlIXmCWoDBfhIryoeZcAqQBN8h9z JqDhtTQnW0B6p1OEWVpx7wTKCL+QBkzUUDlbkrnd0gl/WU9FsN2J7nZ9iqiLrxMCm9UB qzXPRxGj+XxEQA7WJHD3voKzvDFrzi+x+mWB2BU6+q35YWaX7QOhjy0hEahFMndxpV5/ PrCJlitTHGSeOyqsfDGdJKMhz7qc+jTgYUiJhSSlhJGHGjWXjPYojQd97KmOKQa8nAtH 9cew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z8vc6jpc; 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 t22-20020a170906949600b0094404d7e622si862002ejx.770.2023.04.07.13.32.40; Fri, 07 Apr 2023 13:33:04 -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=Z8vc6jpc; 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 S229758AbjDGUPC (ORCPT + 99 others); Fri, 7 Apr 2023 16:15:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229887AbjDGUOw (ORCPT ); Fri, 7 Apr 2023 16:14:52 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D459F1BC5 for ; Fri, 7 Apr 2023 13:14:50 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id q16so55678061lfe.10 for ; Fri, 07 Apr 2023 13:14:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680898489; 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=H3nsx7fTooCsHlb+iQOPq8i6PDjNQ7J7ivbonnB4f0g=; b=Z8vc6jpcWix01rDMGNR5PCpgd+r96K1dnJUCfKV7qM4GZtoljfuq7IBcdUCo8ooyTU m09IsKdPTF2AKqu3wDIoxrpIJ8iimjjuBgdfli5PSAJi4Tdz/NzUZ7PAlF7X4whGoxRO Sy5JfXLxQdxKeD/S3e7nmrHx6iId8R8ukvPQLr6wNPkms9xuBl8ZMViBwX1TLxVjuI4V GALzUti2PrVQRe0isUUqcBJHR7D6pSxQvB9wVtwHSrRLXGb5ga2HrKejmx/ZCkix8ww/ mMWnEHkPy6gLSUeb74HQOjDfgBZVmINA/OB7JUDSapX6vYWtGqZYoiq30nUyIvIMAej7 PGUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680898489; 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=H3nsx7fTooCsHlb+iQOPq8i6PDjNQ7J7ivbonnB4f0g=; b=DiAHFZVzLLaW7SiXTdjdhsG86LazPn44fDee5aySnIbBcLeizJArITrB7oZy2lQ6xn DqvjtJQxuzRCu3lvbZMa2xqZzeEIXjwiJZjadzoZ0xzzYy3yl4f7OQFq2YDlvaadMYF/ PBOML3g/kTswhAc2LBB7CjgwyQqZzDYS46oMlh84iThJ/9Ds0kVeKOqVh8okvGVVvKrT KAmWSj1V/D8TzNusKsLl3EoUz2AyvLtbgKY2G+C5bB4LrP2OPrUHEnGxoed/b10OMHPQ iUbqyKEdjV5RBvQIaMWUMcir+bKxWztarNmAs1KTDAWzeGzcLenBZqitsZaEjvY32C94 4S/A== X-Gm-Message-State: AAQBX9f8BIGovHx+bT1/qcfMeYxv31FgwzbVD2sRWZ+1ZWQyKbzCCis4 Ys3Dg2Q+6afZXg8/VOmqlbh0aA== X-Received: by 2002:ac2:447b:0:b0:4db:4fe8:fd0f with SMTP id y27-20020ac2447b000000b004db4fe8fd0fmr909089lfl.25.1680898489225; Fri, 07 Apr 2023 13:14:49 -0700 (PDT) Received: from [192.168.1.101] (abxh37.neoplus.adsl.tpnet.pl. [83.9.1.37]) by smtp.gmail.com with ESMTPSA id u3-20020ac243c3000000b004eaf6181a32sm842436lfl.75.2023.04.07.13.14.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 13:14:48 -0700 (PDT) From: Konrad Dybcio Date: Fri, 07 Apr 2023 22:14:45 +0200 Subject: [PATCH v8 3/8] interconnect: qcom: rpm: Drop unused parameters MIME-Version: 1.0 Message-Id: <20230228-topic-qos-v8-3-ee696a2c15a9@linaro.org> References: <20230228-topic-qos-v8-0-ee696a2c15a9@linaro.org> In-Reply-To: <20230228-topic-qos-v8-0-ee696a2c15a9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Dmitry Baryshkov Cc: Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Marijn Suijten X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1680898484; l=2285; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=yBC75Q6TJYtH1vX8QL0awOafuPHjdn2hOETxfU8AhgI=; b=/scUAZfnDk4668871iclpkfz/2TI7qD1M2Yecgm/4Pk9iR0T4KISIAjnhu3EULS0UwQUZguCML7F 1VbPKaQFBp3iVjwy0cty4n9Ihl/9mgDe+MLW6lysH+x5AHLXOnm7 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762550962965178117?= X-GMAIL-MSGID: =?utf-8?q?1762550962965178117?= The QoS-setting functions do not care about the bandwidth values passed. Drop them. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 8dce3dcff8da..7d62c0bf2722 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -50,7 +50,7 @@ #define NOC_QOS_MODE_FIXED_VAL 0x0 #define NOC_QOS_MODE_BYPASS_VAL 0x2 -static int qcom_icc_set_qnoc_qos(struct icc_node *src, u64 max_bw) +static int qcom_icc_set_qnoc_qos(struct icc_node *src) { struct icc_provider *provider = src->provider; struct qcom_icc_provider *qp = to_qcom_provider(provider); @@ -95,7 +95,7 @@ static int qcom_icc_bimc_set_qos_health(struct qcom_icc_provider *qp, mask, val); } -static int qcom_icc_set_bimc_qos(struct icc_node *src, u64 max_bw) +static int qcom_icc_set_bimc_qos(struct icc_node *src) { struct qcom_icc_provider *qp; struct qcom_icc_node *qn; @@ -150,7 +150,7 @@ static int qcom_icc_noc_set_qos_priority(struct qcom_icc_provider *qp, NOC_QOS_PRIORITY_P0_MASK, qos->prio_level); } -static int qcom_icc_set_noc_qos(struct icc_node *src, u64 max_bw) +static int qcom_icc_set_noc_qos(struct icc_node *src) { struct qcom_icc_provider *qp; struct qcom_icc_node *qn; @@ -187,7 +187,7 @@ static int qcom_icc_set_noc_qos(struct icc_node *src, u64 max_bw) NOC_QOS_MODEn_MASK, mode); } -static int qcom_icc_qos_set(struct icc_node *node, u64 sum_bw) +static int qcom_icc_qos_set(struct icc_node *node) { struct qcom_icc_provider *qp = to_qcom_provider(node->provider); struct qcom_icc_node *qn = node->data; @@ -196,11 +196,11 @@ static int qcom_icc_qos_set(struct icc_node *node, u64 sum_bw) switch (qp->type) { case QCOM_ICC_BIMC: - return qcom_icc_set_bimc_qos(node, sum_bw); + return qcom_icc_set_bimc_qos(node); case QCOM_ICC_QNOC: - return qcom_icc_set_qnoc_qos(node, sum_bw); + return qcom_icc_set_qnoc_qos(node); default: - return qcom_icc_set_noc_qos(node, sum_bw); + return qcom_icc_set_noc_qos(node); } } From patchwork Fri Apr 7 20:14:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 81016 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp507880vqo; Fri, 7 Apr 2023 13:16:37 -0700 (PDT) X-Google-Smtp-Source: AKy350bTqUDuTd173k9LXAJxLjthnOFVn204egVvhZM+Jf54vqaGu+GQLjf/oQ3QfF9fq9wsBM34 X-Received: by 2002:a17:907:8a85:b0:8e1:12b6:a8fc with SMTP id sf5-20020a1709078a8500b008e112b6a8fcmr606595ejc.4.1680898596706; Fri, 07 Apr 2023 13:16:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680898596; cv=none; d=google.com; s=arc-20160816; b=TOR+Rick5GeSDJLn7a0mvTZwuxQyti/I6TVNxyrh3VHRb29He6KecopW+pWIAqo3DH NwUMLHN9dbhq5MTXGukY3kGb9DW9nPK9tzt5BW3Spy7FHDsN8ScqXN1s+YQ0+K1EvTpb 0t/HbYJ28p2LgXQhqVPPpJZ7RrO8O3u9/g4uOq6SifeS0ayJQou0tBU0qEVZL9ciNXVV egNE65OVRLOSnKD9K/iIP5AzR0rtV1XHFQxEm1xi4Jip9oybHll8R1K7Hi7GpAs+fjy4 4b3OK7FrC9VVkGxQms9t9SFRsjw2G3eDcesI8lgM9jU0LRYMLLZ6iW/0PpWjSKhsK8ef MBYg== 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=SQRr7zYgAeFKXDVLGLXAENjwQ4hSXd3swVXxXJxBC68=; b=qJFlGzGrQFOADCLXOuNeEf7+m5CO8ww44CQqQNtVWSmUVld/xUQoQuhHceopk3Xl3p O2cR5MPZD/VWBLzCncL05I400JOM7mGtPxsW/P0qWQvmWnTAah7cOCqTxGjNi2SGCe8P Z7rI02uhwuFjT+FjSOjKdEnEO5NAICBrXZMNiI4p067zkJtjrah+avddBi0ss81D0NH2 04GSPDpQmzmXhiqyJhx839ObT2RtrKILlp/cmwUV05fk+tp4TsrOba7zPd1WwRQXtZFp cMxWe76i1oEZgfMGzv77JBFHZkfGB00PLwL5I74NiZtoWANtF37gIMSGmcnNK4gdIh2G QpKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KaOAS9kK; 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 p21-20020a170906b21500b00947d54e4c1fsi2587557ejz.88.2023.04.07.13.16.12; Fri, 07 Apr 2023 13:16: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=KaOAS9kK; 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 S230015AbjDGUPG (ORCPT + 99 others); Fri, 7 Apr 2023 16:15:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229737AbjDGUOx (ORCPT ); Fri, 7 Apr 2023 16:14:53 -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 4A107BBA1 for ; Fri, 7 Apr 2023 13:14:52 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id q16so55678128lfe.10 for ; Fri, 07 Apr 2023 13:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680898490; 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=SQRr7zYgAeFKXDVLGLXAENjwQ4hSXd3swVXxXJxBC68=; b=KaOAS9kKCQiM8FtlqY9qHaT7Gc5Dzk3LtG19NMEVjJCnPeW2hiQjaKlEoKd7ILim/z 1iStbcDmcF7jdB2uuMzQFBJHiWLc3y1tjErHYm22moLq019b1vy27B31rYCESGNIfdOP nysoEplT9B8KoAlF4gFS4QQs3xZy43HKSlsuVKUWhAbR5YMnb5ikSIz9/6HOqGCIDMc4 ZAwS6pNNdxmaf6IEmxxJ+A0zdDK52OfNV0g5WXeUf/hNNJOohQDXWbYUIYPRNcqm1RM0 hIZG2Ehys8RVjSHsS80INrC27e40FdtFcvpUA1snKCLMVa75MX5S8YdNAvDO/pcv4sxb f32Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680898490; 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=SQRr7zYgAeFKXDVLGLXAENjwQ4hSXd3swVXxXJxBC68=; b=dOx6BypyYjwDMYDT2MqPykTRG7KEgL1ltXQyZsVZfgeDfpQ8AFWLfwPre86MDLIZ8q 2wvqoO22Ap9fC4cu4vhQEcjsX1Jf6d3dvrKqAnaX5bBmsd6B9FYAeVlykSoRlctNu4R1 nFMOSbwlBadXYQSMfwk6y/P6EDxG27HwZDFHab80VVTwZsxBQ3eXdH9qzvumMWdM7Uxd qTsoHyaaf6skjnWqdVjlNJhjFoXzOgXIcSnIXCT1lT5QyJ7/3OzI/2SUCqaI4AaU6+na HelVp1QtUL+w4t4XbuTwtLM75xM2OCkkr1Un0xNCQa5FjON9zTFKBJ7VCWsVLQLstsVs D+Ig== X-Gm-Message-State: AAQBX9c8CRgP0JOuYTV474K22DTQIVxGEz9hoo87+1LsM+mi2BkoXmM0 KYd2Hx1gNRm3mUQTYnh5UROe0g== X-Received: by 2002:a19:f70f:0:b0:4eb:4fb2:7b6d with SMTP id z15-20020a19f70f000000b004eb4fb27b6dmr1144444lfe.2.1680898490604; Fri, 07 Apr 2023 13:14:50 -0700 (PDT) Received: from [192.168.1.101] (abxh37.neoplus.adsl.tpnet.pl. [83.9.1.37]) by smtp.gmail.com with ESMTPSA id u3-20020ac243c3000000b004eaf6181a32sm842436lfl.75.2023.04.07.13.14.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 13:14:50 -0700 (PDT) From: Konrad Dybcio Date: Fri, 07 Apr 2023 22:14:46 +0200 Subject: [PATCH v8 4/8] interconnect: qcom: rpm: Set QoS registers only once MIME-Version: 1.0 Message-Id: <20230228-topic-qos-v8-4-ee696a2c15a9@linaro.org> References: <20230228-topic-qos-v8-0-ee696a2c15a9@linaro.org> In-Reply-To: <20230228-topic-qos-v8-0-ee696a2c15a9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Dmitry Baryshkov Cc: Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Marijn Suijten X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1680898484; l=3314; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Fj8QPV8qCcpTJILNUkCb2YoMLaTcvnAVgncrQ7lWCjs=; b=AoVoA52TYCXmyQ7GwtfPUjP8q7pzXHkgKdOsIrcJcNMPogE1cbqb2bEyIyBd81AN9Q/V25NkVs7h VVjyr9qyCRkiYVemWPjMKarVPN7xagN3fmZT3SVek5BN7GLRe+6M X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762549926921093146?= X-GMAIL-MSGID: =?utf-8?q?1762549926921093146?= The QoS registers are (or according to Qualcomm folks, on most platforms) persistent until a full chip reboot. Move the QoS-setting functions to the probe function so that we don't needlessly do it over and over again. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 50 ++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 7d62c0bf2722..d79e508cb717 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -204,30 +204,33 @@ static int qcom_icc_qos_set(struct icc_node *node) } } -static int qcom_icc_rpm_set(int mas_rpm_id, int slv_rpm_id, u64 sum_bw) +static int qcom_icc_rpm_set(struct qcom_icc_node *qn, u64 sum_bw) { int ret = 0; - if (mas_rpm_id != -1) { + 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, - mas_rpm_id, + qn->mas_rpm_id, sum_bw); if (ret) { pr_err("qcom_icc_rpm_smd_send mas %d error %d\n", - mas_rpm_id, ret); + qn->mas_rpm_id, ret); return ret; } } - if (slv_rpm_id != -1) { + if (qn->slv_rpm_id != -1) { ret = qcom_icc_rpm_smd_send(QCOM_SMD_RPM_ACTIVE_STATE, RPM_BUS_SLAVE_REQ, - slv_rpm_id, + qn->slv_rpm_id, sum_bw); if (ret) { pr_err("qcom_icc_rpm_smd_send slv %d error %d\n", - slv_rpm_id, ret); + qn->slv_rpm_id, ret); return ret; } } @@ -235,26 +238,6 @@ static int qcom_icc_rpm_set(int mas_rpm_id, int slv_rpm_id, u64 sum_bw) return ret; } -static int __qcom_icc_set(struct icc_node *n, struct qcom_icc_node *qn, - u64 sum_bw) -{ - int ret; - - if (!qn->qos.ap_owned) { - /* send bandwidth request message to the RPM processor */ - ret = qcom_icc_rpm_set(qn->mas_rpm_id, qn->slv_rpm_id, sum_bw); - if (ret) - return ret; - } else if (qn->qos.qos_mode != NOC_QOS_MODE_INVALID) { - /* set bandwidth directly from the AP */ - ret = qcom_icc_qos_set(n, sum_bw); - if (ret) - return ret; - } - - return 0; -} - /** * qcom_icc_pre_bw_aggregate - cleans up values before re-aggregate requests * @node: icc node to operate on @@ -370,11 +353,12 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) sum_bw = icc_units_to_bps(max_agg_avg); - ret = __qcom_icc_set(src, src_qn, sum_bw); + ret = qcom_icc_rpm_set(src_qn, sum_bw); if (ret) return ret; + if (dst_qn) { - ret = __qcom_icc_set(dst, dst_qn, sum_bw); + ret = qcom_icc_rpm_set(dst_qn, sum_bw); if (ret) return ret; } @@ -528,6 +512,14 @@ int qnoc_probe(struct platform_device *pdev) for (j = 0; j < qnodes[i]->num_links; j++) icc_link_create(node, qnodes[i]->links[j]); + /* Set QoS registers (we only need to do it once, generally) */ + if (qnodes[i]->qos.ap_owned && + qnodes[i]->qos.qos_mode != NOC_QOS_MODE_INVALID) { + ret = qcom_icc_qos_set(node); + if (ret) + return ret; + } + data->nodes[i] = node; } data->num_nodes = num_nodes; From patchwork Fri Apr 7 20:14:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 81019 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp513876vqo; Fri, 7 Apr 2023 13:32:03 -0700 (PDT) X-Google-Smtp-Source: AKy350avESNZcqcyyoGH1RSrqRyKQjmPFrkbJDfBiACwHhRmD7ZuqElFEnASzuBFOH/LMpge3flA X-Received: by 2002:a17:906:c293:b0:949:fdd5:eecd with SMTP id r19-20020a170906c29300b00949fdd5eecdmr571119ejz.28.1680899523219; Fri, 07 Apr 2023 13:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680899523; cv=none; d=google.com; s=arc-20160816; b=zIVQH4cukGEUCdNa7i47Q4OM++pIA4fHVG96Y/H63/YCoIK7g6qO5dXr2riLNlHCk+ gGjbcGEDCbpHWDNHCwSd4gMPof7xnrCok+3rrkc7SUo/N7RrselwsmnWClTZIDyjX8mP vCz9aN0ph/CRSvAyDh6yETquCCID2gVQFGE4GwU3bTHSbKQK5dWcjyyuYAGG/720CL2C uXZY+94sfBOhvv34Umw5+Xpci2h3XPbTNPNSGM0J5/A96A3glWoXvj1hayc+3F1LqMX1 cUmqpOFt1xmw4GNV2cGkBOac1t6KdgVPcV8JV2DyHjsv1oyMa2J+Hm8VhMB764mMgWzU 0PMg== 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=e5L4qO6sptV54f0r3fZ5sm9NYcIKr5uU7vIOhE3jPUY=; b=mlESi+ILStor0ivpKVTSNbtpfLdr/DVgEw2j+wgzj3tVgn3kEEvQxWhG715G8iQWEq mLNEsayl//QLNyfM3nT4ziFeXSW3YElYB0DW7cp9KI7bmGaieUwuY8tj7ltKquNOeD1y Tzxt5rNxXfhC4dMu+u4vPd8a18T3AcJ67MKgs4H2JlqY7tLtzrhd85+ePLuRK43LvWFO b8hYNJLoDu+65mQUyoGlFrUAQibGTSBp/klORlIlUe/fklkYmndttjcK/yiOkOhoQZlA F9D0UxbKTjnmBFNGyJ3UJxVCIko69P/MQFe+l/Du0mDbkEz5nqesxHswRmY28qWNissz 7tug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KRoccwvY; 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 st4-20020a170907c08400b008ce9ebfbe0bsi1920072ejc.680.2023.04.07.13.31.35; Fri, 07 Apr 2023 13:32: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=KRoccwvY; 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 S229765AbjDGUPO (ORCPT + 99 others); Fri, 7 Apr 2023 16:15:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229983AbjDGUO4 (ORCPT ); Fri, 7 Apr 2023 16:14:56 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12A4CBDEE for ; Fri, 7 Apr 2023 13:14:54 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id h11so48737592lfu.8 for ; Fri, 07 Apr 2023 13:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680898492; 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=e5L4qO6sptV54f0r3fZ5sm9NYcIKr5uU7vIOhE3jPUY=; b=KRoccwvY9iA69vsgL79vikKueXuzVk2lCUlkshcNGY5+Zi1d5GQRf+phP6tWX7Ze7b zTh1DJcGfMaBgEBzRk5W56N8al/CLfA288RgU4heVycb1VFk8fZ8BdD5z3I2dHYugweh KRoasZ6/8T5AxXSgYqL81mA2qHmvgkS3TvhTEuDfK7VaADT0qNP5GWtLM96qQMSKhBzu tK2rXyd45yu25D4/eb7zN6bYWDilWSgZ9H8yq77Lv/z4mZ2IdAizZ5MKgkKuTQWzk8o8 CSfNRdwSE5Xsrz61vfyThEMShPXiZEBcRbeq8IJisVwzBZyaDJ/IYHhQN2EtdqKQN+gN 7Rbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680898492; 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=e5L4qO6sptV54f0r3fZ5sm9NYcIKr5uU7vIOhE3jPUY=; b=FaNrsFnOXYYDNN9Gjb0zOsSpo2Qg0pxdTHh+0gZb0ngp9AqZv7TlOksNaQyAy5nEfA toLzYzGQk7DAY4xSxqaeDNzeKt0psckdc0OLvM4UjaG5SYQ0aeN0hTZVE1S0sKDHvwXZ ikPqVUACS18uToSp1uRMd/m3e/sgQi2+B7aJdar33Kau0TTTq2mzgFpzUXxOUe4x9Coe t9RkIImJk+HA8kcTS+0iCjX2h1IcS6eXS6gAyVKwjcA4b+KesIDmvuy9kIWFATexUi0H JYuAtp8+qUL3GPmpiVuKNtmfIy7wHUBZrPFLNGBIWVDsix+vpRDDk7b5VmUJ6eIdvHn9 pbQw== X-Gm-Message-State: AAQBX9fwwmxJUHLsKGrTkYT8EAR5CbpqWP8Ev0FGhgEFRRdOVk0CDx+p bjcIcK39jPWcM9o9o54p6eTB3A== X-Received: by 2002:ac2:5509:0:b0:4eb:18d:91df with SMTP id j9-20020ac25509000000b004eb018d91dfmr966362lfk.27.1680898492250; Fri, 07 Apr 2023 13:14:52 -0700 (PDT) Received: from [192.168.1.101] (abxh37.neoplus.adsl.tpnet.pl. [83.9.1.37]) by smtp.gmail.com with ESMTPSA id u3-20020ac243c3000000b004eaf6181a32sm842436lfl.75.2023.04.07.13.14.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 13:14:51 -0700 (PDT) From: Konrad Dybcio Date: Fri, 07 Apr 2023 22:14:47 +0200 Subject: [PATCH v8 5/8] interconnect: qcom: rpm: Handle interface clocks MIME-Version: 1.0 Message-Id: <20230228-topic-qos-v8-5-ee696a2c15a9@linaro.org> References: <20230228-topic-qos-v8-0-ee696a2c15a9@linaro.org> In-Reply-To: <20230228-topic-qos-v8-0-ee696a2c15a9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Dmitry Baryshkov Cc: Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Marijn Suijten X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1680898484; l=8428; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=VP8quBVKpEptQIgT3Ham+bzqxwEHAFZBRJ/Y+InEks8=; b=lWQndPNnQQD6egbXgG0eBagLWLx9sNHAvZCstcObDRRoSN28CBrIgoU1iUYFq9MVNnJpRWGFEOH+ RUxiX3SuDbg3lXbZXrMFVdAqQZ51QW6Ioh7vsmKr6PnTaBfEA1EG X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762550898616834378?= X-GMAIL-MSGID: =?utf-8?q?1762550898616834378?= Some (but not all) providers (or their specific nodes) require specific clocks to be turned on before they can be accessed. Failure to ensure that results in a seemingly random system crash (which would usually happen at boot with the interconnect driver built-in), resulting in the platform not booting up properly. Limit the number of bus_clocks to 2 (which is the maximum that SMD RPM interconnect supports anyway) and handle non-scaling clocks separately. Update MSM8996 and SDM660 drivers to make sure they do not regress with this change. This unfortunately has to be done in one patch to prevent either compile errors or broken bisect. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 40 ++++++++++++++++++++++++++++--------- drivers/interconnect/qcom/icc-rpm.h | 14 +++++++++++-- drivers/interconnect/qcom/msm8996.c | 22 +++++++++----------- drivers/interconnect/qcom/sdm660.c | 16 ++++++--------- 4 files changed, 58 insertions(+), 34 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index d79e508cb717..419b2122bebd 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -424,21 +424,20 @@ int qnoc_probe(struct platform_device *pdev) qnodes = desc->nodes; num_nodes = desc->num_nodes; - if (desc->num_bus_clocks) { - cds = desc->bus_clocks; - cd_num = desc->num_bus_clocks; + if (desc->num_intf_clocks) { + cds = desc->intf_clocks; + cd_num = desc->num_intf_clocks; } else { - cds = bus_clocks; - cd_num = ARRAY_SIZE(bus_clocks); + /* 0 intf clocks is perfectly fine */ + cd_num = 0; } - qp = devm_kzalloc(dev, struct_size(qp, bus_clks, cd_num), GFP_KERNEL); + qp = devm_kzalloc(dev, sizeof(*qp), GFP_KERNEL); if (!qp) return -ENOMEM; - qp->bus_clk_rate = devm_kcalloc(dev, cd_num, sizeof(*qp->bus_clk_rate), - GFP_KERNEL); - if (!qp->bus_clk_rate) + qp->intf_clks = devm_kzalloc(dev, sizeof(qp->intf_clks), GFP_KERNEL); + if (!qp->intf_clks) return -ENOMEM; data = devm_kzalloc(dev, struct_size(data, nodes, num_nodes), @@ -446,6 +445,18 @@ int qnoc_probe(struct platform_device *pdev) if (!data) return -ENOMEM; + qp->num_intf_clks = cd_num; + for (i = 0; i < cd_num; i++) + qp->intf_clks[i].id = cds[i]; + + if (desc->num_bus_clocks) { + cds = desc->bus_clocks; + cd_num = desc->num_bus_clocks; + } else { + cds = bus_clocks; + cd_num = ARRAY_SIZE(bus_clocks); + } + for (i = 0; i < cd_num; i++) qp->bus_clks[i].id = cds[i]; qp->num_bus_clks = cd_num; @@ -486,6 +497,10 @@ int qnoc_probe(struct platform_device *pdev) if (ret) return ret; + ret = devm_clk_bulk_get(dev, qp->num_intf_clks, qp->intf_clks); + if (ret) + return ret; + provider = &qp->provider; provider->dev = dev; provider->set = qcom_icc_set; @@ -496,6 +511,11 @@ int qnoc_probe(struct platform_device *pdev) icc_provider_init(provider); + /* If this fails, bus accesses will crash the platform! */ + ret = clk_bulk_prepare_enable(qp->num_intf_clks, qp->intf_clks); + if (ret) + return ret; + for (i = 0; i < num_nodes; i++) { size_t j; @@ -524,6 +544,8 @@ int qnoc_probe(struct platform_device *pdev) } data->num_nodes = num_nodes; + clk_bulk_disable_unprepare(qp->num_intf_clks, qp->intf_clks); + ret = icc_provider_register(provider); if (ret) goto err_remove_nodes; diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index 2436777820a4..b9b63860042f 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -20,24 +20,32 @@ enum qcom_icc_type { QCOM_ICC_QNOC, }; +#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 + * @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 + * @is_on: whether the bus is powered on */ struct qcom_icc_provider { struct icc_provider provider; int num_bus_clks; + int num_intf_clks; enum qcom_icc_type type; struct regmap *regmap; unsigned int qos_offset; - u64 *bus_clk_rate; - struct clk_bulk_data bus_clks[]; + u64 bus_clk_rate[NUM_BUS_CLKS]; + struct clk_bulk_data bus_clks[NUM_BUS_CLKS]; + struct clk_bulk_data *intf_clks; + bool is_on; }; /** @@ -93,6 +101,8 @@ struct qcom_icc_desc { size_t num_nodes; const char * const *bus_clocks; size_t num_bus_clocks; + const char * const *intf_clocks; + size_t num_intf_clocks; enum qcom_icc_type type; const struct regmap_config *regmap_cfg; unsigned int qos_offset; diff --git a/drivers/interconnect/qcom/msm8996.c b/drivers/interconnect/qcom/msm8996.c index 21f998cd19f0..9aedfc8de4bf 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -21,21 +21,17 @@ #include "smd-rpm.h" #include "msm8996.h" -static const char * const bus_mm_clocks[] = { - "bus", - "bus_a", +static const char * const mm_intf_clocks[] = { "iface" }; -static const char * const bus_a0noc_clocks[] = { +static const char * const a0noc_intf_clocks[] = { "aggre0_snoc_axi", "aggre0_cnoc_ahb", "aggre0_noc_mpu_cfg" }; -static const char * const bus_a2noc_clocks[] = { - "bus", - "bus_a", +static const char * const a2noc_intf_clocks[] = { "aggre2_ufs_axi", "ufs_axi" }; @@ -1821,8 +1817,8 @@ static const struct qcom_icc_desc msm8996_a0noc = { .type = QCOM_ICC_NOC, .nodes = a0noc_nodes, .num_nodes = ARRAY_SIZE(a0noc_nodes), - .bus_clocks = bus_a0noc_clocks, - .num_bus_clocks = ARRAY_SIZE(bus_a0noc_clocks), + .intf_clocks = a0noc_intf_clocks, + .num_intf_clocks = ARRAY_SIZE(a0noc_intf_clocks), .regmap_cfg = &msm8996_a0noc_regmap_config }; @@ -1865,8 +1861,8 @@ static const struct qcom_icc_desc msm8996_a2noc = { .type = QCOM_ICC_NOC, .nodes = a2noc_nodes, .num_nodes = ARRAY_SIZE(a2noc_nodes), - .bus_clocks = bus_a2noc_clocks, - .num_bus_clocks = ARRAY_SIZE(bus_a2noc_clocks), + .intf_clocks = a2noc_intf_clocks, + .num_intf_clocks = ARRAY_SIZE(a2noc_intf_clocks), .regmap_cfg = &msm8996_a2noc_regmap_config }; @@ -2004,8 +2000,8 @@ static const struct qcom_icc_desc msm8996_mnoc = { .type = QCOM_ICC_NOC, .nodes = mnoc_nodes, .num_nodes = ARRAY_SIZE(mnoc_nodes), - .bus_clocks = bus_mm_clocks, - .num_bus_clocks = ARRAY_SIZE(bus_mm_clocks), + .intf_clocks = mm_intf_clocks, + .num_intf_clocks = ARRAY_SIZE(mm_intf_clocks), .regmap_cfg = &msm8996_mnoc_regmap_config }; diff --git a/drivers/interconnect/qcom/sdm660.c b/drivers/interconnect/qcom/sdm660.c index a22ba821efbf..0e8a96f4ce90 100644 --- a/drivers/interconnect/qcom/sdm660.c +++ b/drivers/interconnect/qcom/sdm660.c @@ -127,15 +127,11 @@ enum { SDM660_SNOC, }; -static const char * const bus_mm_clocks[] = { - "bus", - "bus_a", +static const char * const mm_intf_clocks[] = { "iface", }; -static const char * const bus_a2noc_clocks[] = { - "bus", - "bus_a", +static const char * const a2noc_intf_clocks[] = { "ipa", "ufs_axi", "aggre2_ufs_axi", @@ -1516,8 +1512,8 @@ static const struct qcom_icc_desc sdm660_a2noc = { .type = QCOM_ICC_NOC, .nodes = sdm660_a2noc_nodes, .num_nodes = ARRAY_SIZE(sdm660_a2noc_nodes), - .bus_clocks = bus_a2noc_clocks, - .num_bus_clocks = ARRAY_SIZE(bus_a2noc_clocks), + .intf_clocks = a2noc_intf_clocks, + .num_intf_clocks = ARRAY_SIZE(a2noc_intf_clocks), .regmap_cfg = &sdm660_a2noc_regmap_config, }; @@ -1659,8 +1655,8 @@ static const struct qcom_icc_desc sdm660_mnoc = { .type = QCOM_ICC_NOC, .nodes = sdm660_mnoc_nodes, .num_nodes = ARRAY_SIZE(sdm660_mnoc_nodes), - .bus_clocks = bus_mm_clocks, - .num_bus_clocks = ARRAY_SIZE(bus_mm_clocks), + .intf_clocks = mm_intf_clocks, + .num_intf_clocks = ARRAY_SIZE(mm_intf_clocks), .regmap_cfg = &sdm660_mnoc_regmap_config, }; From patchwork Fri Apr 7 20:14:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 81017 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp507930vqo; Fri, 7 Apr 2023 13:16:46 -0700 (PDT) X-Google-Smtp-Source: AKy350YNiMvGfC7QCzCAhfUw1+yrU7U0ohfNJSfFfz88O7pwjCWf1sdwQ4zc4O3MTnIAMO1u4c7X X-Received: by 2002:a17:907:2157:b0:914:4277:f3e1 with SMTP id rk23-20020a170907215700b009144277f3e1mr523953ejb.53.1680898605814; Fri, 07 Apr 2023 13:16:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680898605; cv=none; d=google.com; s=arc-20160816; b=BlxGf1OT6lfd9UkE1agouChYbJTGI6LOeNAxrsvQWw8Irm0pemjAFmBBRo43qz9E/S 7LYU7OeBBdMB2cCxUmd4f+zrcf0iJ1ThQX8qWp5mg7zeU0oiveImfZGDUkpCMpn01uE/ e3jE3wtkk2NtP4fADJEXbtcbFkooTQxr07/COzoV/01V3GR2GboDImZkHdHZ+xRb8DeW PCWMWmIxL/paNeJLrSIwD0kt4ng8Hru2tI5U0PWwUAjG7pJl9uVpsxOV95RdZWhTLDut QAujuJHO7hLiGKV2pR8aTCpio6WhvrPOQG+0XCAWhJqd2JfysbOdEZX/RqPFuY9kW3QA fPOw== 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=/s0KyzdHFTaVpYD3IHUwfb488kPSo+jQrOYqwaSsIUo=; b=HmlspN6m0d7jHrvBKit3OkN8orKaTDwVrBqufP80qwCLHt8GJYcn/ZOzfhw+ugowPK mGjoS5KxNYDjG5HXOFEFCuZROULFdfJd6ymR60A/b/scXeQ47cA0dEVKlZ6eQZFIhKT6 18JlEfK7Cyp9DMeumF8UtL+uPrZOOIoDr7UvWLjhrIOvieZnBurSR4PGbi27NS34lCaD 6zk3p9uxCDYsdo3XSE03GQmsssBRt/kKIYKukDrL5hnXDvKEkcgGKvqKpbRvmoER9uVZ 1isnyRyJiAxswyzBOFoKgvbeXSa9cWLsalUtM+zInWRglW67I9kJtPnAS6WXpx3/XIjk 7bQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=go4r5JVi; 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 t27-20020a17090616db00b008cc8a6fea26si4075312ejd.561.2023.04.07.13.16.21; Fri, 07 Apr 2023 13:16:45 -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=go4r5JVi; 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 S229870AbjDGUPI (ORCPT + 99 others); Fri, 7 Apr 2023 16:15:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229982AbjDGUO4 (ORCPT ); Fri, 7 Apr 2023 16:14:56 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC22FBDDF for ; Fri, 7 Apr 2023 13:14:53 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id q16so55678257lfe.10 for ; Fri, 07 Apr 2023 13:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680898493; 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=/s0KyzdHFTaVpYD3IHUwfb488kPSo+jQrOYqwaSsIUo=; b=go4r5JVihkQQblcQ4G5vxq1Z0CTXFplgVnHfahcsO8nR/B1ptHYm91GmmGlMpDQ7L1 rmlKWBodPxKXH+W9vuYaCVgWpH0QFFTYSCFlr+KqCTr7nW0nHpTxNNIvAz6XS6dbFzIj OrLrVfvoZqQMEh8TWSYuBDsVA8fr9+gT5tgfMKg2wJMha0hGRgnNUFpE5lGsm1litlw6 3M65vjMLT+bu3AUKPIF8p9WF9THinPrhVewKIB9rZOdbomsf2wup4ps34/jvqUOq04BN z7Btvbts00hkZshq1yfN9JS3zmDv3QiOxtuVfmTpNUpfFJMuIJxtV4X50E2+IzM2giuC 62Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680898493; 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=/s0KyzdHFTaVpYD3IHUwfb488kPSo+jQrOYqwaSsIUo=; b=5N5YVowQu97MpAMLfpqc3hid9kIQcEtMz6ZruKR03vrQC+ta6RmU/fjob8UavTMvSO jJFg9wN36QDfefqRvfihjarx4IvKyhtrr1L1uTY9/Nt0jLfuJ2mVhMbJ6XuZxEKypMEA CMNStVobIHOFCr/pGYaJq2aTfWrWvkvTK/dMzCapr3H7Evvi1eVDRWnh7+hiaBPgoyeO pLuQd3YSHO/HuKwsDL5R9THk9l4k4MvJA3JFtEvJjZcXa0Il4PtxYPzzmT8SKbsHqXfD NgLuaVpPefcVRX8gc6ETyvh+efDnImxsrhn3bH9zOZDQ/rPtM+Nn1Cox73k2z9ItexAQ RG9A== X-Gm-Message-State: AAQBX9eXYUKVOqpRfOIPvnmW+z3UKGLI8KMaW77ZgbEBjT/Nx0U9gMqS bR7skeCa7BTZHpCa2aNdYt8pGH9MG9OAhirtouk= X-Received: by 2002:ac2:5206:0:b0:4ea:e5b9:23b7 with SMTP id a6-20020ac25206000000b004eae5b923b7mr977487lfl.2.1680898493438; Fri, 07 Apr 2023 13:14:53 -0700 (PDT) Received: from [192.168.1.101] (abxh37.neoplus.adsl.tpnet.pl. [83.9.1.37]) by smtp.gmail.com with ESMTPSA id u3-20020ac243c3000000b004eaf6181a32sm842436lfl.75.2023.04.07.13.14.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 13:14:53 -0700 (PDT) From: Konrad Dybcio Date: Fri, 07 Apr 2023 22:14:48 +0200 Subject: [PATCH v8 6/8] interconnect: qcom: icc-rpm: Enforce 2 or 0 bus clocks MIME-Version: 1.0 Message-Id: <20230228-topic-qos-v8-6-ee696a2c15a9@linaro.org> References: <20230228-topic-qos-v8-0-ee696a2c15a9@linaro.org> In-Reply-To: <20230228-topic-qos-v8-0-ee696a2c15a9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Dmitry Baryshkov Cc: Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Marijn Suijten X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1680898484; l=3952; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=EgGK1x1RiyMgrD2kZYQgSem5RplbiqiH4kze2S62h0k=; b=xty6z7PfiH/CbAPnqHCmo4YWPMSsd33Dcs7tw9vP/lU5oKLxwXOGUvNTb4Lm4uHteS3vgpSnKfaL cLdTZumjANz0+KqISWa2bYzQ9nhVoOEwlMn8TiHfXXRP6eW2QxlQ X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762549936575682099?= X-GMAIL-MSGID: =?utf-8?q?1762549936575682099?= For SMD RPM bus scaling to work, we need a pair of sleep-wake clocks. The variable number of them we previously supported was only a hack to keep the clocks required for QoS register access, but now that these are separated, we can leave bus_clks to the actual bus clocks. In cases where there is no actual bus scaling (such as A0NoC on MSM8996 and GNoC on SDM660 where the HLOS is only supposed to program the QoS registers and the bus is either static or controlled remotely), allow for no clock scaling with a boolean property. Remove all the code related to allowing an arbitrary number of bus_clks, replace the number by BUS_CLK_MAX (= 2) and guard the bus clock paths to ensure they are not taken on non-scaling buses. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 14 +++----------- drivers/interconnect/qcom/icc-rpm.h | 4 ++-- drivers/interconnect/qcom/msm8996.c | 1 + drivers/interconnect/qcom/sdm660.c | 1 + 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 419b2122bebd..2298eb019534 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -449,17 +449,9 @@ int qnoc_probe(struct platform_device *pdev) for (i = 0; i < cd_num; i++) qp->intf_clks[i].id = cds[i]; - if (desc->num_bus_clocks) { - cds = desc->bus_clocks; - cd_num = desc->num_bus_clocks; - } else { - cds = bus_clocks; - cd_num = ARRAY_SIZE(bus_clocks); - } - - for (i = 0; i < cd_num; i++) - qp->bus_clks[i].id = cds[i]; - qp->num_bus_clks = cd_num; + 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->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 b9b63860042f..ee705edf19dd 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -25,7 +25,7 @@ enum qcom_icc_type { /** * 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 + * @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 @@ -100,9 +100,9 @@ struct qcom_icc_desc { struct qcom_icc_node * const *nodes; size_t num_nodes; const char * const *bus_clocks; - size_t num_bus_clocks; const char * const *intf_clocks; size_t num_intf_clocks; + bool no_clk_scaling; enum qcom_icc_type type; const struct regmap_config *regmap_cfg; unsigned int qos_offset; diff --git a/drivers/interconnect/qcom/msm8996.c b/drivers/interconnect/qcom/msm8996.c index 9aedfc8de4bf..dc9959a87df2 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -1819,6 +1819,7 @@ 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 0e8a96f4ce90..7ffaf70d62d3 100644 --- a/drivers/interconnect/qcom/sdm660.c +++ b/drivers/interconnect/qcom/sdm660.c @@ -1616,6 +1616,7 @@ 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 Fri Apr 7 20:14:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 81018 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp508253vqo; Fri, 7 Apr 2023 13:17:33 -0700 (PDT) X-Google-Smtp-Source: AKy350atORPSod0pFwT83UPMtVJHcQnX1VGdNhAp83j+t4/dCjlniruoy5XhSgqxMK/KU0rkYQBu X-Received: by 2002:a17:907:2c45:b0:931:d644:b9d3 with SMTP id hf5-20020a1709072c4500b00931d644b9d3mr556696ejc.59.1680898653061; Fri, 07 Apr 2023 13:17:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680898653; cv=none; d=google.com; s=arc-20160816; b=izVcOL/+4RFKEYkuWfb8HA2pPh1DzNEY1qK4LIgJdNkjqBS5O4WBFGJlb1uuOAJBZz r8+NhYaZlfP14sokv+vLDbV7YuvOXMEWnowWepVo18cgxZxLP9+mZJbe7eCt4LaAoygn +QvigMPPFc0Zx4h8Q8ubA8zusdXxZErwYWk3xAO3YTLb0cNA3bSrJz77fuEbhVbHaXJg pAHrXJ7uvEf2Rr4fRKf2CQlEi5rAE7ZHWPCoUJuRrrtzRXbHg7qDifvFBP8sbELhcog7 +fyQTyZna1AEcwTwIj924CPLRd+KxTJsFAX0aacKK5JB6W+Dih0XV5XC1BI+j+R26A4V s/SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=JmxVQOr0UERcZ1YMRZsASK3EItYYsfIdBLZTNEGU6JM=; b=NMHv4xGlcJu4L1iezLqlVAMLyCAf0BhGwSLRRDeQlHfCw/1B1U64B+HLKndzi5Y6oM OKaIPjlACBZlePqwokhWDlDE2BqD7oiiFhOCijnhOIDaHpKtIfBqnyykSTYsExCruVwp J+Q1Yb54Xu2jT3/idgI5pl9dBCr3baOkq2t4K6xKL8cqG9SJN7kcxJFIaBXSlmmcnM2o fqS2yXW7Jr8HnPWeaj8FJ5fs6h6yKLHw7YYLFkEZLu8sbraD90jmnYfytvUzGJRa/gk8 0BOekZxDGKjebjr46QVaow5eYRQLIXvKGkuaG0OAvlAWejmmQBJm+hlL2YAfBhRBDwtl nFDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="TS8/QvzE"; 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 lu10-20020a170906faca00b0093f3027f7c8si4202857ejb.802.2023.04.07.13.17.09; Fri, 07 Apr 2023 13:17:33 -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="TS8/QvzE"; 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 S230150AbjDGUP1 (ORCPT + 99 others); Fri, 7 Apr 2023 16:15:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230092AbjDGUPM (ORCPT ); Fri, 7 Apr 2023 16:15:12 -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 CBA6AC67B for ; Fri, 7 Apr 2023 13:14:56 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id h25so55713702lfv.6 for ; Fri, 07 Apr 2023 13:14:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680898495; 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=JmxVQOr0UERcZ1YMRZsASK3EItYYsfIdBLZTNEGU6JM=; b=TS8/QvzEVoiAydjEqS6eJXS9sWglXo50esu9QCI7gS7JP4MWoc3Wu/G+seMqtUy5sA 9BdKLgLAmu4Pzch+SbNpRW6sORsloB20w1juxxbrCncxb0/R+JbkkwwEo19uvOLJg2UL tWuevGu2VWU/xw268YcUZDHr4BxXgGEScQTw9FfUY9XwFmN1JdvmBPbKv6KNl6FKgj5V QR2Pnt0W8FyHoIuUigpEkSR1lPmMgMm+KyGhRuR+N9worgahzeX0VlyCZp/guGpEwjVc t1HxEBz9Ya5UO+oxGdOUmjhNrkmJoUM21bpqgLXA4YSLJ3lxVrrEWzqzAiL9kBr5WoIL Wi2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680898495; 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=JmxVQOr0UERcZ1YMRZsASK3EItYYsfIdBLZTNEGU6JM=; b=gnxWXN2186BcjMZuJoHw7rxNXmbp4owWM2y3RSRMSwR7eeynLxK04FzOORygC7Sdvr t/ozMf35tjVYRoqxJEUa1YC6vzmsUVc+NXqR3WUa6nANZve2QUh4Hh2oPcbKeS5N006U VZC99xRTKkIsfixCwApfMhoImMYVSBRiU8TeXbEF71wOSpj/IzZCjhNm595SDq8xZf8B hUmNg2ztfP7KaPUtaYZhjmm6GMEkoshMzjuC7rWCk5iBkMohWRwS2Pxg7mGIP2IyycFx aJRnF9A4Z0UqTa4virtIuGGbaypyBaJjdpxcctT3qvn29L/Dk/t3BZEbPTeFoQR5n6Zm 16lw== X-Gm-Message-State: AAQBX9dC/eGpC9X48gom7w4djLmBqWWo52SbSBjStPYHR4qWXnk/61EO B8+5O4Hsi2vcQTeGReU105rXkA== X-Received: by 2002:a19:ac09:0:b0:4ea:f69a:de37 with SMTP id g9-20020a19ac09000000b004eaf69ade37mr938788lfc.42.1680898495005; Fri, 07 Apr 2023 13:14:55 -0700 (PDT) Received: from [192.168.1.101] (abxh37.neoplus.adsl.tpnet.pl. [83.9.1.37]) by smtp.gmail.com with ESMTPSA id u3-20020ac243c3000000b004eaf6181a32sm842436lfl.75.2023.04.07.13.14.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 13:14:54 -0700 (PDT) From: Konrad Dybcio Date: Fri, 07 Apr 2023 22:14:49 +0200 Subject: [PATCH v8 7/8] interconnect: qcom: rpm: Don't use clk_get_optional for bus clocks anymore MIME-Version: 1.0 Message-Id: <20230228-topic-qos-v8-7-ee696a2c15a9@linaro.org> References: <20230228-topic-qos-v8-0-ee696a2c15a9@linaro.org> In-Reply-To: <20230228-topic-qos-v8-0-ee696a2c15a9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Dmitry Baryshkov Cc: Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Marijn Suijten X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1680898484; l=1105; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=ntGrIMziVYgfLiYwCKCTYabEq/yl5ewVMN3vP4/MQz8=; b=yfoAQc12tdXVQVdF6BOEuXj1J5vomOdNVpPVKYFlfaqUid1lCYeXUIaJE/6idY0Vg0osvkV6wzMQ PD95zQvvBAALR9xRzuU80Cy8R87AVhOySBmjYUso70sFcN1gLUIg X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762549986046175666?= X-GMAIL-MSGID: =?utf-8?q?1762549986046175666?= Commit dd42ec8ea5b9 ("interconnect: qcom: rpm: Use _optional func for provider clocks") relaxed the requirements around probing bus clocks. This was a decent solution for making sure MSM8996 would still boot with old DTs, but now that there's a proper fix in place that both old and new DTs will be happy about, revert back to the safer variant of the function. Fixes: dd42ec8ea5b9 ("interconnect: qcom: rpm: Use _optional func for provider clocks") Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 2298eb019534..8c1beae13860 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -481,7 +481,7 @@ int qnoc_probe(struct platform_device *pdev) } regmap_done: - ret = devm_clk_bulk_get_optional(dev, qp->num_bus_clks, qp->bus_clks); + ret = devm_clk_bulk_get(dev, qp->num_bus_clks, qp->bus_clks); if (ret) return ret; From patchwork Fri Apr 7 20:14:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 81024 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp514279vqo; Fri, 7 Apr 2023 13:33:03 -0700 (PDT) X-Google-Smtp-Source: AKy350a3LsDkUpRmCQuLurl8PnZ9xcIXXq0UNXB7xX1d4NTzaforGwdBqcsdW8yhBmmuJj+9e6hM X-Received: by 2002:a17:906:9c8d:b0:931:96c5:7646 with SMTP id fj13-20020a1709069c8d00b0093196c57646mr554377ejc.57.1680899583640; Fri, 07 Apr 2023 13:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680899583; cv=none; d=google.com; s=arc-20160816; b=Jc+x8Sbl7iKpJAkevHw56gyiznikT1WvN70O2QG6J1PcYMnrX744Vgw7iXN1yfmPW9 O7fxfDfU6WRiG+6YDphpoNsFLd9nojqSC8Xm+IYMwNKA7vJ4MzN8V8AAtbACLug7m16O gii/xqvN4ZROhJ85tUqgt/aXx9s/rPJozefshsm9a7RRo1w1yPwx0jZjz/wZvvHMI8dy OptAm4zRUu/SsJOzaj0wY2BwnVsTqG9I5fSehLRWPxcdDp4xLJeLlyXWM3THb63FkFgR RJbJEW4KEax4d/Gpm8l79/zGzujedoV97tfWn+GpyQ3o6cBp19bUXG6IsBrCJpigjwg6 3bgw== 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=UK324XxVLyW7Zcb2CZ/1jAhmypGps1orFHLyigBwr5Y=; b=hGCbi947c68UDhxO49vCK5IVm2/58mDdScJTE+3AMNUeWQNCM02VGxcyyrKx45BKz+ zTT4SG/ZZn00OgqRDppJar1yETHOeiyYb/RAZR9HM0r7Okf3JsQtDwZdVmxAW9FJzFfD GDfDk9kzETREnRrZu4frkp5pdf2vrRQZH5qAE3a7O53Qe6O4JhMnGPlmjZ+GVXH4bcqa kjxkOxPKpz2L787gXS2EYcYUZ7vSPxsvWm4HKZrjkygOaH2zLtXcVGPcM5BQBVSjfVV/ TWYkwVl135DvTCQk/GAdCGGy6I9wPQGBIBsOu0vHTD7UNFLZHiWEnL/ZiKXoKnAZPqQI dHrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yqZEBUvN; 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 l6-20020a1709066b8600b0092fcba1b0f8si3217477ejr.821.2023.04.07.13.32.39; Fri, 07 Apr 2023 13:33: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=yqZEBUvN; 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 S231210AbjDGUPa (ORCPT + 99 others); Fri, 7 Apr 2023 16:15:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230121AbjDGUPN (ORCPT ); Fri, 7 Apr 2023 16:15:13 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5020C171 for ; Fri, 7 Apr 2023 13:14:57 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id br6so55678081lfb.11 for ; Fri, 07 Apr 2023 13:14:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680898496; 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=UK324XxVLyW7Zcb2CZ/1jAhmypGps1orFHLyigBwr5Y=; b=yqZEBUvNVCoCG1kYbv6BCn4D0Qcr92VlfzKmglVvZYkEdbsKkM9eX6zrAes/n5toqv Qu4xR1oXPF3iW2PlmWZM4PiNnoYT7pHivkuEumgtKq5oW0+xNraiZVR+iFd5Ap7YE0Md UkYReMEbtTgol8JUCdn1e8AY4R+sRqVF/1vPdymDn8yog1HL/noqOd4oUik9koaXGWDM aJxPdG1AYb7uanLSnaNK9gtfH0YsPqphnes0NrEHCEV34cS1XsFJH7f1pxDIx4dyQ3nS Usmcqh5IhlWzI049CC/jJCuLBE7JkBk6R0LE1A9G8lLMyhYBGzmc+c9y9yqTy0CEw844 RMbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680898496; 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=UK324XxVLyW7Zcb2CZ/1jAhmypGps1orFHLyigBwr5Y=; b=Y2Y3ReSwyoyYAfaydt3UjYKq+pVTaXLJe6mA5oKO7o6oCreTW0qHwMGjZ0hNSYCWKc iUDhUS/oKs1cDa4V/HWnTS2LQAIz42IPaqpRk2ztjss4ohQ6yFa8V6WrsCud6qraOntp 2hifJe5I2Pe7/qA82kOrXF4z4g8ZBIB24Pu6ZOnlrI5t7oiXNSlRIecCdpKmft2Zncl3 48AGTLnMH/JvMYehW9xOJTsUzIYRjAG3M6Qcmkzd9AOJxqUJRcG4xhVaUHLqDPVr6vpy euTXa84uLkWi+JhaRmlkSCInsSByE9+6vj9N+NUmaWQLrDElEJITLX1IF5Wighvz6G2e +zjg== X-Gm-Message-State: AAQBX9cDS879SJez8tKDHoFA++NudvSKt5kPOP21x43pOf9Wri19QN8x VICEgi+XHnfhNMMnQs8aaGw6Tg== X-Received: by 2002:ac2:48b1:0:b0:4db:513b:6ef4 with SMTP id u17-20020ac248b1000000b004db513b6ef4mr1437520lfg.11.1680898496200; Fri, 07 Apr 2023 13:14:56 -0700 (PDT) Received: from [192.168.1.101] (abxh37.neoplus.adsl.tpnet.pl. [83.9.1.37]) by smtp.gmail.com with ESMTPSA id u3-20020ac243c3000000b004eaf6181a32sm842436lfl.75.2023.04.07.13.14.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 13:14:55 -0700 (PDT) From: Konrad Dybcio Date: Fri, 07 Apr 2023 22:14:50 +0200 Subject: [PATCH v8 8/8] interconnect: qcom: msm8996: Promote to core_initcall MIME-Version: 1.0 Message-Id: <20230228-topic-qos-v8-8-ee696a2c15a9@linaro.org> References: <20230228-topic-qos-v8-0-ee696a2c15a9@linaro.org> In-Reply-To: <20230228-topic-qos-v8-0-ee696a2c15a9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Dmitry Baryshkov Cc: Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Marijn Suijten X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1680898484; l=1279; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=BYfX0jKxH/0PCjBpNTo0aggPX+DBVTo1e00pUoIo7lE=; b=Q3wauYfS7gq5URur71wgmqfygzW5MSoxMThsPbY1kwefMc+i7/CpNJfllJopgOxt5+m5bsnSWzun FU/S2NiNDMRstqmR5b2r2pmOwfx7MCLGGf7tcxHLHdcPc7OV9ijd X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762550961669533729?= X-GMAIL-MSGID: =?utf-8?q?1762550961669533729?= The interconnect driver is (or soon will be) vital to many other devices, as it's not a given that the bootloader will set up enough bandwidth for us or that the values we come into are reasonable. Promote the driver to core_initcall to ensure the consumers (i.e. most "meaningful" parts of the SoC) can probe without deferrals. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/msm8996.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/qcom/msm8996.c b/drivers/interconnect/qcom/msm8996.c index dc9959a87df2..20340fb62fe6 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -2108,7 +2108,17 @@ static struct platform_driver qnoc_driver = { .sync_state = icc_sync_state, } }; -module_platform_driver(qnoc_driver); +static int __init qnoc_driver_init(void) +{ + return platform_driver_register(&qnoc_driver); +} +core_initcall(qnoc_driver_init); + +static void __exit qnoc_driver_exit(void) +{ + platform_driver_unregister(&qnoc_driver); +} +module_exit(qnoc_driver_exit); MODULE_AUTHOR("Yassine Oudjana "); MODULE_DESCRIPTION("Qualcomm MSM8996 NoC driver");