From nobody Tue Dec 2 01:48:33 2025 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 AC8BC345733 for ; Fri, 21 Nov 2025 10:36:34 +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=1763721396; cv=none; b=AUsa/FPilSyQwy23u6QMiXm+iRg572UDzZ9ScP4VXjemHM+mCQ0HlOcxCD9eGBJUK+2gFctRvjSTv1NrZYN3+1uMnNJ+duipsgBruTgrO9GEa5lCNTAdvX4YuvOKqh088q0U2Q/EJrzvNSdd0yfT+EiS2F9ULCVdt3AQERL6pi4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763721396; c=relaxed/simple; bh=42Oia7LlBi+H523Rmn2IIOy7T1zt6E32yOR956DWeLM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Yq0wkpYQ+RUUtHOaWr3UAC1WjizataGVY/txIChcmMrJR3JGgNNlVIH8n+O44IrrIKF8vfqkjBRWVswHb5UflelK9QpP0cfshAxbUtej+P25ZpR83AKc3mrB/j1pSgPsv3EZnVue7RBUcFCSkt5eNSBuG/MZ/d67NS9QUoIK6FY= 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=I4V2CI6t; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=KwoC9oj1; 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="I4V2CI6t"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="KwoC9oj1" 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 5ALAPamY2746815 for ; Fri, 21 Nov 2025 10:36:33 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= CAqEF9ipkGXaLh8o6lQtStQbpT65DW2PvBWxy9J0Ebs=; b=I4V2CI6tH46zktrr AMctmO70+V+tncBeTPb2fYgTUGa9SDDjafYAW15/DncqXiuxaWDnY+Bev2a6t1a5 Ug/lX2b8L8xdRskXKq0pE8Xy0AXl+hsUJfaPSLqVqAjeTRPEBlgsrZQYtpPZX2mf FS9axJ3tTuBdNfhAEpKQvCksSTOAt8SM0k7knAL/1i+F5/3Gm57FT06hiV+VLTYS Eo6iHFei9NueZtgl3oPcSvvmWI81zb6PoHOGZYOhDUJ2UW8YPwIRDzvjwXkFu+nP 5i/CNIQYm8OLrxM1Wg567DVTpLcPyTYkPipXMEOflRIvXgxLnTLQGLpx9MZkp0MN tQc/og== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ajgeh1aqt-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 21 Nov 2025 10:36:33 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-298389232c4so48782785ad.2 for ; Fri, 21 Nov 2025 02:36:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1763721392; x=1764326192; 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=CAqEF9ipkGXaLh8o6lQtStQbpT65DW2PvBWxy9J0Ebs=; b=KwoC9oj1WK3O+Q8Ei3N987P8iw5Jhxodjsdd/XbWWCp8EswgPy+wC7zltCz5l4ZMPg q36pWEZmaNw0aZkGEBCuseX2K9kqIh3tPU1vRItr7IMJ0EAuR+6uvqwtga3hLPj+H0eq FQ7v8oEHW/UQKAh2RdKBbsYTjgqNqJLSxTfhDcb9E24RnjMjK9eNleCIXZBK3hucnxZ5 /2AbdQHcNOriijwliPV3JEmn7ME9n81+aklJSHQRZQ8mKuLY63MgJfvwDIhDlsBOqw5d 2XECAhFDPcjZ6Om9x8QqCZt0jWSA7QlZnySKNg3/s5jnHwt6N0i4GTuiUAWSAFoHDUZS kNRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763721392; x=1764326192; 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=CAqEF9ipkGXaLh8o6lQtStQbpT65DW2PvBWxy9J0Ebs=; b=wxFu/3dC8M/JHNztY69iR21oOOj2UMd2rPJ890i5LMKXN72e0/3B4Noy8bV56z7fLv aC/xQMI0DRuUtza+GEWEkgmWl8ixLJrlavgFdIHyvdQ8FB75jv1NsA1rf5Kz+ILIwDSA LjO2zbHNx4gKKE35Svk63WUym8bbrI0OZ94n6UKh/Gf9zg7bpBztyLrD17R4SgLKBH+H Xjjzrr29/JOyo4jTPDVaQIJ84UOsj0COQvgLuUpurZ3GeviBM7ixMzCyul4OOdMsgv7N KcBLqkkOoGTInZ9ZPR7hlBC6MH7DaDCzbHe+WuE3RhrldPeanxKYj6PfBc6i05aDI56a jeBg== X-Forwarded-Encrypted: i=1; AJvYcCVwas5SU3cnReTkoypGDJhQYT3CXB5uf8HnweBPxvwaeBftxlWfqi+eq/EtICDzoU51UdiJVqaOaICDZcE=@vger.kernel.org X-Gm-Message-State: AOJu0Yw7Qqb6qOYHDhAZS8Xm1Y9jNqSaxJK9ucft7StIzzgW/2bQNmXA LT2lmX49pcZgHkx7WBt+59tEKp2ROPK5nzXnziz+Rw/wDgCtl6G7HbaPz0RCbLx7nzeyF5vFBNV rXRovSotTxP05QdYKwLPK/LKlWXrjDMvslwz3SFdljlhJ1kdCYwwAVRiVjYCgQInpEX8ZRG1MJr w= X-Gm-Gg: ASbGnctKIcn2SaFd1/snsn4Rms8tXj+pxtt7AF8Nn5irlTv0TsZEB/s//XN7pTCXHmb aEYG1PRGfcFyBhS9ZqnaFrjHDfDfnvWn/N4SUWPGUxKMyu78zLcZpQk8yfQ+CKtWQl3Fyy+HKFD 8y1x4T1jEId6PkywKOeO/pJBo1mIZoe0NJDLnZ86LHOTyKkV9DN2xOeXxhHgF/ELSkTau6xhKYa gt+478Fc3A2PS2/QvR/8wsy8TAJ41xhpL/LzbiQk3xfQXYRSRFqKNcKfRqteA54uITD9gSXm0Pt LOfMEw+oXSVfpvwWcNIFh4AzS3yzmMZIiEX+bduqynS6FLC/9JTtYNcdtmXBz1JVKOUxPlZ0ODF CJuEEPW4D8AX+uWW8fP5sbfdH+yZ0/VdlYqMiPv8SIs0+pVI= X-Received: by 2002:a17:903:17c3:b0:295:275d:21d8 with SMTP id d9443c01a7336-29b6c0b7a66mr27378935ad.0.1763721392277; Fri, 21 Nov 2025 02:36:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzI2I3tYOltXt6IQ+cQ7O0lEpR29UhlkbO4Q4v1RIxYR2odAeCBqzRY1eNhIS9gX6eXHxi9A== X-Received: by 2002:a17:903:17c3:b0:295:275d:21d8 with SMTP id d9443c01a7336-29b6c0b7a66mr27378655ad.0.1763721391829; Fri, 21 Nov 2025 02:36:31 -0800 (PST) Received: from hu-arakshit-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-34727be2fa7sm5122890a91.6.2025.11.21.02.36.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 02:36:31 -0800 (PST) From: Abhinaba Rakshit Date: Fri, 21 Nov 2025 16:06:05 +0530 Subject: [PATCH v2 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: <20251121-enable-ufs-ice-clock-scaling-v2-2-66cb72998041@oss.qualcomm.com> References: <20251121-enable-ufs-ice-clock-scaling-v2-0-66cb72998041@oss.qualcomm.com> In-Reply-To: <20251121-enable-ufs-ice-clock-scaling-v2-0-66cb72998041@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Manivannan Sadhasivam , "James E.J. Bottomley" , "Martin K. Petersen" , Neeraj Soni Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, Abhinaba Rakshit X-Mailer: b4 0.14.2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTIxMDA4MSBTYWx0ZWRfXxKLz8FfY45lK H+0zxvXrx7I3IVmydjPEwJ4w95F/t6+D3tRjbQSFyvQFjYTah6lWBWdYE0rsCjDMrn2LhvUAAYg 9yKt9uwPPpZ0K8jQYqScj9ZTida1Rsipr4FLlG46PpYtuxTKy5ssBcXPAox8Y/X/XxT+wx6pnWr VnuI4lm6Ngkq3/iwb2qwt2UNHARQ8EZ5PXqrWa486QDVeIoT9D+YW1nG05DHd8oK74wIysuSRJb fYQvbKrPhn3QCeubE8J81QOj33OrPMXdowrWT4WYOpyX62Cjpk3DQWRNY5mDWmKJ883U71CbiD0 WDMFxtCQcdETEsxN/XCU+vMmOfLcFGUD6FKDxCgWUqMAoHVFMWOIwPiF8X4P0i/ndZGW/UohtY6 SfaRC9cLilo/cDfEqC936NBvgTafuQ== X-Proofpoint-GUID: LLYU48Eay62G6E7QFfJRY3xiYAzJTcd_ X-Authority-Analysis: v=2.4 cv=AubjHe9P c=1 sm=1 tr=0 ts=692040b1 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=lzHOrk3F_0XHYG_XrgYA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-ORIG-GUID: LLYU48Eay62G6E7QFfJRY3xiYAzJTcd_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-21_03,2025-11-20_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 spamscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511210081 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. Signed-off-by: Abhinaba Rakshit --- drivers/ufs/host/ufs-qcom.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index 8d119b3223cbdaa3297d2beabced0962a1a847d5..a60b60eb777a674fb4345fd393b= de0eab3571a23 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -305,6 +305,14 @@ 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, bool scale_u= p) +{ + if (host->hba->caps & UFSHCD_CAP_CRYPTO) + return qcom_ice_scale_clk(host->ice, scale_up); + + 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 +347,11 @@ 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, bool scale_u= p) +{ + return 0; +} + #endif =20 static void ufs_qcom_disable_lane_clks(struct ufs_qcom_host *host) @@ -1646,6 +1659,8 @@ 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, scale_up); =20 if (err) { ufshcd_uic_hibern8_exit(hba); --=20 2.34.1