From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A8324418E4 for ; Thu, 4 Jun 2026 12:16:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780575362; cv=none; b=dh0UZ2xiutWUm2dlbiEOVq6sFr7H8sBrXUndQ/mT89QcZ47pnfK+i2QAyFnqYnkXOeKR1EU6x+s3EqfbcW7TM++JRqnj/yvahw+DrHMpol6249WSv7GDI2nTHhuBdRChu9llu0o6fwPuUIDucV9WZdRLvPdmuGnl0jQTUAdgn0A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780575362; c=relaxed/simple; bh=9osXu5fHUdBJo5gaIuC4k3hPxCN1r5YRP7q6+f+cR64=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aTWWL8Q9CGTLsipR6nsFu+hS+Jo2eg/rXIfgY4Hw6CVN1ZfJ6vsvYKNzbxEgVSzmSHaCXqGOn+lzhrYdRcn8n5YmuFhyAq5YdWLqaZWSgYB5BQDrMjTOiBk3vYYKxuG7jD4bNGnLvUuH3BsPPhMx/aS6gcNjINXMRQ2MZ6RA350= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=KUWENSLo; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=bfmR7gw9; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="KUWENSLo"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="bfmR7gw9" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6548AkMr140442 for ; Thu, 4 Jun 2026 12:15:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= gvAt8SYmZzFHqCAJjilcE2ioUDijd8ZA9Agl1qVcjT8=; b=KUWENSLo7npGpOvW Dt0XYHEoE4s1Rg1F84BOShzhjjvLqbZBpH7tpmAth28ZsYXflsl4KIBQQ7NwzHG7 F+P/Hq/f5ZZ9xb5jZixGzLdj9miS3n9OuESjCoXQ312JMONAz6kk34x34sJjmryv oEggdbWDaYJEdAEzlbx+9ULpAzKmAqep/UFTcnoanamj1wFKwT7Q+y3617vdh5u6 3GRG9YqXQHeWXOd1Qjt3Wo8lBHc7i70SodOaqiNdSJMtWaB6Cz6FTqH9zYZwkcnk k+I2vMdXvCsdWaJLazMUqY91xalaE1RqwaaHfYMh84KrBk/K+udAADKrfrR5UdiP AdECJg== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejyena831-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 04 Jun 2026 12:15:59 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-36d98b5a68fso1198335a91.2 for ; Thu, 04 Jun 2026 05:15:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780575358; x=1781180158; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=gvAt8SYmZzFHqCAJjilcE2ioUDijd8ZA9Agl1qVcjT8=; b=bfmR7gw9fqB29NabKAwJ6EBo9lNGLPH2v2oX6R9NDIm2YNTprsm8uwirzwf6gjwQ6c CCvixhAFfb3tttDdsR8p57RvvLpGJ0Pg6qbje3DKdIs/8HC4vshra9N2acb23GTzDxnC +6j297QvP4Ep2hUg4myaXePrw0iDnoC6OvFNFYimhrqy08vr1GCny4sBujh+nY1AgToI XbIeMD5X6Ulgeeu3NsMshhTOfpa+dGdG4qHj/57Y1igGm9botzVMOukVcNcT3JrLYWHC CTn46dP7KsC0R7TM7kWH0QVVVfol8sjuzoBZ5UDwkU4Dxm5VA92HWUCHlFghueoy3orl Na4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780575358; x=1781180158; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gvAt8SYmZzFHqCAJjilcE2ioUDijd8ZA9Agl1qVcjT8=; b=LU9j+lOVfPj0C3yc6HIgk8j24vExvOVRoImD0GePNsaoT2YSFMKFfv22srfg47xFiQ vUDq+YTuBDRk70RsZy4mWyqrm8oSYNrvOSeADq2X27DoE/T8yxNweRPXRDSrpyJT6qfG YOPgE+FbN1UevErGsnBrTxR+uLB1Y2ThU9+1PPDnvYTiaAztLu+vez4kcn93w8L1MVpO KLR7PHAa1UqoBseWU5Hw9zJCvd/GhKARgAVklneYANMx3n84i0Y/WYmXKRe3cNsJosuS cX3wZltmWDhJRUHyUf62be+1U/xh/gjA28nLV5938hPavnj4CJFfXA+6IiKIZWdxV90J f2iQ== X-Forwarded-Encrypted: i=1; AFNElJ/DQwE026IqYdVB7j0c05t3g2WVaUSmj2nTA0Z04lRaErXJUIVf4wj7K9X5R8IMInntWUajRTR16AVc0RQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyRJNYhGXwc5RXQCJEmdpH+HmQDhfm+dM5VqJduWTGrlguWTZMH bxFN9JP7aVdv33tkqYUPT/6ktlMBc75WfejvRa11fcULh+0CApja7gFXRRooVAY9//1Z/1Qwb8s o0DMtW87OKr1AJ2np3eVGbZ2ML8Wqq+HTorvr6/+MwtRz7p2Ta0gkwVNPn/XhHCJIRA== X-Gm-Gg: Acq92OGpeHpfEkCdSzASS9M5bSoKqGXshcbrxX9qkkYm6plqCvHYptWU89NRqd4+icR 751atE9Ou3+EtC56pdTtXPtCA/6QDOg5SY4p46MmNL59/XjyHVgaQjxmiI3WsnAwD9OK7S9g/NQ taZ1FodSpB3R55DOTQMp0ItoFAvTR0yvmuG3NxYQj3OMagkRY+qDNQ/6RzMs250wIWxxoOQCdzO PQiYB+Nv63gggd+dk48MF/x9sjvK0R26EniLX5dueDYJo+lvsvaoYBAXoqGzoVbfyRY85UpzkHq QprQN9qNiN2GNkjDOg4Fl7aXtYQCccrLsH1FVx/0y8iFJpyEXlMwelwL4RX6epW0ixJ9W9sqPHy 0NwQz96rQx/PNxFzCRAJPQL8jlkoj3fH4xX6VcvYYcT876aI50t0yfYOb X-Received: by 2002:a17:90b:578d:b0:36b:9512:871b with SMTP id 98e67ed59e1d1-36e2fa98077mr7699309a91.11.1780575358095; Thu, 04 Jun 2026 05:15:58 -0700 (PDT) X-Received: by 2002:a17:90b:578d:b0:36b:9512:871b with SMTP id 98e67ed59e1d1-36e2fa98077mr7699267a91.11.1780575357528; Thu, 04 Jun 2026 05:15:57 -0700 (PDT) Received: from [10.217.216.18] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36f6bf827f1sm3877450a91.3.2026.06.04.05.15.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Jun 2026 05:15:57 -0700 (PDT) Message-ID: <1487d620-eb28-4a66-a611-0c6dfdf1e538@oss.qualcomm.com> Date: Thu, 4 Jun 2026 17:45:53 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/1] mmc: sdhci-msm: Set ice clk rate To: Adrian Hunter , Ulf Hansson , konrad.dybcio@oss.qualcomm.com, abhinaba.rakshit@oss.qualcomm.com Cc: linux-mmc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, pradeep.pragallapati@oss.qualcomm.com, manivannan.sadhasivam@oss.qualcomm.com References: <20260529081045.2877910-1-ram.gupta@oss.qualcomm.com> <20260529081045.2877910-2-ram.gupta@oss.qualcomm.com> <18af0dcb-8cf1-4565-a90d-58bf1e66811f@intel.com> <650d6ae8-36c9-44ba-a065-a1ceebee48b2@intel.com> Content-Language: en-US From: Ram Prakash Gupta In-Reply-To: <650d6ae8-36c9-44ba-a065-a1ceebee48b2@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Authority-Analysis: v=2.4 cv=JaSMa0KV c=1 sm=1 tr=0 ts=6a216c7f cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=VwQbUJbxAAAA:8 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=MYak2lq3idgefSP0UxwA:9 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: XkGoIBJvi-h2kR9gQcFz3PcoejjWvH0i X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjA0MDExOCBTYWx0ZWRfXyuryA2N1sDGT 8rX4BNVqwtT5yP+E6x4uP9WpfvzfXKjgjUfY/GsiKPzeUCwJG8lqTjJL1HG3KxlSCUKpP3MPGaU 9ta8pG/259tQAthhYfO8zk5b2EJzUoVs33XjWQ4c96EU48YpF2O6q1Cef6ibnE1+BZPAA/CneP8 bZD8UU6baTdE6SSNoQJ403UBCeTR0a7Q+UppcAMFPSYWcxvMJUDpIbsRIAZyupHR3lr/15mx+Ia 4EfqeYqRHA8dVhhQ41eeB5I6k5uBtaESRGXPj3gILM7NNmIJkLhJEdER5D014lTQzXe0/L2ybCQ cOoN5tu3UYJ9pNOjgAUpBgrPe7MC08wbKNAbX774R9rF+dryLLJNHARzqQ5oqu3zqCuV8wfJcDT uLqU5H+xgROu1TRyhGDijhBq5H9B+RS8GPjURJjwr3DpVnJt4hLJETzf2gIt7NMeff18/FC0cd+ clkiJ2QyrpHj7WACWpQ== X-Proofpoint-GUID: XkGoIBJvi-h2kR9gQcFz3PcoejjWvH0i X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-04_03,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606040118 On 6/3/2026 1:18 PM, Adrian Hunter wrote: > On 03/06/2026 10:03, Ram Prakash Gupta wrote: >> >> >> On 6/1/2026 1:00 PM, Adrian Hunter wrote: >>> On 29/05/2026 11:10, 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. >>> >>> Please expand upon what "legacy" means here? >>> >> >> for devices where ice node is not created as separate device node those >> are referred here as legacy, separate device node for ice starts with >> below change: https://lore.kernel.org/all/20230407105029.2274111-1-abel.vesa@linaro.org/ >> >> also I will update legacy that ice nodes which are created withing mmc dt >> node, so that ambiguity about legacy is clear. >> >>> For CQ case, qcom_ice_create() prefers "ice_core_clk" before >>> "ice". How does that relate to this? Please clarify that in the >>> commit message also. >>> >> >> "ice" is the naming convention used for emmc ice core clk in dt and >> "ice_core_clk" is the naming convention for ufs ice core clk. In the >> function you referred, since ice driver is common for both storage media, >> it tries to parse both the clock. >> >> Here we are handling "ice" as this is needed for emmc only. I will add >> the same in commit message. >> >>>> >>>> Signed-off-by: Ram Prakash Gupta >>>> --- >>>> 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 */ >>> >>> Why keep ice_clk? >>> >> >> here we need this ice_clk because rate set is required only when ice clk >> is added with emmc node in dt, and in case we try to use the clk entry of >> qcom_ice structure it will set the rate for new ice node as well which is >> separate. >> >> but also we can avoid this, since this one time operation, and we can reuse >> local variable clk inside sdhci_msm_probe, so it wont be needed. I will remove >> this in next patchset. >> >>>> 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)) { >>> >>> Does not attempt to deal with -EPROBE_DEFER, although bus_clk above >>> doesn't either. >>> >> >> here need is just to set the rate, rest of the enablement part would be >> taken care in ice driver, hence we can avoid this handling here. > > If devm_clk_get() returns -EPROBE_DEFER, then the rate will not be set, > so you are relying on devm_clk_get() never to return -EPROBE_DEFER. > here -EPROBE_DEFER can be returned when clk driver is not ready, in that case other clks, core & iface, would also fail to get enabled and then driver would run into issues. In case we get -EPROBE_DEFER for "ice" clk only then as you said rate will not be set for ice clk to max but warning log regarding ice clk rate not being set would be printed, and the ice clock would be set to 19.2MHz and in my opinion its not fatal. so -EPROBE_DEFER handling seems overkill here for 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); >>>> + } >>>> +#endif >>> >>> Could put this in a helper+stub function in the "Inline Crypto Engine >>> (ICE) support" section, to save having #ifdef CONFIG_MMC_CRYPTO here >>> >> >> sure, will take care of this in next patchset. >> >>>> + >>>> /* Setup main peripheral bus clock */ >>>> clk = devm_clk_get(&pdev->dev, "iface"); >>>> if (IS_ERR(clk)) { >>> >> >