Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Neeraj Soni <neeraj.soni@oss.qualcomm.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: ulf.hansson@linaro.org, adrian.hunter@intel.com,
	quic_dmukhopa@quicinc.com, quic_rampraka@quicinc.com,
	quic_nitirawa@quicinc.com, quic_sachgupt@quicinc.com,
	quic_bhaskarv@quicinc.com, quic_gaurkash@quicinc.com,
	quic_sartgarg@quicinc.com, ram.gupta@oss.qualcomm.com,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v5 4/4] mmc: mtk-sd: Protect crypto capability with crypto config
Date: Fri, 31 Jul 2026 11:31:58 +0530	[thread overview]
Message-ID: <0d8f8fed-c712-91d8-7ea8-287e5ba4dc6f@oss.qualcomm.com> (raw)
In-Reply-To: <20260730191030.GC3139@sol>



On 7/31/2026 12:40 AM, Eric Biggers wrote:
> On Thu, Jul 30, 2026 at 07:38:22PM +0530, Neeraj Soni wrote:
>> Host crypto capability can not be used if CONFIG_MMC_CRYPTO=n.
>> So set MMC_CAP2_CRYPTO in mmc->caps2 only if CONFIG_MMC_CRYPTO=y.
>>
>> Signed-off-by: Neeraj Soni <neeraj.soni@oss.qualcomm.com>
>> ---
>>  drivers/mmc/host/mtk-sd.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
>> index 01ea3adbdf3b..c415ed97e3c2 100644
>> --- a/drivers/mmc/host/mtk-sd.c
>> +++ b/drivers/mmc/host/mtk-sd.c
>> @@ -3031,7 +3031,11 @@ static int msdc_drv_probe(struct platform_device *pdev)
>>  		if (IS_ERR(host->crypto_clk))
>>  			return PTR_ERR(host->crypto_clk);
>>  		else if (host->crypto_clk)
>> +#ifdef CONFIG_MMC_CRYPTO
>>  			mmc->caps2 |= MMC_CAP2_CRYPTO;
>> +#else
>> +			dev_dbg(host->dev, "Enable necessary crypto config\n");
>> +#endif
> 
> host->dev is still NULL at this point.  So if the log message were to be
> actually reached it would show '(NULL device *)'.
> 
> But the message doesn't seem very useful anyway, especially when it's
> logged only at debug level.  So maybe just drop it.
> 
> Is there a reason to even enable the crypto clock when CONFIG_MMC_CRYPTO
> is disabled?  If no, then the 'if' condition above could just be changed
> to:
> 
>     if (IS_ENABLED(CONFIG_MMC_CRYPTO) && !(mmc->caps2 & MMC_CAP2_NO_MMC)) {
>
We will not need this patch if the i revert the change made around
MMC_CAP2_CRYPTO here https://lore.kernel.org/linux-mmc/20260116121004.1829223-1-neeraj.soni@oss.qualcomm.com/
since that change was not related to this series anyway. Will fix this
in v6.
 
> - Eric
> 
Regards,
Neeraj

      reply	other threads:[~2026-07-31  6:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 14:08 [PATCH v5 0/4] mmc: Avoid reprogram all keys to Inline Crypto Engine for MMC runtime suspend resume Neeraj Soni
2026-07-30 14:08 ` [PATCH v5 1/4] mmc: Allow host driver to control the re-programming of Crypto keys Neeraj Soni
2026-07-30 19:03   ` Eric Biggers
2026-07-31  5:52     ` Neeraj Soni
2026-07-30 14:08 ` [PATCH v5 2/4] mmc: sdhci-msm: Reprogram crypto keys during host hardware initialization Neeraj Soni
2026-07-30 19:18   ` Eric Biggers
2026-07-31  6:07     ` Neeraj Soni
2026-07-31  6:07     ` Neeraj Soni
2026-07-31  6:12       ` Eric Biggers
2026-07-31 12:44         ` Ram Prakash Gupta
2026-08-03 14:00           ` Neeraj Soni
2026-07-30 14:08 ` [PATCH v5 3/4] mmc: sdhci-msm: Use pm ops instead of macro to restore crypto keys Neeraj Soni
2026-07-30 19:23   ` Eric Biggers
2026-07-31  9:53     ` Neeraj Soni
2026-07-30 14:08 ` [PATCH v5 4/4] mmc: mtk-sd: Protect crypto capability with crypto config Neeraj Soni
2026-07-30 19:10   ` Eric Biggers
2026-07-31  6:01     ` Neeraj Soni [this message]

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=0d8f8fed-c712-91d8-7ea8-287e5ba4dc6f@oss.qualcomm.com \
    --to=neeraj.soni@oss.qualcomm.com \
    --cc=adrian.hunter@intel.com \
    --cc=ebiggers@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=quic_bhaskarv@quicinc.com \
    --cc=quic_dmukhopa@quicinc.com \
    --cc=quic_gaurkash@quicinc.com \
    --cc=quic_nitirawa@quicinc.com \
    --cc=quic_rampraka@quicinc.com \
    --cc=quic_sachgupt@quicinc.com \
    --cc=quic_sartgarg@quicinc.com \
    --cc=ram.gupta@oss.qualcomm.com \
    --cc=ulf.hansson@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