From: Eric Biggers <ebiggers@kernel.org>
To: Abel Vesa <abel.vesa@linaro.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Manivannan Sadhasivam <mani@kernel.org>,
Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
Bart Van Assche <bvanassche@acm.org>,
Adrian Hunter <adrian.hunter@intel.com>,
"James E . J . Bottomley" <jejb@linux.ibm.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S . Miller" <davem@davemloft.net>,
linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org,
linux-scsi@vger.kernel.org
Subject: Re: [RFC PATCH v3 5/7] scsi: ufs: ufs-qcom: Switch to the new ICE API
Date: Mon, 13 Mar 2023 12:08:19 -0700 [thread overview]
Message-ID: <ZA90o0K6fBHe0Q74@sol.localdomain> (raw)
In-Reply-To: <20230313115202.3960700-6-abel.vesa@linaro.org>
On Mon, Mar 13, 2023 at 01:52:00PM +0200, Abel Vesa wrote:
> diff --git a/drivers/ufs/host/Makefile b/drivers/ufs/host/Makefile
> index d7c5bf7fa512..081b332fe7ce 100644
> --- a/drivers/ufs/host/Makefile
> +++ b/drivers/ufs/host/Makefile
> @@ -5,7 +5,6 @@ obj-$(CONFIG_SCSI_UFS_DWC_TC_PLATFORM) += tc-dwc-g210-pltfrm.o ufshcd-dwc.o tc-d
> obj-$(CONFIG_SCSI_UFS_CDNS_PLATFORM) += cdns-pltfrm.o
> obj-$(CONFIG_SCSI_UFS_QCOM) += ufs_qcom.o
> ufs_qcom-y += ufs-qcom.o
> -ufs_qcom-$(CONFIG_SCSI_UFS_CRYPTO) += ufs-qcom-ice.o
> obj-$(CONFIG_SCSI_UFS_EXYNOS) += ufs-exynos.o
> obj-$(CONFIG_SCSI_UFSHCD_PCI) += ufshcd-pci.o
> obj-$(CONFIG_SCSI_UFSHCD_PLATFORM) += ufshcd-pltfrm.o
Now that ufs-qcom will be single-file again, maybe this should go back to the
original approach of just:
obj-$(CONFIG_SCSI_UFS_QCOM) += ufs-qcom.o
(Note the dash instead of underscore)
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index a02cd866e2f8..8f8581dbe09a 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -15,6 +15,8 @@
> #include <linux/reset-controller.h>
> #include <linux/devfreq.h>
>
> +#include <soc/qcom/ice.h>
> +
> #include <ufs/ufshcd.h>
> #include "ufshcd-pltfrm.h"
> #include <ufs/unipro.h>
> @@ -55,6 +57,85 @@ static struct ufs_qcom_host *rcdev_to_ufs_host(struct reset_controller_dev *rcd)
> return container_of(rcd, struct ufs_qcom_host, rcdev);
> }
>
> +#ifdef CONFIG_SCSI_UFS_CRYPTO
> +
> +static inline void ufs_qcom_ice_enable(struct ufs_qcom_host *host)
> +{
> + qcom_ice_enable(host->ice);
> +}
> +
> +static int ufs_qcom_ice_init(struct ufs_qcom_host *host)
> +{
> + struct ufs_hba *hba = host->hba;
> + struct device *dev = hba->dev;
> +
> + host->ice = of_qcom_ice_get(dev);
> + if (IS_ERR(host->ice))
> + return PTR_ERR(host->ice);
> +
> + return 0;
> +}
What happens if ICE is not supported? I believe we should continue allowing UFS
to work with crypto support, as was the case before.
Note these lines of code in the original version:
dev_warn(dev, "Disabling inline encryption support\n");
hba->caps &= ~UFSHCD_CAP_CRYPTO;
It's important to clear UFSHCD_CAP_CRYPTO, otherwise the driver will think that
ICE is supported.
- Eric
next prev parent reply other threads:[~2023-03-13 19:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-13 11:51 [RFC PATCH v3 0/7] Add dedicated Qcom ICE driver Abel Vesa
2023-03-13 11:51 ` [RFC PATCH v3 1/7] dt-bindings: crypto: Add Qualcomm Inline Crypto Engine Abel Vesa
2023-03-14 11:19 ` Krzysztof Kozlowski
2023-03-13 11:51 ` [RFC PATCH v3 2/7] dt-bindings: mmc: sdhci-msm: Add ICE phandle and drop core clock Abel Vesa
2023-03-13 18:27 ` Eric Biggers
2023-03-13 11:51 ` [RFC PATCH v3 3/7] dt-bindings: ufs: qcom: " Abel Vesa
2023-03-13 11:51 ` [RFC PATCH v3 4/7] soc: qcom: Make the Qualcomm UFS/SDCC ICE a dedicated driver Abel Vesa
2023-03-13 18:44 ` Eric Biggers
2023-03-24 20:08 ` Abel Vesa
2023-03-13 11:52 ` [RFC PATCH v3 5/7] scsi: ufs: ufs-qcom: Switch to the new ICE API Abel Vesa
2023-03-13 19:08 ` Eric Biggers [this message]
2023-03-13 11:52 ` [RFC PATCH v3 6/7] mmc: sdhci-msm: " Abel Vesa
2023-03-13 19:11 ` Eric Biggers
2023-03-13 11:52 ` [RFC PATCH v3 7/7] arm64: dts: qcom: sm8550: Add the Inline Crypto Engine node Abel Vesa
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=ZA90o0K6fBHe0Q74@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=abel.vesa@linaro.org \
--cc=adrian.hunter@intel.com \
--cc=agross@kernel.org \
--cc=alim.akhtar@samsung.com \
--cc=andersson@kernel.org \
--cc=avri.altman@wdc.com \
--cc=bvanassche@acm.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=jejb@linux.ibm.com \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.com \
--cc=robh+dt@kernel.org \
--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