Skip to contentSkip to conversation

add debug log for command timeout

PATCH Applied [email protected] 3 participants 6 messages Feb 10 – Feb 28

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover add debug log for command timeout

From: Peter Wang <[email protected]>

Add some logs to make it easier to debug after a command timeout.

Changes since v1:
1. Fix typos in the cover letter and commit message title.
2. Improve log clarity.

Peter Wang (2):
ufs: core: add debug log for uic command timeout
ufs: core: add debug log for mcq command timeout

 drivers/ufs/core/ufs-mcq.c | 2 ++
 drivers/ufs/core/ufshcd.c  | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)
Signature · 1 line
2.45.2
#1 lore raw

PATCH v2 1/2 ufs: core: add debug log for uic command timeout

From: Peter Wang <[email protected]>

It is difficult to debug when a UIC command timeout occurs simultaneously with a UIC command complete interrupt. Currently, we only see the timeout log without any debug information, making it unclear whether the UFS device failed to respond or the host entered an incorrect state. Add a one-line log to cover this situation.

---
 drivers/ufs/core/ufshcd.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/ufs/core/ufshcd.c +4 -1
index 604043a7533d..ec175a099459 100644
@@ -5564,8 +5564,11 @@ static irqreturn_t ufshcd_uic_cmd_compl(struct ufs_hba *hba, u32 intr_status)
 
 	guard(spinlock_irqsave)(hba->host->host_lock);
 	cmd = hba->active_uic_cmd;
-	if (!cmd)
+	if (!cmd) {
+		dev_err(hba->dev,
+			"No active UIC command. Maybe a timeout occurred?\n");
 		return retval;
+	}
 
 	if (ufshcd_is_auto_hibern8_error(hba, intr_status))
 		hba->errors |= (UFSHCD_UIC_HIBERN8_MASK & intr_status);
Signature · 1 line
2.45.2
#2 lore raw

PATCH v2 2/2 ufs: core: add debug log for mcq command timeout

In reply to [email protected]

From: Peter Wang <[email protected]>

It is difficult to debug situations where a mcq command timeout occurs, the corresponding CQ tag response is received, but the request is not completed.
Add a one-line log to indicate when the CQ entry is abnormal.

---
 drivers/ufs/core/ufs-mcq.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/ufs/core/ufs-mcq.c +2 -0
index 9ab91b4c05b0..ad0ada57959a 100644
@@ -301,6 +301,8 @@ static void ufshcd_mcq_process_cqe(struct ufs_hba *hba,
 		ufshcd_compl_one_cqe(hba, tag, cqe);
 		/* After processed the cqe, mark it empty (invalid) entry */
 		cqe->command_desc_base_addr = 0;
+	} else {
+		dev_err(hba->dev, "Abnormal CQ entry!\n");
 	}
 }
 
Signature · 1 line
2.45.2
#5 lore raw
In reply to [email protected]
Quoted 11 lines · On Tue, 10 Feb 2026 14:41:42 +0800, [email protected] wrote:

Add some logs to make it easier to debug after a command timeout.

Changes since v1:
1. Fix typos in the cover letter and commit message title.
2. Improve log clarity.

Peter Wang (2):
ufs: core: add debug log for uic command timeout
ufs: core: add debug log for mcq command timeout

[...]

Applied to 7.1/scsi-queue, thanks!

[1/2] ufs: core: add debug log for uic command timeout

      https://git.kernel.org/mkp/scsi/c/01517654bc25
[2/2] ufs: core: add debug log for mcq command timeout
      https://git.kernel.org/mkp/scsi/c/3abe4113e784
Signature · 1 line
Martin K. Petersen