Re: [PATCH v1 1/1] mmc: sdhci-msm: Set ice clk rate

From: Ram Prakash Gupta

Date: Mon Jun 01 2026 - 03:00:06 EST




On 5/31/2026 10:54 PM, Abhinaba Rakshit wrote:
> On Fri, May 29, 2026 at 01:40:45PM +0530, Ram Prakash Gupta wrote:
>> Set ice clk rate from sdhci msm platform driver, needed for
>> target which are having legacy ice support, and need sdhci msm
>> platform driver to set rate.
>>
>> Signed-off-by: Ram Prakash Gupta <ram.gupta@xxxxxxxxxxxxxxxx>
>> ---
>> drivers/mmc/host/sdhci-msm.c | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
>> index b4131b12df56..c6a073718aa4 100644
>> --- a/drivers/mmc/host/sdhci-msm.c
>> +++ b/drivers/mmc/host/sdhci-msm.c
>> @@ -286,6 +286,7 @@ struct sdhci_msm_host {
>> /* core, iface, cal and sleep clocks */
>> struct clk_bulk_data bulk_clks[4];
>> #ifdef CONFIG_MMC_CRYPTO
>> + struct clk *ice_clk; /* ICE clock */
>> struct qcom_ice *ice;
>> #endif
>> unsigned long clk_rate;
>> @@ -2708,6 +2709,17 @@ static int sdhci_msm_probe(struct platform_device *pdev)
>> return ret;
>> }
>>
>> +#ifdef CONFIG_MMC_CRYPTO
>> + /* Setup ICE clock */
>> + msm_host->ice_clk = devm_clk_get(&pdev->dev, "ice");
>> + if (!IS_ERR(msm_host->ice_clk)) {
>> + /* Vote for max. clk rate for max. performance */
>> + ret = clk_set_rate(msm_host->ice_clk, INT_MAX);
>> + if (ret)
>> + dev_err(&pdev->dev, "ice clk set rate failed (%d)\n", ret);
>
> If we keep dev_err(), the failure path should probably go to bus_clk_disable.
> However, since boosting the core clock to max is kept optional,
> I think dev_warn() is more appropriate here and avoids making this a fatal error.
>
> Abhinaba Rakshit

Here its only setting rate of clk, so no clean up is needed, hence logging is
sufficient here, but I agree dev_warn should suffice instead of dev_err. I will
update this to dev_warn.

Thanks,
Ram