Skip to content

Commit 2508925

Browse files
Andy-ld LuUlf Hansson
authored andcommitted
mmc: mtk-sd: Fix MMC_CAP2_CRYPTO flag setting
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: 7b438d0 ("mmc: mtk-sd: add Inline Crypto Engine clock control") Fixes: ed299ed ("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>
1 parent 2912204 commit 2508925

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/mmc/host/mtk-sd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2907,7 +2907,8 @@ static int msdc_drv_probe(struct platform_device *pdev)
29072907
host->crypto_clk = devm_clk_get_optional(&pdev->dev, "crypto");
29082908
if (IS_ERR(host->crypto_clk))
29092909
return PTR_ERR(host->crypto_clk);
2910-
mmc->caps2 |= MMC_CAP2_CRYPTO;
2910+
else if (host->crypto_clk)
2911+
mmc->caps2 |= MMC_CAP2_CRYPTO;
29112912
}
29122913

29132914
host->irq = platform_get_irq(pdev, 0);

0 commit comments

Comments
 (0)