Re: [PATCH v1 2/2] scsi: ufs: core: Reduce the sleep before vcc can be powered on

From: Bao D. Nguyen
Date: Thu Oct 02 2025 - 15:02:07 EST


On 10/2/2025 12:59 AM, Peter Wang (王信友) wrote:
On Wed, 2025-10-01 at 13:57 -0700, Bao D. Nguyen wrote:

After the ufs device vcc is powered off, all the ufs device
manufacturers require a minimum of 1ms of power-off time before
vcc can be powered on again. This requirement has been verified
with all the ufs device manufacturer's datasheets.
Improve the system resume latency by reducing the required power-off
time from 5ms to 2ms. The chosen 2ms should include enough
additional buffer time without being wasteful.

Signed-off-by: Bao D. Nguyen <quic_nguyenb@xxxxxxxxxxx>
---
 drivers/ufs/core/ufshcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 45e509b..83bd731 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -9741,7 +9741,7 @@ static void ufshcd_vreg_set_lpm(struct ufs_hba
*hba)
         * All UFS devices require delay after VCC power rail is
turned-off.
         */
        if (vcc_off && hba->vreg_info.vcc)
-               usleep_range(5000, 5100);
+               usleep_range(2000, 2100);

Hi Bao,

This delay should be compatible with legacy devices.
The initial value was set to 5ms, does that mean there
is a device that actually needs 5ms?

Hi Peter,
I have discussed with the major ufs vendors (Samsung, Kioxia, Micron, and SK Hynix) via emails. They are all in agreement that 2ms is good. I did check the current device's datasheets and 1ms is what their specifications require. I admit that I may have missed some very old ufs device's datasheets. However, I take the words of the ufs vendor's engineering teams and the current device's datasheets that the 2ms is good for their devices and try to improve the potentially conservative 5ms delay parameter.

Thanks, Bao


Thanks
Peter