From: Eric Biggers <ebiggers@kernel.org>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
linux-arm-msm <linux-arm-msm@vger.kernel.org>,
DTML <devicetree@vger.kernel.org>,
linux-fscrypt@vger.kernel.org,
Satya Tangirala <satyat@google.com>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Asutosh Das <asutoshd@codeaurora.org>,
Rob Herring <robh+dt@kernel.org>,
Neeraj Soni <neersoni@codeaurora.org>,
Barani Muthukumaran <bmuthuku@codeaurora.org>,
Peng Zhou <peng.zhou@mediatek.com>,
Stanley Chu <stanley.chu@mediatek.com>,
Konrad Dybcio <konradybcio@gmail.com>
Subject: Re: [PATCH v5 4/9] mmc: cqhci: add support for inline encryption
Date: Thu, 21 Jan 2021 10:17:32 -0800 [thread overview]
Message-ID: <YAnFPC0f4vJsKbuL@sol.localdomain> (raw)
In-Reply-To: <CAPDyKFqCz=N9R6RpEoMO+zoKhJbds1rbvgzHJ2z+6k2U2Wq6Yg@mail.gmail.com>
On Thu, Jan 21, 2021 at 02:04:37PM +0100, Ulf Hansson wrote:
> > +#else /* CONFIG_MMC_CRYPTO */
> > +
> > +static inline int cqhci_crypto_init(struct cqhci_host *host)
> > +{
> > + return 0;
>
> The host calling this function may have MMC_CAP2_CRYPTO set for it.
>
> When CONFIG_MMC_CRYPTO is set, cqhci_crypto_init() may unset
> MMC_CAP2_CRYPTO if initialization fails. It seems like we should unset
> MMC_CAP2_CRYPTO in this stub function as well, right?
The code in sdhci-msm.c that sets MMC_CAP2_CRYPTO is conditional on
CONFIG_MMC_CRYPTO. So, MMC_CAP2_CRYPTO won't be set when !CONFIG_MMC_CRYPTO.
I suppose we might as well do something to stop other drivers from accidentally
getting that wrong, though.
How about just defining the flag to 0 when !CONFIG_MMC_CRYPTO:
#ifdef CONFIG_MMC_CRYPTO
#define MMC_CAP2_CRYPTO (1 << 27) /* Host supports inline encryption */
#else
#define MMC_CAP2_CRYPTO 0
#endif
That would be more reliable than relying on the flag getting cleared by
something.
- Eric
next prev parent reply other threads:[~2021-01-21 18:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-21 9:01 [PATCH v5 0/9] eMMC inline encryption support Eric Biggers
2021-01-21 9:01 ` [PATCH v5 1/9] mmc: add basic support for inline encryption Eric Biggers
2021-01-21 9:01 ` [PATCH v5 2/9] mmc: cqhci: rename cqhci.c to cqhci-core.c Eric Biggers
2021-01-21 9:01 ` [PATCH v5 3/9] mmc: cqhci: initialize upper 64 bits of 128-bit task descriptors Eric Biggers
2021-01-21 9:01 ` [PATCH v5 4/9] mmc: cqhci: add support for inline encryption Eric Biggers
2021-01-21 13:04 ` Ulf Hansson
2021-01-21 18:17 ` Eric Biggers [this message]
2021-01-22 9:21 ` Ulf Hansson
2021-01-21 9:01 ` [PATCH v5 5/9] mmc: cqhci: add cqhci_host_ops::program_key Eric Biggers
2021-01-21 9:01 ` [PATCH v5 6/9] firmware: qcom_scm: update comment for ICE-related functions Eric Biggers
2021-01-21 9:01 ` [PATCH v5 7/9] dt-bindings: mmc: sdhci-msm: add ICE registers and clock Eric Biggers
2021-01-21 9:01 ` [PATCH v5 8/9] arm64: dts: qcom: sdm630: add ICE registers and clocks Eric Biggers
2021-01-21 9:01 ` [PATCH v5 9/9] mmc: sdhci-msm: add Inline Crypto Engine support 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=YAnFPC0f4vJsKbuL@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=agross@kernel.org \
--cc=asutoshd@codeaurora.org \
--cc=bjorn.andersson@linaro.org \
--cc=bmuthuku@codeaurora.org \
--cc=devicetree@vger.kernel.org \
--cc=konradybcio@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-fscrypt@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=neersoni@codeaurora.org \
--cc=peng.zhou@mediatek.com \
--cc=robh+dt@kernel.org \
--cc=satyat@google.com \
--cc=stanley.chu@mediatek.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;
as well as URLs for NNTP newsgroup(s).