From: Nitin Rawat <nitin.rawat@oss.qualcomm.com>
To: mani@kernel.org, James.Bottomley@HansenPartnership.com,
alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org,
martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org,
Nitin Rawat <nitin.rawat@oss.qualcomm.com>
Subject: [PATCH V1 2/2] scsi: ufs: ufs-qcom: Enable SKIP DEVICE RESET Quirk
Date: Mon, 1 Jun 2026 05:20:11 +0530 [thread overview]
Message-ID: <20260531235011.1052706-3-nitin.rawat@oss.qualcomm.com> (raw)
In-Reply-To: <20260531235011.1052706-1-nitin.rawat@oss.qualcomm.com>
A previous fix [1] addressed an OCP (Over Current Protection) issue
during UFS power down (PC=3) by adding a 10ms delay after asserting
HWRST. The delay allows the UFS device to complete its reset routine
before the power rail transitions to LPM (Low Power Mode).
However, this fix is insufficient for certain Micron UFS parts. Unlike
other vendors whose reset routine completes within ~10ms, Micron parts
continue to draw current beyond the LPM threshold for a longer duration
after reset is asserted, specifically until the reset is deasserted
(RST_N goes high). No fixed delay can reliably cover this window since
there is currently no mechanism for the host to query whether the
device reset routine has completed.
Enable the UFSHCD_QUIRK_SKIP_DEVICE_RESET quirk to skip device assert
reset during UFS power down for Micron parts. For all other vendors,
the existing behavior (assert reset + 10ms delay) is preserved.
This quirk is applicable only during shutdown. The device reset
will be asserted as part of the platform shutdown sequences.
[1] commit 5127be409c6c ("scsi: ufs: ufs-qcom: Fix UFS OCP issue during
UFS power down (PC=3)")
Signed-off-by: Nitin Rawat <nitin.rawat@oss.qualcomm.com>
---
drivers/ufs/host/ufs-qcom.c | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index 291c43448764..d0ad1e47c31d 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -770,9 +770,17 @@ static int ufs_qcom_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op,
if (!ufs_qcom_is_link_active(hba))
ufs_qcom_disable_lane_clks(host);
-
- /* reset the connected UFS device during power down */
- if (ufs_qcom_is_link_off(hba) && host->device_reset) {
+ /*
+ * For some UFS vendors, skip asserting device reset here.
+ * These vendor parts keep drawing larger current after reset
+ * is asserted until it is deasserted, and the 10ms delay is
+ * not sufficient to prevent OCP (Over Current Protection)
+ * on the regulator. This is for the powerdown case, so
+ * the device reset can be asserted later as part of the
+ * platform shutdown sequence.
+ */
+ if (ufs_qcom_is_link_off(hba) && host->device_reset &&
+ !(hba->quirks & UFSHCD_QUIRK_SKIP_DEVICE_RESET)) {
ufs_qcom_device_reset_ctrl(hba, true);
/*
* After sending the SSU command, asserting the rst_n
@@ -1288,6 +1296,19 @@ static struct ufs_dev_quirk ufs_qcom_dev_fixups[] = {
static void ufs_qcom_fixup_dev_quirks(struct ufs_hba *hba)
{
ufshcd_fixup_dev_quirks(hba, ufs_qcom_dev_fixups);
+
+ /*
+ * Some UFS parts keep drawing larger current after reset is asserted
+ * until it is deasserted. The 10ms delay added after asserting HWRST
+ * (as done for other vendors) is not sufficient for these parts.
+ *
+ * Skip asserting device reset during UFS power down for these parts
+ * to prevent OCP (Over Current Protection) fault on the regulator.
+ * This is handled only in shutdown; the device reset will be asserted
+ * as part of the platform shutdown sequence.
+ */
+ if (hba->dev_info.wmanufacturerid == UFS_VENDOR_MICRON)
+ hba->quirks |= UFSHCD_QUIRK_SKIP_DEVICE_RESET;
}
static u32 ufs_qcom_get_ufs_hci_version(struct ufs_hba *hba)
--
2.34.1
next prev parent reply other threads:[~2026-05-31 23:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-31 23:50 [PATCH V1 0/2] scsi: ufs: ufs-qcom: Fix OCP issue during powerdown Nitin Rawat
2026-05-31 23:50 ` [PATCH V1 1/2] scsi: ufs: core: Add UFSHCD_QUIRK_SKIP_DEVICE_RESET quirk Nitin Rawat
2026-06-08 9:33 ` Konrad Dybcio
2026-05-31 23:50 ` Nitin Rawat [this message]
2026-06-01 16:17 ` [PATCH V1 2/2] scsi: ufs: ufs-qcom: Enable SKIP DEVICE RESET Quirk Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260531235011.1052706-3-nitin.rawat@oss.qualcomm.com \
--to=nitin.rawat@oss.qualcomm.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=bvanassche@acm.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®