diff mbox series

[1/2] scsi: ufs: core: Disable the reset settle delay

Message ID 20230314205822.313447-1-bvanassche@acm.org
State New
Headers show
Series [1/2] scsi: ufs: core: Disable the reset settle delay | expand

Commit Message

Bart Van Assche March 14, 2023, 8:58 p.m. UTC
Neither UFS host controllers nor UFS devices require a ten second delay
after a host reset or after a bus reset. Hence this patch.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/ufs/core/ufshcd.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Adrian Hunter March 15, 2023, 12:41 p.m. UTC | #1
On 14/03/23 22:58, Bart Van Assche wrote:
> Neither UFS host controllers nor UFS devices require a ten second delay
> after a host reset or after a bus reset. Hence this patch.
> 
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/ufs/core/ufshcd.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index 172d25fef740..ce7b765aa2af 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -8744,6 +8744,7 @@ static struct scsi_host_template ufshcd_driver_template = {
>  	.max_sectors		= (1 << 20) / SECTOR_SIZE, /* 1 MiB */
>  	.max_host_blocked	= 1,
>  	.track_queue_depth	= 1,
> +	.skip_settle_delay	= 1,
>  	.sdev_groups		= ufshcd_driver_groups,
>  	.rpm_autosuspend_delay	= RPM_AUTOSUSPEND_DELAY_MS,
>  };
Avri Altman March 15, 2023, 1:43 p.m. UTC | #2
> 
> Neither UFS host controllers nor UFS devices require a ten second delay
> after a host reset or after a bus reset. Hence this patch.
Bus reset handler is not implemented for ufs.

Thanks,
Avri

> 
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  drivers/ufs/core/ufshcd.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index 172d25fef740..ce7b765aa2af 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -8744,6 +8744,7 @@ static struct scsi_host_template
> ufshcd_driver_template = {
>         .max_sectors            = (1 << 20) / SECTOR_SIZE, /* 1 MiB */
>         .max_host_blocked       = 1,
>         .track_queue_depth      = 1,
> +       .skip_settle_delay      = 1,
>         .sdev_groups            = ufshcd_driver_groups,
>         .rpm_autosuspend_delay  = RPM_AUTOSUSPEND_DELAY_MS,
>  };
Bart Van Assche March 15, 2023, 3:53 p.m. UTC | #3
On 3/15/23 06:43, Avri Altman wrote:
>> Neither UFS host controllers nor UFS devices require a ten second delay
>> after a host reset or after a bus reset. Hence this patch.
>
> Bus reset handler is not implemented for ufs.

Hi Avri,

Do you perhaps want me to remove the reference to "bus reset" from the 
patch description?

Thanks,

Bart.
Avri Altman March 15, 2023, 10:13 p.m. UTC | #4
> On 3/15/23 06:43, Avri Altman wrote:
> >> Neither UFS host controllers nor UFS devices require a ten second delay
> >> after a host reset or after a bus reset. Hence this patch.
> >
> > Bus reset handler is not implemented for ufs.
> 
> Hi Avri,
> 
> Do you perhaps want me to remove the reference to "bus reset" from the
> patch description?
Yes - this what I meant.

But aren’t we calling now scsi_report_bus_reset too soon?

Thanks,
Avri 

> 
> Thanks,
> 
> Bart.
Bart Van Assche March 16, 2023, 12:01 a.m. UTC | #5
On 3/15/23 15:13, Avri Altman wrote:
> But aren’t we calling now scsi_report_bus_reset too soon?

Hi Avri,

I think that calling scsi_report_bus_reset() immediately after a host 
reset has finished is fine. My understanding is that the purpose of the 
reset settle delay is to prevent that commands get submitted to a SCSI 
device while it is not responsive. I'm not aware of a need to wait after 
a host reset has been submitted to a UFS device?

Thanks,

Bart.
Avri Altman March 16, 2023, 6:14 a.m. UTC | #6
> On 3/15/23 15:13, Avri Altman wrote:
> > But aren’t we calling now scsi_report_bus_reset too soon?
> 
> Hi Avri,
> 
> I think that calling scsi_report_bus_reset() immediately after a host reset has
> finished is fine. My understanding is that the purpose of the reset settle delay
> is to prevent that commands get submitted to a SCSI device while it is not
> responsive. I'm not aware of a need to wait after a host reset has been
> submitted to a UFS device?
OK. Thanks.

Avri

> 
> Thanks,
> 
> Bart.
Martin K. Petersen March 17, 2023, 3:11 a.m. UTC | #7
Bart,

> Neither UFS host controllers nor UFS devices require a ten second delay
> after a host reset or after a bus reset. Hence this patch.

Applied to 6.4/scsi-staging, thanks!
Martin K. Petersen March 24, 2023, 9:06 p.m. UTC | #8
On Tue, 14 Mar 2023 13:58:12 -0700, Bart Van Assche wrote:

> Neither UFS host controllers nor UFS devices require a ten second delay
> after a host reset or after a bus reset. Hence this patch.
> 
> 

Applied to 6.4/scsi-queue, thanks!

[1/2] scsi: ufs: core: Disable the reset settle delay
      https://git.kernel.org/mkp/scsi/c/fb5ea4f5202b
diff mbox series

Patch

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 172d25fef740..ce7b765aa2af 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -8744,6 +8744,7 @@  static struct scsi_host_template ufshcd_driver_template = {
 	.max_sectors		= (1 << 20) / SECTOR_SIZE, /* 1 MiB */
 	.max_host_blocked	= 1,
 	.track_queue_depth	= 1,
+	.skip_settle_delay	= 1,
 	.sdev_groups		= ufshcd_driver_groups,
 	.rpm_autosuspend_delay	= RPM_AUTOSUSPEND_DELAY_MS,
 };