From nobody Fri Apr 3 01:29:30 2026 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 61C88359A60 for ; Mon, 2 Mar 2026 10:49:46 +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=1772448587; cv=none; b=qSVTXA2MalibxxBGpTnhx/hkifvCoDZyvbRy6LzA33iWFs9efwh/wy+C4gLSRUftHWNp+OYAdZPCvITe6ABTbAUseR9JPbLnScGgJ8uZAQKWFI2L7X/9Xf3DNfSO+hYUMIvbEmtsiVVLoHLWkOE01oR9xqB7nKOb4zZtsI4WElw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772448587; c=relaxed/simple; bh=mfM49L/JlScpAh1lc54xaOqcbMJKZaGfYSNwP9nyX3A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=geuJax4Od/sEgthBtqOzRet2tNlPTIjz7DfQ38sPMDhowo78AhsY88tGhtAp6cok78e5esiCOwh57kRrDEEBYGkS699pqizYZkveZvVMKG1E3y3pn2hSElPoUGb6qOPSf2FPYCBm3W38dy7f7YzX/hMZxIaDq9Nj4XIZJ5MbBL8= 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=eypjoJ99; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Wu5y/lhY; 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="eypjoJ99"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Wu5y/lhY" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62285brb662344 for ; Mon, 2 Mar 2026 10:49:45 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= i0apK8FaEc2TmE79ix1tcZBYr5HjYS95uAnJxvBt9u8=; b=eypjoJ99/d3m/sQh stSQWc9+K8/8zThn+VYW3AaX5nIfxYtWBCKBsbFEzebg0hQ5zKFLRpZDUftH2Ys8 XGEZhiGXCZoNpiumxEOvDbEohmuR9t1kI+xO5JWYUYkVJ3ic/621UHPS8iTUCGH+ jNWwzFbBqwSsPj05OqV7Ok4feeL+pKvKxYPo24/WOznhDoBu0k0uQLPglaYODOvF zldvNJeEzb3HTr9RfJOZ/pUk5ycak5SJavjRHY9rWOGIG33mNdaWK1Tqu9BfDqVi gegqYEToTM5kwg2f9oG0MmSrY18+Q4QD86wZt6thapkLcKLDxDwQY2VXlhTB6P5d PPN78w== Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cn6r2rnk1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 02 Mar 2026 10:49:45 +0000 (GMT) Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-c70f2120583so2492249a12.3 for ; Mon, 02 Mar 2026 02:49:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1772448585; x=1773053385; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=i0apK8FaEc2TmE79ix1tcZBYr5HjYS95uAnJxvBt9u8=; b=Wu5y/lhYUipP1mT3fvSQj2EocdO7r65lGzNIVoISxIKgx8LRWLVX+M6ZSFBKcLjQ8n ykY1E8E8Q5X90jcSfGPejeHrY8n+Ix7OG85G/O52UNw0l7hmK+146mPxFAkFHBWY6Z4h hJHgH3x0PEQiHc4ordeOr7U79k9G9gD8ezsN+wdfX6s9uauSd4Vvp6D4tenizopuGJKQ 6toZmWDlG3wk1CGov7LgYNGEu9dtCjgMJkNg8oqNX4/3VyA39HRVK14uWmz7A8VE2Fzj JyPCbisHcWuuhKxi6zUjDsNst5C9fVbLrCnfYRb1M6Ct0CY3osJJkHF2Buvw4CYJLDjB YFJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772448585; x=1773053385; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=i0apK8FaEc2TmE79ix1tcZBYr5HjYS95uAnJxvBt9u8=; b=regcjmOvAzB7uroAebBX3ZcEHp099No33LEa69iuHKJWAFQkf9eVygVD53r/UoLCQh dBLXwvqk/zfYJi+9pidyNW0r/2BKmLANm45pWclJsOL9JRk/hUCIn+Xe9PUFrre5kxjK 4FHt2meh/QpG0cHByH851ikc+RF9titLbYPcdRqGg0AtPSXnVC9GJLY5ejBid8knCxNr 1zkYB5s+X+aPjDR4ZhEqizIrvWiXRYnLUIAC9GzPlSw2MrJt3HH6Zlz368nNfEb7iFQZ /eVWVsAnD1LIfGgaBdsfJcEG1FquiGEXzKtQWtzni82jId4SMuV7IJAP54BQ3lw0hW8s vgYA== X-Forwarded-Encrypted: i=1; AJvYcCXbQDW/ksdcmoVQXuNQS+u6fGHgKzWmqNYSOj1lkjSsWAyVGft+BJXpX1vNteMS6fMf5dyyhqWww505ZGc=@vger.kernel.org X-Gm-Message-State: AOJu0YwhbpGuJJHrgbtyjWyrgYEhw99VylzY2tWY7lU9AvERM11yoLfm J5bHAQOr5BocZmftggwROkvnbPUCgHoMlaS/uNbfIO29hvrFSDH8w3URbZgzEbelHW0ESMWizu1 7CAuubVRBMH6q0rQSmeFM55OuDj0KN2g4YwR/hlUwdcdSFaT8sTAGJSebRlvyEZ+r/ik= X-Gm-Gg: ATEYQzzyX8AK+SKtvMtfIIagOGqeq8vhkbq2c4QyE+VES2RYQcqgmS9pd5Sxm4uaLmB 5hyjFOCR4JpkyyaJvqXEmMgyByYfV8iRottnmXlZoutWeESX7Hlkyj0yFOgej5BdwRpw/AMbzNE VJJdas3kFY4Kz/gnEMz6oIOFHLZxGPCqekoYezpBrY21ak0/irf5EqLVWeSL+ml1U+9ebZq4Seq ycAQYpYuPoWV3z48hA45xu5UXRLBAD9WXGiocDRPiUfhcOwnwqdHrGqNOqI9XrgOZKSZngTURie vnN/94BrqxqBwhziDv6JwZWSMLNqrrpib4XG1qB1WPrLxb7n0CatTBnJP3fGsxmQNzHBezFBXEL ZSxBDooXquAJTNH2VxTVNaHXHz8LwY2nF2PG6Kw5e4gTPmtu36e4eVU73Lno= X-Received: by 2002:a05:6a00:b42:b0:824:9ffc:256c with SMTP id d2e1a72fcca58-8274da07aaemr10122576b3a.43.1772448584801; Mon, 02 Mar 2026 02:49:44 -0800 (PST) X-Received: by 2002:a05:6a00:b42:b0:824:9ffc:256c with SMTP id d2e1a72fcca58-8274da07aaemr10122554b3a.43.1772448584299; Mon, 02 Mar 2026 02:49:44 -0800 (PST) Received: from hu-arakshit-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8273a054b49sm12225956b3a.53.2026.03.02.02.49.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2026 02:49:43 -0800 (PST) From: Abhinaba Rakshit Date: Mon, 02 Mar 2026 16:19:14 +0530 Subject: [PATCH v7 2/3] ufs: host: Add ICE clock scaling during UFS clock changes Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260302-enable-ufs-ice-clock-scaling-v7-2-669b96ecadd8@oss.qualcomm.com> References: <20260302-enable-ufs-ice-clock-scaling-v7-0-669b96ecadd8@oss.qualcomm.com> In-Reply-To: <20260302-enable-ufs-ice-clock-scaling-v7-0-669b96ecadd8@oss.qualcomm.com> To: Herbert Xu , "David S. Miller" , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Manivannan Sadhasivam , "James E.J. Bottomley" , "Martin K. Petersen" , Neeraj Soni Cc: linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, Abhinaba Rakshit X-Mailer: b4 0.14.2 X-Proofpoint-GUID: HQhOyJnBqbJ2QY55rOBg-0RCcys4g2K2 X-Proofpoint-ORIG-GUID: HQhOyJnBqbJ2QY55rOBg-0RCcys4g2K2 X-Authority-Analysis: v=2.4 cv=Hpp72kTS c=1 sm=1 tr=0 ts=69a56b49 cx=c_pps a=Qgeoaf8Lrialg5Z894R3/Q==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=-RVjIYUuWhs3u9hRN0oA:9 a=QEXdDO2ut3YA:10 a=x9snwWr2DeNwDh03kgHS:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzAyMDA4OSBTYWx0ZWRfX7zRNznUbQO4E 2dKr8veLy2kDoXOUrPTZFNB9QJEPtKuJauC8tXTdqBO/TkLmbXJOrv/1tWCUU84v+RVLuD/A8lz GR4uU+xt+wLXQa2+ZdgGsv1mZzzMu9vGChM/Zi3tFLx+xqNdnM58xNwf9OwBT/dutEM9GnTelIT 6WqatOWKqeGnUF4J1uZDoRayxRwrhpAbHz80eHIO1i7Si/X+CToHMfbEUkN3gCkNCGfdVopxOIi ZhFH9BaKHj7sT//n1DNXobM8os8iEeBWJCi7PVCnFsrPY2RJS0WmUxC3xW6ct7CwjLjAyDsvlMz mdARyVbh6OshFJZ8W0XofvwiRe1AgBPiPbuJe4SlDGGONz8AYJnbfBV1MfVtkHImX4q0fy0oT1D ZqSKz8A5EU4YIBXjZt0R7snqveRs4Kj6uVkCd8o8poblCJsS8Eky6FG2z/oLl8u7ou4w0gHSque 3fwluNyOuq6ZERmqV5A== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-02_03,2026-02-27_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 impostorscore=0 phishscore=0 priorityscore=1501 adultscore=0 bulkscore=0 malwarescore=0 clxscore=1015 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2603020089 Implement ICE (Inline Crypto Engine) clock scaling in sync with UFS controller clock scaling. This ensures that the ICE operates at an appropriate frequency when the UFS clocks are scaled up or down, improving performance and maintaining stability for crypto operations. For scale_up operation ensure to pass ~round_ceil (round_floor) and vice-versa for scale_down operations. Incase of OPP scaling is not supported by ICE, ensure to not prevent devfreq for UFS, as ICE OPP-table is optional. Acked-by: Manivannan Sadhasivam Signed-off-by: Abhinaba Rakshit --- drivers/ufs/host/ufs-qcom.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index 8d119b3223cbdaa3297d2beabced0962a1a847d5..776444f46fe5f00f947e4b0b4df= e6d64e2ad2150 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -305,6 +305,15 @@ static int ufs_qcom_ice_prepare_key(struct blk_crypto_= profile *profile, return qcom_ice_prepare_key(host->ice, lt_key, lt_key_size, eph_key); } =20 +static int ufs_qcom_ice_scale_clk(struct ufs_qcom_host *host, unsigned lon= g target_freq, + bool round_ceil) +{ + if (host->hba->caps & UFSHCD_CAP_CRYPTO) + return qcom_ice_scale_clk(host->ice, target_freq, round_ceil); + + return 0; +} + static const struct blk_crypto_ll_ops ufs_qcom_crypto_ops =3D { .keyslot_program =3D ufs_qcom_ice_keyslot_program, .keyslot_evict =3D ufs_qcom_ice_keyslot_evict, @@ -339,6 +348,12 @@ static void ufs_qcom_config_ice_allocator(struct ufs_q= com_host *host) { } =20 +static int ufs_qcom_ice_scale_clk(struct ufs_qcom_host *host, unsigned lon= g target_freq, + bool round_ceil) +{ + return 0; +} + #endif =20 static void ufs_qcom_disable_lane_clks(struct ufs_qcom_host *host) @@ -1646,8 +1661,10 @@ static int ufs_qcom_clk_scale_notify(struct ufs_hba = *hba, bool scale_up, else err =3D ufs_qcom_clk_scale_down_post_change(hba, target_freq); =20 + if (!err) + err =3D ufs_qcom_ice_scale_clk(host, target_freq, !scale_up); =20 - if (err) { + if (err && err !=3D -EOPNOTSUPP) { ufshcd_uic_hibern8_exit(hba); return err; } --=20 2.34.1