* [PATCH v2 0/2] add debug log for command timeout
@ 2026-02-10 6:41 peter.wang
2026-02-10 6:41 ` [PATCH v2 1/2] ufs: core: add debug log for uic " peter.wang
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: peter.wang @ 2026-02-10 6:41 UTC (permalink / raw)
To: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb
Cc: wsd_upstream, linux-mediatek, peter.wang, chun-hung.wu,
alice.chao, cc.chou, chaotian.jing, tun-yu.yu, eddie.huang,
naomi.chu, ed.tsai, bvanassche
From: Peter Wang <peter.wang@mediatek.com>
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(-)
--
2.45.2
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/2] ufs: core: add debug log for uic command timeout
2026-02-10 6:41 [PATCH v2 0/2] add debug log for command timeout peter.wang
@ 2026-02-10 6:41 ` peter.wang
2026-02-10 6:41 ` [PATCH v2 2/2] ufs: core: add debug log for mcq " peter.wang
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: peter.wang @ 2026-02-10 6:41 UTC (permalink / raw)
To: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb
Cc: wsd_upstream, linux-mediatek, peter.wang, chun-hung.wu,
alice.chao, cc.chou, chaotian.jing, tun-yu.yu, eddie.huang,
naomi.chu, ed.tsai, bvanassche
From: Peter Wang <peter.wang@mediatek.com>
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.
Signed-off-by: Peter Wang <peter.wang@mediatek.com>
---
drivers/ufs/core/ufshcd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 604043a7533d..ec175a099459 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -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);
--
2.45.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/2] ufs: core: add debug log for mcq command timeout
2026-02-10 6:41 [PATCH v2 0/2] add debug log for command timeout peter.wang
2026-02-10 6:41 ` [PATCH v2 1/2] ufs: core: add debug log for uic " peter.wang
@ 2026-02-10 6:41 ` peter.wang
2026-02-10 18:41 ` [PATCH v2 0/2] add debug log for " Bart Van Assche
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: peter.wang @ 2026-02-10 6:41 UTC (permalink / raw)
To: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb
Cc: wsd_upstream, linux-mediatek, peter.wang, chun-hung.wu,
alice.chao, cc.chou, chaotian.jing, tun-yu.yu, eddie.huang,
naomi.chu, ed.tsai, bvanassche
From: Peter Wang <peter.wang@mediatek.com>
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.
Signed-off-by: Peter Wang <peter.wang@mediatek.com>
---
drivers/ufs/core/ufs-mcq.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c
index 9ab91b4c05b0..ad0ada57959a 100644
--- a/drivers/ufs/core/ufs-mcq.c
+++ b/drivers/ufs/core/ufs-mcq.c
@@ -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");
}
}
--
2.45.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 0/2] add debug log for command timeout
2026-02-10 6:41 [PATCH v2 0/2] add debug log for command timeout peter.wang
2026-02-10 6:41 ` [PATCH v2 1/2] ufs: core: add debug log for uic " peter.wang
2026-02-10 6:41 ` [PATCH v2 2/2] ufs: core: add debug log for mcq " peter.wang
@ 2026-02-10 18:41 ` Bart Van Assche
2026-02-24 18:41 ` Martin K. Petersen
2026-02-28 22:22 ` Martin K. Petersen
4 siblings, 0 replies; 7+ messages in thread
From: Bart Van Assche @ 2026-02-10 18:41 UTC (permalink / raw)
To: peter.wang, linux-scsi, martin.petersen, avri.altman, alim.akhtar,
jejb
Cc: wsd_upstream, linux-mediatek, chun-hung.wu, alice.chao, cc.chou,
chaotian.jing, tun-yu.yu, eddie.huang, naomi.chu, ed.tsai
On 2/9/26 10:41 PM, peter.wang@mediatek.com wrote:
> Add some logs to make it easier to debug after a command timeout.
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 0/2] add debug log for command timeout
2026-02-10 6:41 [PATCH v2 0/2] add debug log for command timeout peter.wang
` (2 preceding siblings ...)
2026-02-10 18:41 ` [PATCH v2 0/2] add debug log for " Bart Van Assche
@ 2026-02-24 18:41 ` Martin K. Petersen
2026-02-28 22:22 ` Martin K. Petersen
4 siblings, 0 replies; 7+ messages in thread
From: Martin K. Petersen @ 2026-02-24 18:41 UTC (permalink / raw)
To: peter.wang
Cc: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb,
wsd_upstream, linux-mediatek, chun-hung.wu, alice.chao, cc.chou,
chaotian.jing, tun-yu.yu, eddie.huang, naomi.chu, ed.tsai,
bvanassche
> Add some logs to make it easier to debug after a command timeout.
Applied to 7.1/scsi-staging, thanks!
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 0/2] add debug log for command timeout
2026-02-10 6:41 [PATCH v2 0/2] add debug log for command timeout peter.wang
` (3 preceding siblings ...)
2026-02-24 18:41 ` Martin K. Petersen
@ 2026-02-28 22:22 ` Martin K. Petersen
2026-03-01 2:16 ` Martin K. Petersen
4 siblings, 1 reply; 7+ messages in thread
From: Martin K. Petersen @ 2026-02-28 22:22 UTC (permalink / raw)
To: linux-scsi, avri.altman, alim.akhtar, jejb, peter.wang
Cc: Martin K . Petersen, wsd_upstream, linux-mediatek, chun-hung.wu,
alice.chao, cc.chou, chaotian.jing, tun-yu.yu, eddie.huang,
naomi.chu, ed.tsai, bvanassche
On Tue, 10 Feb 2026 14:41:42 +0800, peter.wang@mediatek.com 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
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 0/2] add debug log for command timeout
2026-02-28 22:22 ` Martin K. Petersen
@ 2026-03-01 2:16 ` Martin K. Petersen
0 siblings, 0 replies; 7+ messages in thread
From: Martin K. Petersen @ 2026-03-01 2:16 UTC (permalink / raw)
To: linux-scsi, avri.altman, alim.akhtar, jejb, peter.wang
Cc: Martin K . Petersen, wsd_upstream, linux-mediatek, chun-hung.wu,
alice.chao, cc.chou, chaotian.jing, tun-yu.yu, eddie.huang,
naomi.chu, ed.tsai, bvanassche
On Tue, 10 Feb 2026 14:41:42 +0800, peter.wang@mediatek.com 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
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-03-01 2:16 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-10 6:41 [PATCH v2 0/2] add debug log for command timeout peter.wang
2026-02-10 6:41 ` [PATCH v2 1/2] ufs: core: add debug log for uic " peter.wang
2026-02-10 6:41 ` [PATCH v2 2/2] ufs: core: add debug log for mcq " peter.wang
2026-02-10 18:41 ` [PATCH v2 0/2] add debug log for " Bart Van Assche
2026-02-24 18:41 ` Martin K. Petersen
2026-02-28 22:22 ` Martin K. Petersen
2026-03-01 2:16 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox