Skip to content

Commit 9c330a3

Browse files
nitinrawat123Pradeep-pvk
authored andcommitted
FROMLIST: scsi: ufs: ufs-qcom: Enable SKIP DEVICE RESET Quirk
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 5127be4 ("scsi: ufs: ufs-qcom: Fix UFS OCP issue during UFS power down (PC=3)") Link: https://lore.kernel.org/linux-scsi/20260531235011.1052706-3-nitin.rawat@oss.qualcomm.com/ Signed-off-by: Nitin Rawat <nitin.rawat@oss.qualcomm.com> Signed-off-by: Pradeep P V K <pradeep.pragallapati@oss.qualcomm.com>
1 parent ad6823e commit 9c330a3

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

drivers/ufs/host/ufs-qcom.c

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -760,9 +760,17 @@ static int ufs_qcom_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op,
760760
if (!ufs_qcom_is_link_active(hba))
761761
ufs_qcom_disable_lane_clks(host);
762762

763-
764-
/* reset the connected UFS device during power down */
765-
if (ufs_qcom_is_link_off(hba) && host->device_reset) {
763+
/*
764+
* For some UFS vendors, skip asserting device reset here.
765+
* These vendor parts keep drawing larger current after reset
766+
* is asserted until it is deasserted, and the 10ms delay is
767+
* not sufficient to prevent OCP (Over Current Protection)
768+
* on the regulator. This is for the powerdown case, so
769+
* the device reset can be asserted later as part of the
770+
* platform shutdown sequence.
771+
*/
772+
if (ufs_qcom_is_link_off(hba) && host->device_reset &&
773+
!(hba->quirks & UFSHCD_QUIRK_SKIP_DEVICE_RESET)) {
766774
ufs_qcom_device_reset_ctrl(hba, true);
767775
/*
768776
* After sending the SSU command, asserting the rst_n
@@ -1278,6 +1286,19 @@ static struct ufs_dev_quirk ufs_qcom_dev_fixups[] = {
12781286
static void ufs_qcom_fixup_dev_quirks(struct ufs_hba *hba)
12791287
{
12801288
ufshcd_fixup_dev_quirks(hba, ufs_qcom_dev_fixups);
1289+
1290+
/*
1291+
* Some UFS parts keep drawing larger current after reset is asserted
1292+
* until it is deasserted. The 10ms delay added after asserting HWRST
1293+
* (as done for other vendors) is not sufficient for these parts.
1294+
*
1295+
* Skip asserting device reset during UFS power down for these parts
1296+
* to prevent OCP (Over Current Protection) fault on the regulator.
1297+
* This is handled only in shutdown; the device reset will be asserted
1298+
* as part of the platform shutdown sequence.
1299+
*/
1300+
if (hba->dev_info.wmanufacturerid == UFS_VENDOR_MICRON)
1301+
hba->quirks |= UFSHCD_QUIRK_SKIP_DEVICE_RESET;
12811302
}
12821303

12831304
static u32 ufs_qcom_get_ufs_hci_version(struct ufs_hba *hba)

0 commit comments

Comments
 (0)