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 v4 1/9] mmc: add basic support for inline encryption
Date: Fri, 15 Jan 2021 09:56:13 -0800 [thread overview]
Message-ID: <YAHXPREJaKjK/z7+@sol.localdomain> (raw)
In-Reply-To: <CAPDyKFq717teu2HPZLCn9QVxLOwZHdi_iS+Ji69S0kYX1o52PQ@mail.gmail.com>
On Fri, Jan 15, 2021 at 10:22:03AM +0100, Ulf Hansson wrote:
> On Mon, 4 Jan 2021 at 19:48, Eric Biggers <ebiggers@kernel.org> wrote:
> >
> > From: Eric Biggers <ebiggers@google.com>
> >
> > In preparation for adding CQHCI crypto engine (inline encryption)
> > support, add the code required to make mmc_core and mmc_block aware of
> > inline encryption. Specifically:
> >
> > - Add a capability flag MMC_CAP2_CRYPTO to struct mmc_host. Drivers
> > will set this if the host and driver support inline encryption.
> >
> > - Embed a blk_keyslot_manager in struct mmc_host. Drivers will
> > initialize this if the host and driver support inline encryption.
> > mmc_block registers this keyslot manager with the request_queue of any
> > MMC card attached to the host. mmc_core destroys this keyslot manager
> > when freeing the mmc_host.
> >
> > - Make mmc_block copy the crypto keyslot and crypto data unit number
> > from struct request to struct mmc_request, so that drivers will have
> > access to them.
> >
> > - If the MMC host is reset, reprogram all the keyslots to ensure that
> > the software state stays in sync with the hardware state.
> >
> > Co-developed-by: Satya Tangirala <satyat@google.com>
> > Signed-off-by: Satya Tangirala <satyat@google.com>
> > Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> > Reviewed-by: Satya Tangirala <satyat@google.com>
> > Reviewed-and-tested-by: Peng Zhou <peng.zhou@mediatek.com>
> > Signed-off-by: Eric Biggers <ebiggers@google.com>
>
> Eric, again, my apologies for the delay. Overall, I think this looks good.
>
> My only hesitation to merge this as is, is that I want to make sure
> you have thought of the life cycle issues for the struct
> blk_keyslot_manager ksm. It's being used both from the mmc core/block
> device driver and the mmc host driver. I am looking at this right now
> and will get back to you very soon, if I find some issues with it.
>
> If you have some time, feel free to elaborate around how this is
> intended to work.
>
> Kind regards
> Uffe
The blk_keyslot_manager is initialized early on when the other host structures
(struct mmc_host, struct cqhci_host, struct sdhci_host, struct sdhci_msm_host)
are initialized, prior to mmc_add_host().
It is destroyed when the struct mmc_host is freed by mmc_free_host().
So it should just work; it's the same lifecycle as the existing host structures.
Is there something you think I'm overlooking?
- Eric
next prev parent reply other threads:[~2021-01-15 17:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-04 18:45 [PATCH v4 0/9] eMMC inline encryption support Eric Biggers
2021-01-04 18:45 ` [PATCH v4 1/9] mmc: add basic support for inline encryption Eric Biggers
2021-01-15 9:22 ` Ulf Hansson
2021-01-15 17:56 ` Eric Biggers [this message]
2021-01-18 14:21 ` Ulf Hansson
2021-01-19 20:51 ` Eric Biggers
2021-01-21 7:45 ` Eric Biggers
2021-01-21 9:18 ` Eric Biggers
2021-01-21 13:08 ` Ulf Hansson
2021-01-04 18:45 ` [PATCH v4 2/9] mmc: cqhci: rename cqhci.c to cqhci-core.c Eric Biggers
2021-01-04 18:45 ` [PATCH v4 3/9] mmc: cqhci: initialize upper 64 bits of 128-bit task descriptors Eric Biggers
2021-01-04 18:45 ` [PATCH v4 4/9] mmc: cqhci: add support for inline encryption Eric Biggers
2021-01-04 18:45 ` [PATCH v4 5/9] mmc: cqhci: add cqhci_host_ops::program_key Eric Biggers
2021-01-04 18:45 ` [PATCH v4 6/9] firmware: qcom_scm: update comment for ICE-related functions Eric Biggers
2021-01-04 18:45 ` [PATCH v4 7/9] dt-bindings: mmc: sdhci-msm: add ICE registers and clock Eric Biggers
2021-01-04 18:45 ` [PATCH v4 8/9] arm64: dts: qcom: sdm630: add ICE registers and clocks Eric Biggers
2021-01-04 18:45 ` [PATCH v4 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=YAHXPREJaKjK/z7+@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