Received: by 2002:ab2:23c8:0:b0:1f2:fdbc:cb93 with SMTP id a8csp154932lqe; Wed, 27 Mar 2024 01:34:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVtYTr6mo6NO6/2nggV7OQ4N4CDuyzVCpUVMn4I9jLfngwPYSFNytcRslffCGA07CCh/+8clP0i19VQO1PT+Ig2radoYuedi+kClRLlig== X-Google-Smtp-Source: AGHT+IGyo3zdw+frI/vcC/hUCRlAzGVMgtWOpnTDUz3QxSYSFV5MXAU9+osz+rTsV6jsx4UZmSHS X-Received: by 2002:a17:906:6851:b0:a46:ba8f:bcd4 with SMTP id a17-20020a170906685100b00a46ba8fbcd4mr340495ejs.46.1711528490551; Wed, 27 Mar 2024 01:34:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711528490; cv=pass; d=google.com; s=arc-20160816; b=lA4SwwLjZ3DrMhALsg0aKDaXM801rRZkxHJWyFy7mK8Kjdr17IREPtYeOoc9NnhT9X 0QJiYwGceD8OVCbLgtRcGfKP+q8MKu15g0IX0gPfhJlzvcvpZ/tP2LrJ/7A9SRXojU7X VUoubmhW/xVrjtav/rwN4qiKDgmOXwat3jEiELAS8V5MhT4iB0jJA08ZK2O85FPJNfNY EcntGGGCFpMZuvbQb+rodBxtEuccAbbVSOylm4JJAdUbDDTOUj2hahHOFGuju1kpQXnM KEZ/RTfiLTFSYMaHRMI4F3E77oVhTvox5OnuJod3tDMX/MzMRq87EdSEGRJ9ntWfLGbg So0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=+oqfrbxWtOE6OEABwknWpgjuqFGutsayb/sO4RsSg+8=; fh=RFi2Hht9WfOB7/vWpHBNpAYBO2AwW7ukltjwfwFmWQk=; b=vQlLQSSbiOdDE3azufrR2ZZQp9h5kIRHIgF6AW93XZyR7LuXzoNyj1Knwp8ytPluA+ Yg++QUBn0gt+m/9ErDQh1IsNsHwfautcIrr0JeC6YWUm6gMydY9kswtskBovZ0QznxBo 1N1ySIBMLKPpvmF+/sj1fykrwSLFeAq9neWfnU0ILbuFKwO2xCJsxG/nAKXFCS0l5JWc GPRxr68U8zEHqHDi43bfHXEbBv6EReyT4mKEWKY56Lq0JMxT4PDL9WoJE65fpoaIOvzw jvY2RNURpBA0s0MvXK/Q6tLUIRIoJSLntXoZAYwheIbcAO/hjtWlo4kh4HlTiF2ujiRI h6lQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zvRbgG1N; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-120551-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120551-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dt5-20020a170906b78500b00a4748b3c1e9si3743868ejb.840.2024.03.27.01.34.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 01:34:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120551-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zvRbgG1N; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-120551-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120551-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 22DE01F2AE3F for ; Wed, 27 Mar 2024 08:34:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2621A3613D; Wed, 27 Mar 2024 08:34:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zvRbgG1N" Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36A6633989 for ; Wed, 27 Mar 2024 08:34:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711528483; cv=none; b=cqaEUXYZn6e1bA8QvkByXwEwSQYix23JuoucJJKd/MfCOIQNNgGwyGjYabGb2IzjD38qK3VTM9RYfc+iU0hw5c38FRcak+WNK3onU+32tLS6T/5nQBenmv/0GLse8PcP0OFH6PXJN4b5khpt0kYJBxWACt8XzVqisI35GLSZFuw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711528483; c=relaxed/simple; bh=yGihBXGGCZzmrylKLk56DkqdU6gQEERpAHPQqfup+ds=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=kLIc39nIpWaKYuZ0an8g2j4Wzpv1ZuA/4jqwRCvktqgGNlGwTOa9CYrPlGPNJ58B24TSgTwKR318ATWcR/J11gi1Na7Nkr97n3TAe+WeOqFRqCrPZeQ5hU8fJFSC2atCfp24tJGlcUfsjY5EbipxECYoi6ek3a34Wdx1fCuyZMY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=zvRbgG1N; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a466a27d30aso789960266b.1 for ; Wed, 27 Mar 2024 01:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711528479; x=1712133279; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=+oqfrbxWtOE6OEABwknWpgjuqFGutsayb/sO4RsSg+8=; b=zvRbgG1NzT3jza/sr7ho7Q11J3HV5vTdCgJ2k7iksTZHFAGP3Z19QvXKxoqzuI3LEL Jteo5RraESSHcai5UraVzxm2BK5ByKWvi3K/5NooQ8RETO1ypIBQsosTML9qbTUXQ4KN IL6NosrJ6amfXgFAfu1tPN08JHb4yUtNv+Cq4jkVnViD0JTA993bTi4WhqhtPjJa52gL cO7QeQNR6eV4FE4IbA9p7AzzhAZGlqZcubRAS8oRVcB9sn7jmxNM/NNTjq/uEqSXnipx 7FqlzDT/UGNOM0Y5n8iplRoKfLoXTgDDZ2aj2+wzE15U5VvfNOos/En47ba3twD+sCxy pUag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711528479; x=1712133279; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+oqfrbxWtOE6OEABwknWpgjuqFGutsayb/sO4RsSg+8=; b=sELUjlK9z8lD7iDUeHgQOnb0LyRq52wgI8SZUosIqh1fSOhllck0CiD3GMuPiCzhly hzkZwBa506GrWYt23WvDA1uApuGM6Sig5BS7Z3Vfrj3OjF3Ajj3Zf+AJ/2QeOaXRsJfm BAaPQ2ySlWOkd6DJ4m0HoDEKpxUZggreBgYDjZoXo9QVY5xrXf1rZ3YzFNPdMfuyMi9q 8dSMYQxs/rkcBy7UUe9drvpXcRBBqDvJhIGt60rqUldN46xw0qa4eXYOvJMiy8AmV1b/ NxfLiGi5i+pBonVWaQDnOI0EBcHyrH/6M5uos+SQTiYjjgtb8/5pedojrxlsf88mrhft U9iQ== X-Forwarded-Encrypted: i=1; AJvYcCXYa9zuI0varxGxDMqXxUIfpJF2NCq/JMiUusl9Kee/ViSbSHTtu4uaSTMqsLtmQopfEJyn595vBccDS1queUuDEb6fpOH2id7yPusY X-Gm-Message-State: AOJu0YyG0cRnxzBq1dH+mL0KgR1gXDi8T5EMHmnrY0KduzU0ANbYF7Vs KePKDPLKcUOn8t2XuOBfcjAePLHn1gGyWuAnsJ5qZudT2e46Q1UNoQe8ZyST+qk= X-Received: by 2002:a17:907:78c5:b0:a4e:c35:c54c with SMTP id kv5-20020a17090778c500b00a4e0c35c54cmr1820ejc.3.1711528479503; Wed, 27 Mar 2024 01:34:39 -0700 (PDT) Received: from [192.168.1.20] ([178.197.206.205]) by smtp.gmail.com with ESMTPSA id e21-20020a170906081500b00a4df251a601sm1740656ejd.77.2024.03.27.01.34.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Mar 2024 01:34:39 -0700 (PDT) Message-ID: <9cbba0e5-3dbc-4cea-a68b-0d48a511736e@linaro.org> Date: Wed, 27 Mar 2024 09:34:37 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 2/3] clk: qcom: add IPQ9574 interconnect clocks support To: Varadarajan Narayanan , andersson@kernel.org, konrad.dybcio@linaro.org, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, djakov@kernel.org, quic_anusha@quicinc.com, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org References: <20240327081850.2924870-1-quic_varada@quicinc.com> <20240327081850.2924870-3-quic_varada@quicinc.com> Content-Language: en-US From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C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GnJQqmEApiRqH6b4jRBOgJ+cY qc+rJggwMQcJL9F+oDm3wX47nr6jIsEB5ZftdybIzpMZ5V9v45lUwmdnMrSzZVgC4jRGXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <20240327081850.2924870-3-quic_varada@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 27/03/2024 09:18, Varadarajan Narayanan wrote: > Unlike MSM platforms that manage NoC related clocks and scaling > from RPM, IPQ SoCs dont involve RPM in managing NoC related > clocks and there is no NoC scaling. > > However, there is a requirement to enable some NoC interface > clocks for accessing the peripheral controllers present on > these NoCs. Though exposing these as normal clocks would work, > having a minimalistic interconnect driver to handle these clocks > would make it consistent with other Qualcomm platforms resulting > in common code paths. This is similar to msm8996-cbf's usage of > icc-clk framework. > > Signed-off-by: Varadarajan Narayanan > --- > v4: Use clk_hw instead of indices > Do icc register in qcom_cc_probe() call stream > Add icc clock info to qcom_cc_desc structure > v3: Use indexed identifiers here to avoid confusion > Fix error messages and move to common.c > v2: Move DTS to separate patch > Update commit log > Auto select CONFIG_INTERCONNECT & CONFIG_INTERCONNECT_CLK to fix build error > --- > drivers/clk/qcom/Kconfig | 2 ++ > drivers/clk/qcom/common.c | 34 ++++++++++++++++++++- > drivers/clk/qcom/common.h | 4 ++- > drivers/clk/qcom/gcc-ipq9574.c | 54 ++++++++++++++++++++++++++++++++++ > 4 files changed, 92 insertions(+), 2 deletions(-) > > diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig > index 8ab08e7b5b6c..af73a0b396eb 100644 > --- a/drivers/clk/qcom/Kconfig > +++ b/drivers/clk/qcom/Kconfig > @@ -243,6 +243,8 @@ config IPQ_GCC_8074 > > config IPQ_GCC_9574 > tristate "IPQ9574 Global Clock Controller" > + select INTERCONNECT > + select INTERCONNECT_CLK > help > Support for global clock controller on ipq9574 devices. > Say Y if you want to use peripheral devices such as UART, SPI, > diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c > index 75f09e6e057e..523d30d0ccbc 100644 > --- a/drivers/clk/qcom/common.c > +++ b/drivers/clk/qcom/common.c > @@ -8,6 +8,8 @@ > #include > #include > #include > +#include > +#include > #include > #include > > @@ -234,6 +236,36 @@ static struct clk_hw *qcom_cc_clk_hw_get(struct of_phandle_args *clkspec, > return cc->rclks[idx] ? &cc->rclks[idx]->hw : NULL; > } > > +static int qcom_cc_icc_register(struct device *dev, > + const struct qcom_cc_desc *desc) > +{ > +#if IS_ENABLED(CONFIG_INTERCONNECT_CLK) > + struct icc_provider *provider; > + struct icc_clk_data *icd; > + int i; > + > + if (!desc->icc_hws) > + return 0; > + > + icd = devm_kcalloc(dev, desc->num_icc_hws, sizeof(*icd), GFP_KERNEL); > + if (!icd) > + return dev_err_probe(dev, -ENOMEM, "malloc for icc clock data failed\n"); This is still not correct code. No driver code prints errors on allocation failure. Best regards, Krzysztof