From nobody Fri Jul 24 05:23:54 2026 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 174E147987B for ; Thu, 23 Jul 2026 12:47:58 +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=1784810880; cv=none; b=g7jsBb+YfMetsuD5Jmb3ZJtL81eN1hmuXIzbfixv1Pm5bzzubT6BrwhQXUJuBI/dkTbeBUXpw+p1Qt/IUSqbEwMYstppYokPDKW1mC24TTtrQdYcS0DhI+CQYLBGHiO1IeynxlFuxjHfzR8TJ47MFFIgCkRdP7hba8df9VgP6M0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784810880; c=relaxed/simple; bh=/OOWqM+/ChEU9d8362G66BOwQk9kGeX/ndon4wIIahQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kilzbFY8QbHMaKTed0yiDFFEks1moBbe9TX5m2Dd/jF/3h3WXUbKW+dz1rd1jCgc9yfLmcPLNPIga6HzhYfpZ3ICxdWbyVQvnvBbMyer3g0QXO6lvPDlMnpXBXdqouRcxBv9+m6s65IdEX6/8LbXoMJH3ifSV+S0aMRs/38JMGY= 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=ZVFISBcO; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=f5EG9ZUY; 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="ZVFISBcO"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="f5EG9ZUY" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66N9DkCW3567628 for ; Thu, 23 Jul 2026 12:47:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=TxDUiGp8SHaAPcdouNgR23yANnHbyiCldl9 AoUt6zEI=; b=ZVFISBcOEB6VCAVDLMRI3ohYazPQ6fjJbMy69rfg1wQrpGaqIhg HdAAofDt1I+GqKrtdCD1JhdfYfIuLkD0+VGqncoOyA0goQo/Aeb6wzi/1wWkwVBW Zr7La5jnytK2WzMt2AvNruMd8ZLkQ2NfNn4D9e+yWtO2pa6+6nOmcS7KaQte6iuo LavT4d40zp3zbJzGF7Jl5O3tVh9UZeAFb7yQnNdzN+dy3QaBT0I1v5T2bsglYGSX cnWGCZY2/vbyfXMM8CHXwRjWWTnRclTTwCKD3xPB1ByukdVyiknWgC191UT2s92w auaOI30HTBptaMfGOxhDsI7radPXLiLaZ9Q== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fkg520tb0-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 23 Jul 2026 12:47:57 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-c860544c077so1550563a12.3 for ; Thu, 23 Jul 2026 05:47:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784810873; x=1785415673; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=TxDUiGp8SHaAPcdouNgR23yANnHbyiCldl9AoUt6zEI=; b=f5EG9ZUYK418qxhxRUTWRuVWJ9J7Ajcg+bJMllyAQa4qwuh40vWYPZTqe4bT4b1Lu+ S0qEupmL+q+zsLRqGjp6vAtVft5EehUW6r6l9G4jv2t80sHjGyErt0hMkHuLMo/L3IHg PuZkq5vJzcniMD0GmLppJx0pHVnAP5mR5OFnF9ZwuKLzOOmNnJJvNz3yLceVSpZZIswn 475yVuGv7hpfst9df87kAOHIJAPwBq1+26GnNiwy6NVSDXSDzeraDaDOVoiIJiD/j6Nj nVpviwuH/QkwYm/gJIBFXgfXUKGUdd3A9zde0gyZi2t+dPvTVEim4o/EH/m8xXk+04JU cKHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784810873; x=1785415673; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=TxDUiGp8SHaAPcdouNgR23yANnHbyiCldl9AoUt6zEI=; b=cS2Tsu8/58k5PO7OUuA+oXTsaVk5WrcxHiLQgJydgaiYTppj2KY3fga1c9Wjfweikm sGrBWmaY+XnOqKZod9dDMsu3hHOQtdpMdJFCrXuJr+YbQgNOL8T2IJFXj8hBeueMVq3R Psp8xsFpgBSVk8kH0+KP2nBUTxkEYS52i4mTGdPPi8bkUEXOu1l2m0IKqHyzoi7A7ded nLkKyzB3BF2Swimjh0nXTwWRlluJM8RNhbY4d2JoFCTF4DlrY4TNf3qbqz2XlKvUArQ1 7GUstsgIZtJF9qEhjjvEjsgqI7XRqKiHueNcBR1ydZz1gCTJdRO2nHloNqINs6M26K+a 0iTg== X-Forwarded-Encrypted: i=1; AHgh+RpqEdDCDIf8zVDZJsSUOfMqACKJwtFC9aH0QO/JvPlsdV+d/gufcX+CP6jlWKHr6iTLK1VmQnaTW6lIq2w=@vger.kernel.org X-Gm-Message-State: AOJu0Yy9I3w3X6ODr0mnHcRxK2sQiCR0kndWdc/kYEkn9FLsOa0WOyv+ rahiIPxeZpUW1Cj3Hv4gi5ZHKHqDo1j1n01a01WVkAEgTQpDVoo6Wx0hMviDYSu8TJU5uQgZykA qNfmfKRQz2OmI9LBUjkClTgSj1hgTVMWFE9DMzTqP7ChkXG+fuXMzCGeUgh75SLVtEXc= X-Gm-Gg: AR+sD13MBieYccNScklZfHLeRY3IogT0WLIbIXZHxidf8EWd3c3lmq++5NFv2QyB2XX r0+e1l0r4lz0GD2q/FcNYmo7lFiExmd6pYJrfYdIITJD8NtN/NAHPwecP8FB1sTaD/yXViQr0Ru K2s3sQLz1593K+OvpKS5iYvKDmJN+gCBCYhu6UyyaeZPVWiAzAL6cPyjwuT9B0w4WFmcaI3zajn 7rI2tZr/vpMXD97DRo0IRZTJywXccuPT9iAgdnSPrCnCGGZuaYtuvmWgZpIX6AejTTdKD8cLiZF ijc8lJPNr70EXo0DvB5L1Htrxu6MA/i23xwK67VT3Cz6ZGDYsJDTXcePAobx8ld24bvyAOxef+G GVLrRtXgDleMfiMSFIe3TAb9EIKIs8snPEsDwaTKmO5X1vOKJFg== X-Received: by 2002:a05:6a20:7483:b0:3b2:8685:1473 with SMTP id adf61e73a8af0-3c44afb58c5mr3374576637.7.1784810872735; Thu, 23 Jul 2026 05:47:52 -0700 (PDT) X-Received: by 2002:a05:6a20:7483:b0:3b2:8685:1473 with SMTP id adf61e73a8af0-3c44afb58c5mr3374545637.7.1784810872316; Thu, 23 Jul 2026 05:47:52 -0700 (PDT) Received: from QCOM-IvKeorbwK5.na.qualcomm.com ([120.60.139.18]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3147e1c9289sm20350504eec.29.2026.07.23.05.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2026 05:47:51 -0700 (PDT) From: Manivannan Sadhasivam To: alim.akhtar@samsung.com, avri.altman@sandisk.com, bvanassche@acm.org, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com Cc: peter.wang@mediatek.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Manivannan Sadhasivam , Shawn Guo Subject: [PATCH] Revert "scsi: ufs: core: Remove unnecessary block I/O quiesce for clock scaling" Date: Thu, 23 Jul 2026 14:47:33 +0200 Message-ID: <20260723124733.341789-1-manivannan.sadhasivam@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=DtZmPm/+ c=1 sm=1 tr=0 ts=6a620d7d cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=fabVTapF7hbH8ecADQZKXA==:17 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=KsTwQG257LBwhBlho30A:9 a=_Vgx9l1VpLgwpw_dHYaR:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIzMDEyNiBTYWx0ZWRfX1zITAYgUE405 h3GQxVjYw78UTlfvifP33tfL4t5+mrXtuJkeh14ZELaZ1DR7uGxvA7uQlg8bDh/+HiGPWrwqsTy 71mjOVm0kPivAwIgWzgm9c3Hv27ZpRc= X-Proofpoint-GUID: x7dBbz3CX3lF3kCQfXmqPO__9H82fHHU X-Proofpoint-ORIG-GUID: x7dBbz3CX3lF3kCQfXmqPO__9H82fHHU X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIzMDEyNiBTYWx0ZWRfXy+EaYWL/vrcY WNxe9L2ibP1dhRQv5QzRHEjkFY9uEP6Fm4m4T/PD7hcds4hOVU6qGkdcpp9X6Kn1tBKcrrSyJhU lbwMN6Gx2BJByRCl5wwM2hZATu+DRdITEAeUrkQ6e047J89CqyQW4CR6YiWRW1X/NJwlqN8bgUG DJtmLMxxUJK/EfTLDnA5Nk+aI5Zr90yJDWXzl9TR/9tZqin0mRH2AeXWP3kF2lWEPfI2EcHbvC/ 4JnwQAb3BaHsStdk9LAHzb+QF0X1B6nwnWrV7CXDDgh3FJYuc1/jYHBIDvhdLOC0Krb1P/k0GE3 3Xojy+MgFvs2jdEQgUbNZV6Q84wUO1K4JG3oVLrbfwlF7NEnqLvMgsj/A31lsjstRHMEadOLzhk B7R+2JXfQP+Vi559LLotRfKKpRzUvmcvjCvxSc5wS4rnDP+5MQV4l+tzFNGmPyLFQ4L0v0uptWr 7+evpR15tYvZgPOw3Pg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-23_03,2026-07-22_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015 bulkscore=0 adultscore=0 suspectscore=0 malwarescore=0 phishscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607230126 Content-Type: text/plain; charset="utf-8" This reverts commit 85b2b966285498e1b551ac85f02c79cd06c0cff0. Qcom UFS Host Controllers do not support scaling clocks when the traffic is ongoing. But the offending commit removed the block I/O quiesce in the clock scaling path, which causes below UFS failures during clock scaling: ufshcd-qcom 1d84000.ufshc: ufshcd_check_errors: saved_err 0x80 saved_uic_er= r 0x0 ufshcd-qcom 1d84000.ufshc: ufshcd_err_handler started; HBA state eh_fatal; = powered 1; shutting down 0; saved_err =3D 0x80; saved_uic_err =3D 0x0; forc= e_reset =3D 0 ufshcd-qcom 1d84000.ufshc: pwr ctrl cmd 0x2 with (MIBattribute 0x1571, mode= 0x11) completion timeout ufshcd-qcom 1d84000.ufshc: UFS Host state=3D3 ufshcd-qcom 1d84000.ufshc: 7 outstanding reqs, tasks=3D0x0 ufshcd-qcom 1d84000.ufshc: saved_err=3D0x80, saved_uic_err=3D0x0 ufshcd-qcom 1d84000.ufshc: Device power mode=3D1, UIC link state=3D1 ufshcd-qcom 1d84000.ufshc: PM in progress=3D0, sys. suspended=3D0 ufshcd-qcom 1d84000.ufshc: Auto BKOPS=3D0, Host self-block=3D0 ufshcd-qcom 1d84000.ufshc: Clk gate=3D1 ufshcd-qcom 1d84000.ufshc: last_hibern8_exit_tstamp at 196451913 us, hibern= 8_exit_cnt=3D20 ufshcd-qcom 1d84000.ufshc: error handling flags=3D0x0, req. abort count=3D0 ufshcd-qcom 1d84000.ufshc: hba->ufs_version=3D0x300, Host capabilities=3D0x= 1587031f, caps=3D0x124f ufshcd-qcom 1d84000.ufshc: quirks=3D0x0, dev. quirks=3D0x310c4 ufshcd-qcom 1d84000.ufshc: UFS dev info: SAMSUNG KLUDG4UHDB-B2D1 rev 0400 ufshcd-qcom 1d84000.ufshc: clk: core_clk, rate: 300000000 ufshcd-qcom 1d84000.ufshc: clk: core_clk_unipro, rate: 300000000 Hence, revert the commit to bring back UFS on all Qcom platforms. Reported-by: Shawn Guo Closes: https://lore.kernel.org/linux-scsi/al8YkXydXJQZrl_Y@QCOM-aGQu4IUr3Y Signed-off-by: Manivannan Sadhasivam Reviewed-by: Bart Van Assche Reviewed-by: Peter Wang Tested-by: Konrad Dybcio # SC8280XP CRD Tested-by: Shawn Guo # Qualcomm Nord SoC --- drivers/ufs/core/ufshcd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 79331c2bd38d..1a5a851d43b2 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -1445,7 +1445,7 @@ static int ufshcd_scale_gear(struct ufs_hba *hba, u32= target_gear, bool scale_up * * Return: 0 upon success; -EBUSY upon timeout. */ -static int ufshcd_clock_scaling_prepare(struct ufs_hba *hba) +static int ufshcd_clock_scaling_prepare(struct ufs_hba *hba, u64 timeout_u= s) { int ret =3D 0; /* @@ -1453,13 +1453,16 @@ static int ufshcd_clock_scaling_prepare(struct ufs_= hba *hba) * clock scaling is in progress */ mutex_lock(&hba->host->scan_mutex); + blk_mq_quiesce_tagset(&hba->host->tag_set); mutex_lock(&hba->wb_mutex); down_write(&hba->clk_scaling_lock); =20 - if (!hba->clk_scaling.is_allowed) { + if (!hba->clk_scaling.is_allowed || + ufshcd_wait_for_pending_cmds(hba, timeout_us)) { ret =3D -EBUSY; up_write(&hba->clk_scaling_lock); mutex_unlock(&hba->wb_mutex); + blk_mq_unquiesce_tagset(&hba->host->tag_set); mutex_unlock(&hba->host->scan_mutex); goto out; } @@ -1475,6 +1478,7 @@ static void ufshcd_clock_scaling_unprepare(struct ufs= _hba *hba, int err) { up_write(&hba->clk_scaling_lock); mutex_unlock(&hba->wb_mutex); + blk_mq_unquiesce_tagset(&hba->host->tag_set); mutex_unlock(&hba->host->scan_mutex); =20 /* Enable Write Booster if current gear requires it else disable it */ @@ -1502,7 +1506,7 @@ static int ufshcd_devfreq_scale(struct ufs_hba *hba, = unsigned long freq, =20 new_gear =3D ufshcd_vops_freq_to_gear_speed(hba, freq); =20 - ret =3D ufshcd_clock_scaling_prepare(hba); + ret =3D ufshcd_clock_scaling_prepare(hba, 1 * USEC_PER_SEC); if (ret) return ret; =20 --=20 2.43.0