diff options
| author | Andy-ld Lu <andy-ld.lu@mediatek.com> | 2024-11-11 16:49:31 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-14 20:03:11 +0100 |
| commit | f42e0656d483d7495243e58e7d98c04cbbea9c11 (patch) | |
| tree | d855b12debd1f07a9033860dd5fbfc878f69d7cb | |
| parent | eac322ed9378f6b4b951d9eb7498ed79018e212a (diff) | |
| download | linux-f42e0656d483d7495243e58e7d98c04cbbea9c11.tar.gz linux-f42e0656d483d7495243e58e7d98c04cbbea9c11.tar.bz2 linux-f42e0656d483d7495243e58e7d98c04cbbea9c11.zip | |
mmc: mtk-sd: Fix MMC_CAP2_CRYPTO flag setting
[ Upstream commit 2508925fb346661bad9f50b497d7ac7d0b6085d0 ]
Currently, the MMC_CAP2_CRYPTO flag is set by default for eMMC hosts.
However, this flag should not be set for hosts that do not support inline
encryption.
The 'crypto' clock, as described in the documentation, is used for data
encryption and decryption. Therefore, only hosts that are configured with
this 'crypto' clock should have the MMC_CAP2_CRYPTO flag set.
Fixes: 7b438d0377fb ("mmc: mtk-sd: add Inline Crypto Engine clock control")
Fixes: ed299eda8fbb ("mmc: mtk-sd: fix devm_clk_get_optional usage")
Signed-off-by: Andy-ld Lu <andy-ld.lu@mediatek.com>
Cc: stable@vger.kernel.org
Message-ID: <20241111085039.26527-1-andy-ld.lu@mediatek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
| -rw-r--r-- | drivers/mmc/host/mtk-sd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 83e729148186..813bc20cfb5a 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -2774,7 +2774,8 @@ static int msdc_drv_probe(struct platform_device *pdev) host->crypto_clk = devm_clk_get_optional(&pdev->dev, "crypto"); if (IS_ERR(host->crypto_clk)) return PTR_ERR(host->crypto_clk); - mmc->caps2 |= MMC_CAP2_CRYPTO; + else if (host->crypto_clk) + mmc->caps2 |= MMC_CAP2_CRYPTO; } host->irq = platform_get_irq(pdev, 0); |
