Skip to content

Commit

Permalink
mmc: mtk-sd: Fix MMC_CAP2_CRYPTO flag setting
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
  • Loading branch information
Andy-ld Lu authored and storulf committed Nov 12, 2024
1 parent 2912204 commit 2508925
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mmc/host/mtk-sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2907,7 +2907,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);
Expand Down

0 comments on commit 2508925

Please sign in to comment.