Re: [PATCH v2 2/2] scsi: ufs: core: Replace hard coded vcc-off delay with a variable
From: Bao D. Nguyen
Date: Mon Oct 13 2025 - 15:35:19 EST
On 10/12/2025 8:58 PM, Peter Wang (王信友) wrote:
On Thu, 2025-10-09 at 13:10 -0700, Bao D. Nguyen wrote:
+ /*
+ * Most ufs devices require 1ms delay after vcc is powered
off before
+ * it can be powered on again. Set the default to 5ms. The
platform
+ * drivers can override this setting as needed.
+ */
+ hba->sleep_post_vcc_off = 5000;
+
Hi Bao,
Since 2ms is sufficient for most devices, wouldn't it make
sense to set the default value to 2ms?
Agree Peter. This was my preference as well.
init_completion(&hba->dev_cmd.complete);
err = ufshcd_hba_init(hba);
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index 1d39437..ad49979 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -1140,6 +1140,8 @@ struct ufs_hba {
int critical_health_count;
atomic_t dev_lvl_exception_count;
u64 dev_lvl_exception_id;
+
+ u32 sleep_post_vcc_off;
The name sleep_post_vcc_off might be misunderstood as a
status or a flag. I suggest changing it to a more explicit
name, such as vcc_off_delay_ms.
Sure Peter. I will make the change.
Thanks, Bao
Thanks
Peter