Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Peng Zhou <peng.zhou@mediatek.com>
Cc: linux-mmc@vger.kernel.org,
	Chaotian Jing <chaotian.jing@mediatek.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Satya Tangirala <satyat@google.com>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Wulin Li <wulin.li@mediatek.com>,
	Stanley Chu <stanley.chu@mediatek.com>
Subject: Re: [PATCH v2 1/2] mmc: mediatek: add Inline Crypto Engine support
Date: Fri, 29 Jan 2021 10:59:51 -0800	[thread overview]
Message-ID: <YBRbJ5sGt75ndmvG@sol.localdomain> (raw)
In-Reply-To: <20210129070825.12304-1-peng.zhou@mediatek.com>

On Fri, Jan 29, 2021 at 03:08:25PM +0800, Peng Zhou wrote:
> - add crypto clock control and ungate it before CQHCI init
> - set MMC_CAP2_CRYPTO property of eMMC
> 
> Change-Id: I3a28eaa3718eee73259b4d60867cce25525f9bba
> Signed-off-by: Peng Zhou <peng.zhou@mediatek.com>

Please run scripts/checkpatch.pl on this patch (and the next one) and address
the warnings and errors.

> +	/* only eMMC has crypto property */
> +	if ((mmc->caps2 & MMC_CAP2_NO_SD) && (mmc->caps2 & MMC_CAP2_NO_SDIO))
> +		mmc->caps2 |= MMC_CAP2_CRYPTO;
> +
> +	if (mmc->caps2 & MMC_CAP2_CRYPTO) {
> +		host->crypto_clk = devm_clk_get(&pdev->dev, "crypto_clk");
> +		if (IS_ERR(host->crypto_clk))
> +			host->crypto_clk = NULL;
> +	}

Is this logic correct?  I'm wondering whether you want something more like:

	/* only eMMC has crypto property */
	if ((mmc->caps2 & MMC_CAP2_NO_SD) && (mmc->caps2 & MMC_CAP2_NO_SDIO))
		host->crypto_clk = devm_clk_get(&pdev->dev, "crypto_clk");
		if (IS_ERR(host->crypto_clk))
			host->crypto_clk = NULL;
		else
			mmc->caps2 |= MMC_CAP2_CRYPTO;
	}

I.e., is crypto only supported when crypto_clk is present?  Or can crypto be
supported without crypto_clk being present?

- Eric

  reply	other threads:[~2021-01-29 19:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-29  7:08 [PATCH v2 1/2] mmc: mediatek: add Inline Crypto Engine support Peng Zhou
2021-01-29 18:59 ` Eric Biggers [this message]
2021-02-10  7:42 ` Eric Biggers

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=YBRbJ5sGt75ndmvG@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=chaotian.jing@mediatek.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=peng.zhou@mediatek.com \
    --cc=satyat@google.com \
    --cc=stanley.chu@mediatek.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wulin.li@mediatek.com \
    /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