add debug log for commnad timoeut
Subsystems (3)
cover add debug log for commnad timoeut
From: Peter Wang <[email protected]>
Add some logs to make it easier to debug after a command timeout.
Peter Wang (2):
ufs: core: add debug log for uic commnad timoeut
ufs: core: add debug log for mcq commnad timoeut
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
PATCH 1/2 ufs: core: add debug log for uic commnad timoeut
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
@@ -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_cmd, may timeout and be cleared.\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
Bart Van Assche
reviewerRe: [PATCH v1 1/2] ufs: core: add debug log for uic commnad timoeut
Quoted 1 line · On 2/9/26 12:28 AM, [email protected] wrote:
[ ... ]
Please change "commnad" into "command" in the cover letter of this patch series and also in the subject of this patch.
drivers/ufs/core/ufshcd.c static irqreturn_t ufshcd_uic_cmd_compl(struct ufs_hba *hba, u32 intr_status) · line 5571
Quoted 5 lines
drivers/ufs/core/ufshcd.c +4
-0+if (!cmd) { +dev_err (hba->dev, +"No active_uic_cmd, may timeout and be cleared.\n" );return retval; + }
The new message is incomprehensible to me. Please make it more clear. Is this perhaps what you want to be reported?
"No active UIC command. Maybe a timeout occurred?"
Thanks,
Bart.
Re: [PATCH v1 1/2] ufs: core: add debug log for uic commnad timoeut
Quoted 6 lines · Bart Van Assche
On 2/9/26 12:28 AM, [email protected] wrote:
> [ ... ]Please change "commnad" into "command" in the cover letter of this patch
series and also in the subject of this patch.
Thank you. I will correct this typo.
Quoted 12 lines
Quoted 7 lines
+ if (!cmd) {
+ dev_err(hba->dev,
+ "Noactive_uic_cmd, may timeout and be cleared.\n");
return retval;
+ }The new message is incomprehensible to me. Please make it more clear. Is
this perhaps what you want to be reported?
Quoted 5 lines
"No active UIC command. Maybe a timeout occurred?"
Thanks,
Bart.
Yes, this is what I mean.
If this log is followed by a timeout log, we can be sure it was cleared by the timeout.
If not, then something might be wrong.
Thanks.
Peter
PATCH 2/2 ufs: core: add debug log for mcq commnad timoeut
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
@@ -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