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 1/2] scsi: ufs: core: Add UFSHCD_QUIRK_SKIP_DEVICE_RESET quirk
Date: Mon, 1 Jun 2026 05:20:10 +0530 [thread overview]
Message-ID: <20260531235011.1052706-2-nitin.rawat@oss.qualcomm.com> (raw)
In-Reply-To: <20260531235011.1052706-1-nitin.rawat@oss.qualcomm.com>
Add a new host quirk UFSHCD_QUIRK_SKIP_DEVICE_RESET to allow host
controller drivers to skip asserting device reset during UFS power
down.
When RST_N is asserted, the UFS device firmware wakes up and executes
its internal reset routine. This routine initializes multiple hardware
blocks and causing the device to draw a large curreny during this time.
If the power rail transitions to LPM (Low Power Mode) while the device
is still drawing this elevated current, it may trigger an
OCP (Over Current Protection) fault in the regulator.
For some UFS devices (e.g., Micron), the elevated current draw persists
until the reset line is deasserted, making a fixed delay insufficient
to prevent OCP. This quirk allows such devices to skip device reset
during UFS power down. The device reset will instead be asserted as
part of the platform shutdown sequence.
Signed-off-by: Nitin Rawat <nitin.rawat@oss.qualcomm.com>
---
include/ufs/ufshcd.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index 3eaae082329c..18d634499ce5 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -813,6 +813,20 @@ enum ufshcd_quirks {
* allowed by M-PHY spec ver 6.0.
*/
UFSHCD_QUIRK_EXTENDED_TX_EQTR_ADAPT_LENGTH_L0L1L2L3 = 1 << 28,
+
+ /*
+ * Some UFS devices keep drawing larger current after reset is
+ * asserted until it is deasserted. Asserting device reset
+ * during UFS power down causes the device firmware to wake up and
+ * execute its reset routine, drawing current beyond the permissible
+ * limit for low-power mode (LPM). This may trigger an OCP fault on
+ * the regulator supplying power to UFS.
+ *
+ * Enable this quirk to skip asserting device reset during UFS power
+ * down. This is handled only in shutdown; the device reset will be
+ * asserted as part of the platform shutdown sequence.
+ */
+ UFSHCD_QUIRK_SKIP_DEVICE_RESET = 1 << 29,
};
enum ufshcd_caps {
--
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 ` Nitin Rawat [this message]
2026-06-08 9:33 ` [PATCH V1 1/2] scsi: ufs: core: Add UFSHCD_QUIRK_SKIP_DEVICE_RESET quirk Konrad Dybcio
2026-05-31 23:50 ` [PATCH V1 2/2] scsi: ufs: ufs-qcom: Enable SKIP DEVICE RESET Quirk Nitin Rawat
2026-06-01 16:17 ` 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-2-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®