devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Thara Gopinath <thara.gopinath@gmail.com>,
	Bhupesh Sharma <bhupesh.sharma@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>, Andy Gross <agross@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-crypto@vger.kernel.org, Jordan Crouse <jorcrous@amazon.com>
Subject: Re: [PATCH v11 09/10] crypto: qce: core: Make clocks optional
Date: Wed, 22 Feb 2023 18:33:56 +0100	[thread overview]
Message-ID: <cdc87c95-a845-904b-1a57-0895b9f93d9f@linaro.org> (raw)
In-Reply-To: <20230222172240.3235972-10-vladimir.zapolskiy@linaro.org>



On 22.02.2023 18:22, Vladimir Zapolskiy wrote:
> From: Thara Gopinath <thara.gopinath@gmail.com>
> 
> On certain Snapdragon processors, the crypto engine clocks are enabled by
> default by security firmware and the driver should not handle the clocks.
> Make acquiring of all the clocks optional in crypto engine driver, so that
> the driver initializes properly even if no clocks are specified in the dt.
> 
> Tested-by: Jordan Crouse <jorcrous@amazon.com>
> Signed-off-by: Thara Gopinath <thara.gopinath@gmail.com>
> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
> [Bhupesh: Massage the commit log]
> Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
> ---
I'm not sure which is the preferred approach, but generally I'd
stick with keeping them non-optional for the SoCs that need them..
So perhaps introducing a flag in of_match_data for qcom,sm8150-qce
(which was created solely to take care of the no-HLOS-clocks cases)
and then skipping the clock operations based on that would be a
good idea.

Konrad

>  drivers/crypto/qce/core.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c
> index 0654b94cfb95..5bb2128c95ca 100644
> --- a/drivers/crypto/qce/core.c
> +++ b/drivers/crypto/qce/core.c
> @@ -209,15 +209,15 @@ static int qce_crypto_probe(struct platform_device *pdev)
>  	if (ret < 0)
>  		return ret;
>  
> -	qce->core = devm_clk_get(qce->dev, "core");
> +	qce->core = devm_clk_get_optional(qce->dev, "core");
>  	if (IS_ERR(qce->core))
>  		return PTR_ERR(qce->core);
>  
> -	qce->iface = devm_clk_get(qce->dev, "iface");
> +	qce->iface = devm_clk_get_optional(qce->dev, "iface");
>  	if (IS_ERR(qce->iface))
>  		return PTR_ERR(qce->iface);
>  
> -	qce->bus = devm_clk_get(qce->dev, "bus");
> +	qce->bus = devm_clk_get_optional(qce->dev, "bus");
>  	if (IS_ERR(qce->bus))
>  		return PTR_ERR(qce->bus);
>  
 

  reply	other threads:[~2023-02-22 17:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22 17:22 [PATCH v11 00/10] crypto: qcom-qce: Add YAML bindings and support for newer SoCs Vladimir Zapolskiy
2023-02-22 17:22 ` [PATCH v11 01/10] dt-bindings: qcom-qce: Convert bindings to yaml Vladimir Zapolskiy
2023-02-22 17:22 ` [PATCH v11 02/10] MAINTAINERS: Add qcom-qce dt-binding file to QUALCOMM CRYPTO DRIVERS section Vladimir Zapolskiy
2023-02-22 17:22 ` [PATCH v11 03/10] dt-bindings: qcom-qce: Add 'interconnects' and 'interconnect-names' Vladimir Zapolskiy
2023-02-22 17:22 ` [PATCH v11 04/10] dt-bindings: qcom-qce: Add 'iommus' to optional properties Vladimir Zapolskiy
2023-02-22 17:22 ` [PATCH v11 05/10] dt-bindings: qcom-qce: Add new SoC compatible strings for Qualcomm QCE IP Vladimir Zapolskiy
2023-02-22 17:22 ` [PATCH v11 06/10] dt-bindings: qcom-qce: document optional clocks and clock-names properties Vladimir Zapolskiy
2023-02-23  9:32   ` Krzysztof Kozlowski
2023-02-22 17:22 ` [PATCH v11 07/10] arm64: dts: qcom: sm8550: add QCE IP family compatible values Vladimir Zapolskiy
2023-02-27  8:26   ` Neil Armstrong
2023-02-22 17:22 ` [PATCH v11 08/10] crypto: qce: core: Add support to initialize interconnect path Vladimir Zapolskiy
2023-02-22 17:29   ` Konrad Dybcio
2023-02-22 17:22 ` [PATCH v11 09/10] crypto: qce: core: Make clocks optional Vladimir Zapolskiy
2023-02-22 17:33   ` Konrad Dybcio [this message]
2023-02-22 18:27     ` Vladimir Zapolskiy
2023-02-22 17:22 ` [PATCH v11 10/10] crypto: qce: core: Add a QCE IP family compatible 'qcom,qce' Vladimir Zapolskiy
2023-02-22 17:34   ` Konrad Dybcio
2023-03-10 11:28 ` [PATCH v11 00/10] crypto: qcom-qce: Add YAML bindings and support for newer SoCs Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cdc87c95-a845-904b-1a57-0895b9f93d9f@linaro.org \
    --to=konrad.dybcio@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=bhupesh.sharma@linaro.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=jorcrous@amazon.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=thara.gopinath@gmail.com \
    --cc=vladimir.zapolskiy@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).