All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Eric Biggers <ebiggers@kernel.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: Fri, 22 Jan 2021 10:21:17 +0100	[thread overview]
Message-ID: <CAPDyKFr7OOOVh-RwQGu+VnChvf5EJjW_dW1xoD0950iMUW_ZEA@mail.gmail.com> (raw)
In-Reply-To: <YAnFPC0f4vJsKbuL@sol.localdomain>

On Thu, 21 Jan 2021 at 19:17, Eric Biggers <ebiggers@kernel.org> wrote:
>
> 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.

Yep, this looks good to me!

Kind regards
Uffe

  reply	other threads:[~2021-01-22  9:31 UTC|newest]

Thread overview: 17+ 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 12:44   ` kernel test robot
2021-01-21 13:04   ` Ulf Hansson
2021-01-21 18:17     ` Eric Biggers
2021-01-22  9:21       ` Ulf Hansson [this message]
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 14:42   ` Ulf Hansson
2021-01-21 15:30     ` Bjorn Andersson
2021-01-21 16:25       ` Ulf Hansson
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=CAPDyKFr7OOOVh-RwQGu+VnChvf5EJjW_dW1xoD0950iMUW_ZEA@mail.gmail.com \
    --to=ulf.hansson@linaro.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=ebiggers@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 \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.