diff mbox series

scsi: ufs: core: increase the NOP_OUT command timeout

Message ID 20250115022344.3967-1-dh0421.hwang@samsung.com (mailing list archive)
State New
Headers show
Series scsi: ufs: core: increase the NOP_OUT command timeout | expand

Commit Message

DooHyun Hwang Jan. 15, 2025, 2:23 a.m. UTC
It is found that is UFS device may take longer than 500ms(50ms * 10times)
to respond to NOP_OUT command.

The NOP_OUT command timeout was total 500ms that is from
a timeout value of 50ms(defined by NOP_OUT_TIMEOUT)
with 10 retries(defined by NOP_OUT_RETRIES)

This change increase the NOP_OUT command timeout to total 1000ms
by changing timeout value to 100ms(NOP_OUT_TIMEOUT)

Signed-off-by: DooHyun Hwang <dh0421.hwang@samsung.com>
---
 drivers/ufs/core/ufshcd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Bart Van Assche Jan. 15, 2025, 6:12 p.m. UTC | #1
On 1/14/25 6:23 PM, DooHyun Hwang wrote:
> It is found that is UFS device may take longer than 500ms(50ms * 10times)
> to respond to NOP_OUT command.
> 
> The NOP_OUT command timeout was total 500ms that is from
> a timeout value of 50ms(defined by NOP_OUT_TIMEOUT)
> with 10 retries(defined by NOP_OUT_RETRIES)
> 
> This change increase the NOP_OUT command timeout to total 1000ms
> by changing timeout value to 100ms(NOP_OUT_TIMEOUT)
> 
> Signed-off-by: DooHyun Hwang <dh0421.hwang@samsung.com>
> ---
>   drivers/ufs/core/ufshcd.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index cd404ade48dc..bf5c4620ef6b 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -57,8 +57,8 @@ enum {
>   };
>   /* NOP OUT retries waiting for NOP IN response */
>   #define NOP_OUT_RETRIES    10
> -/* Timeout after 50 msecs if NOP OUT hangs without response */
> -#define NOP_OUT_TIMEOUT    50 /* msecs */
> +/* Timeout after 100 msecs if NOP OUT hangs without response */
> +#define NOP_OUT_TIMEOUT    100 /* msecs */
>   
>   /* Query request retries */
>   #define QUERY_REQ_RETRIES 3

The above change relies on all device management commands being issued
with the same tag. If a single NOP OUT command may take longer than
500 ms, shouldn't NOP_OUT_TIMEOUT be increased to 1000 ms instead of
100 ms? The number of NOP OUT retries seems high to me and probably can
be reduced?

Thanks,

Bart.
diff mbox series

Patch

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index cd404ade48dc..bf5c4620ef6b 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -57,8 +57,8 @@  enum {
 };
 /* NOP OUT retries waiting for NOP IN response */
 #define NOP_OUT_RETRIES    10
-/* Timeout after 50 msecs if NOP OUT hangs without response */
-#define NOP_OUT_TIMEOUT    50 /* msecs */
+/* Timeout after 100 msecs if NOP OUT hangs without response */
+#define NOP_OUT_TIMEOUT    100 /* msecs */
 
 /* Query request retries */
 #define QUERY_REQ_RETRIES 3