From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 843483F4DDA for ; Fri, 5 Jun 2026 10:06:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780653986; cv=none; b=D/hflGJTyeLQSvFSJyGFxIrg8/xojRuCnt3PlEKxg0ZPfVJXBJ8teo9OKsEkwb97x+He2yiBTRIx+HL/p1LUWFUIZcbm3huYMwxrimBaTEI5A2eFlOJMyBpGe0AkEbP5wJFCIlQfBbjHFVgf3UU9rYeEHWKSJdecosmJ3nIuR/4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780653986; c=relaxed/simple; bh=x6Mx/EW/MnayQyGmBtoLxhCwOIWl2EnFGvzou5bIL3k=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=PCYptveTRd+dhxOzoC86Mq1IiPfNacyd74wS9cNN9FiXEig/seUVR1RvJ5m4VxL9Ap6V17zmOcmw896Nqva4x59NJBkoDAQ52Bvto1m0NWnhrMy3SdukbiiT3aNS1v4t+oCbJjPAhxEp35/TzqV7//8KbBchPMcykpZKTLghhw0= 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=b5JWmOkp; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=dO7L8OYw; arc=none smtp.client-ip=205.220.168.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="b5JWmOkp"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="dO7L8OYw" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 655750Dn3528851 for ; Fri, 5 Jun 2026 10:06:24 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= Cm8WyObyqkNfRyMO7iz7bczR6KF/VFOYPmwAPfJalxw=; b=b5JWmOkp14IgWlcY HpfJ5cagbB0aPkpIrZJAMwxWbvT+yVC3pT1GB2h+A84TH/Id7e3t1NxtdDYlYUOV O7AL71vmtWheMVr7pOySNtYrcbTlRxKZApl6KevjsEofUxYfzhHApdPBxx9jROam 9DXKkmQvdFENxdmvZcgw96aP7S1BQDEeKFd60L+ij8AyFVGXQT5OHJdLUlxgKiai HyGQZcOm7ELnaBjpP/KkxjTXcWPoOu2hg4llRZN2ToUQRUX8ikfcGDT5lC7jZPwK V+g0MEaonk9eya+jAswFI+izXoMuCCJvE9Kr1K/0IQgwLXwOGwXLfec15WbOMY/A aa8hsA== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4eksrp8pyk-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 05 Jun 2026 10:06:23 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2bf281d523eso14306485ad.0 for ; Fri, 05 Jun 2026 03:06:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780653983; x=1781258783; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=Cm8WyObyqkNfRyMO7iz7bczR6KF/VFOYPmwAPfJalxw=; b=dO7L8OYw0TIDOlkSO0CCQq05Q88NVHkHxEjIBzZtHsIDfo9qnd7cGrA1lmVNU2vABy QwWTBHylq3ZWLNRU74pJSAMVMZ+mmYmaoGc4eNFxr7C9hicT/hkgBSRc37R0H5z9RiWz c5nNUuALJJ1UU/IF1D1A8Vn6YMjvHNkiJZOD63L9DAGqXLWKVL2c7oPW83kOezpKZB60 +m8mJfhS6OyV2KwoaWdq4yrYImYb7M75apC3uMRrr3eOSrgX311T+DovFRlxMjwzLEiG 3GyEJzyGW+zDlVuRuaMpohn75vKOSJFVpMpvN6lC+WH2tTctZaVbxG0Cx1+TBUKJi3++ rEYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780653983; x=1781258783; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from: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=Cm8WyObyqkNfRyMO7iz7bczR6KF/VFOYPmwAPfJalxw=; b=V3J4hLNUGHJ9Rk8wW8J+ne2ipRH8dsI9+97aZXjrLSPQthwEpCohi4vrrqlhBM6KJv XNe0oyqWlYfNSzcoybuIxiuRupZSwfc/mRZjeT4amP+dLWGW+i6oikPoUymADqh9dt5U Ri2Kpm9oQphFJRVF7WsxjeFj999ZacVqgFkvsDn69rtE3v9tNs7sYm6WgH1NoHWt98K+ EbTm67ZdACRCspvnPbvEGy9aXD0TmCn+wHGflwtkrfk+Re+fIo791xx7jMsLTwd2wu7W DTZzi5zi3mHJSBNZ/4gEMBjh1wO5R1vRBHNPX6f0cSuYDjAW2KXnKLQgWnxZrFFECjHM iVVA== X-Forwarded-Encrypted: i=1; AFNElJ+7VFFkxuHoxtF/7Y4QQ4pX9TxNn3P0VDE1n438Hzwcx1j6+TbGNoiS0tN2sHK6YhC3UQcgPF7ImCNGKho=@vger.kernel.org X-Gm-Message-State: AOJu0Yw+qC4RkMcE2g4wdp4u3XUyXZZOGt3uXkWdzIe3Bj8cdz0hbU2C EDYsH4yR17GJ+GOpVVtrN5VIY5K34y7ZkCCUHMSLs0+OcPA6Hqdu7ZGQBuPEau47I75QOIu5Hik cZ1kDi3vQjeyWDFHuBjjkp0Z/63OMdhXv5M8VSIJTHvCD3jWtwOuwfSSlFE50IbMB4A== X-Gm-Gg: Acq92OHqmRynVHPvJUEjZFXz8VDWzcApBTaqNmLJlTvQy2HMqmXE8DGBscQwyOlZ95l RrAhEHc94PbcqlujBA/2qAxeepk2gPWXoQNhJ9TYPit6/qgh22JmBI7Oy2WTt5x3G2TRA8nUkw4 cptQ81G2WMM5wxrC1fzI/N9Ach2SlZD2NT0zpmOE4tAfpF3s+z1jH6rHMP9k8a1KCufU71Wi9QL nwa4EwXhGr2jeO5GWkcwf0ajo7SDQQ5/bJit1+dwPwz3lfbwTbyuqkIgI8XYctgxReFGMpT4TUx HF3Cn6eiaVzwrYSNSJAYfvHj1JkvC5T6E04r1OzFxCkpsOHXjK34WuQtdbIfXs91doqOoK6sU0e XCmUd1JHoeL3zzREjagHxlSMohmKicFqoGQ8jR/iL/lclZHzrN8aOsEQM X-Received: by 2002:a17:902:e790:b0:2bd:d7c5:9272 with SMTP id d9443c01a7336-2c1e78dfad0mr30498865ad.6.1780653982970; Fri, 05 Jun 2026 03:06:22 -0700 (PDT) X-Received: by 2002:a17:902:e790:b0:2bd:d7c5:9272 with SMTP id d9443c01a7336-2c1e78dfad0mr30498265ad.6.1780653982379; Fri, 05 Jun 2026 03:06:22 -0700 (PDT) Received: from [10.217.216.18] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c16629d042sm89757565ad.60.2026.06.05.03.06.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Jun 2026 03:06:21 -0700 (PDT) Message-ID: Date: Fri, 5 Jun 2026 15:36:17 +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 From: Ram Prakash Gupta 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> <1487d620-eb28-4a66-a611-0c6dfdf1e538@oss.qualcomm.com> Content-Language: en-US In-Reply-To: <1487d620-eb28-4a66-a611-0c6dfdf1e538@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: yVfwREpLoAgJ38ZU4TcyQezwEYQqq70B X-Proofpoint-ORIG-GUID: yVfwREpLoAgJ38ZU4TcyQezwEYQqq70B X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjA1MDA5NyBTYWx0ZWRfX526F+yumoK/5 Es7UrBRfR4DjGk8mqF2EfGISWP68eAMiHrkN9f4UcovweHPRqdk+9L+MyPZRR3x6Bw0pP7HuZxS C9UME49PYRD4xQWQmaH2j6TkPexpA3o/DX7JpxAHwnaSUYwDG/QMuJEdr7e5M2D0SbrQYISa0UF dsRoBBpB8+M5rAvA0QBXkRH3E/Sz7Un28f/VWNESu59+jnWomvfvODFnStGySwMHOFhXaDGxAFB xc16iIpvwI0bXj7SIXFtMadnazIsAlj39TIvws1Vvrf00FXcI+hoesOpEetIIc0txpp+JZXiJh6 8d200o5Q7q/NkAm6llM+IZhteKmTN4waR6aTpq7Vvh4k4LmQl1TMVbrJg0hfxIQeZpfMjb5H1Do 90jE4mExBsNCR6wCqw6xg3XFapAflNq5C07Mf2OZBFZMcPKEp79MehJ+YRFQlH5xBybBHzhq8zO 3ogoEFDsf1FsuaMll6Q== X-Authority-Analysis: v=2.4 cv=bJEm5v+Z c=1 sm=1 tr=0 ts=6a229f9f cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=VwQbUJbxAAAA:8 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=eytIU0s1LhRWHgRMX8MA:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 a=cvBusfyB2V15izCimMoJ:22 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-05_01,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 spamscore=0 impostorscore=0 adultscore=0 clxscore=1015 malwarescore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606050097 On 6/4/2026 5:45 PM, Ram Prakash Gupta wrote: > > > 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. > my bad here, we wont get the print, I will add else case for log. > 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)) { >>>> >>> >> >