Skip to contentSkip to conversation

scsi: ufs: core: Increase the UIC command timeout further

PATCH Applied Bart Van Assche 3 participants 3 messages May 8, 2025 – May 13, 2025

Subsystems (2)
lore
Share & tools
lore

Bart Van Assche

author reviewer
#0 lore raw

PATCH 1/1 scsi: ufs: core: Increase the UIC command timeout further

On my development board I observed that it can take a little longer than two seconds before UIC completions are processed if the UART is enabled. Hence this patch that increases the UIC command timeout upper limit further.

---
 drivers/ufs/core/ufshcd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ufs/core/ufshcd.c +2 -2
index 2d39924a32b0..b18ba17c22ff 100644
@@ -54,7 +54,7 @@
 /* UIC command timeout, unit: ms */
 enum {
 	UIC_CMD_TIMEOUT_DEFAULT	= 500,
-	UIC_CMD_TIMEOUT_MAX	= 2000,
+	UIC_CMD_TIMEOUT_MAX	= 5000,
 };
 /* NOP OUT retries waiting for NOP IN response */
 #define NOP_OUT_RETRIES    10
@@ -134,7 +134,7 @@ static const struct kernel_param_ops uic_cmd_timeout_ops = {
 
 module_param_cb(uic_cmd_timeout, &uic_cmd_timeout_ops, &uic_cmd_timeout, 0644);
 MODULE_PARM_DESC(uic_cmd_timeout,
-		 "UFS UIC command timeout in milliseconds. Defaults to 500ms. Supported values range from 500ms to 2 seconds inclusively");
+		 "UFS UIC command timeout in milliseconds. Defaults to 500ms. Supported values range from 500ms to 5 seconds inclusively");
 
 #define ufshcd_toggle_vreg(_dev, _vreg, _on)				\
 	({                                                              \
Reviewed-by on v1 1/1
#1 lore raw
Quoted 43 lines · Bart Van Assche

External email : Please do not click links or open attachments until you have verified the sender or the content.

On my development board I observed that it can take a little longer than
two seconds before UIC completions are processed if the UART is enabled.
Hence this patch that increases the UIC command timeout upper limit further.

---
 drivers/ufs/core/ufshcd.c | 4 ++--

 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ufs/core/ufshcd.c +1 -2
index 2d39924a32b0..b18ba17c22ff 100644
@@ -54,7 +54,7 @@
  /* UIC command timeout, unit: ms */
  enum {
         UIC_CMD_TIMEOUT_DEFAULT = 500,
-       UIC_CMD_TIMEOUT_MAX     = 2000,
+       UIC_CMD_TIMEOUT_MAX     = 5000,
  };
  /* NOP OUT retries waiting for NOP IN response */
  #define NOP_OUT_RETRIES    10
@@ -134,7 +134,7 @@ static const struct kernel_param_ops
 uic_cmd_timeout_ops = {
 
  module_param_cb(uic_cmd_timeout, &uic_cmd_timeout_ops,
 &uic_cmd_timeout, 0644);
  MODULE_PARM_DESC(uic_cmd_timeout,
-                "UFS UIC command timeout in milliseconds. Defaults

to 500ms. Supported values range from 500ms to 2 seconds inclusively");
+                "UFS UIC command timeout in milliseconds. Defaults to 500ms. Supported values range from 500ms to 5 seconds inclusively");

Quoted 4 lines

 #define ufshcd_toggle_vreg(_dev, _vreg,
_on)                           \

({                                                              \

#2 lore raw
In reply to Bart Van Assche

Bart,

Quoted 4 lines

On my development board I observed that it can take a little longer than two seconds before UIC completions are processed if the UART is enabled. Hence this patch that increases the UIC command timeout upper limit further.

Applied to 6.16/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen