Re: [PATCH v2 2/2] scsi: ufs: core: Replace hard coded vcc-off delay with a variable
From: Peter Wang (王信友)
Date: Sun Oct 12 2025 - 23:58:44 EST
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?
> 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.
Thanks
Peter