]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: ufs: core: Support dumping CQ entry in MCQ Mode
authorPeter Wang <peter.wang@mediatek.com>
Thu, 16 Oct 2025 02:32:32 +0000 (10:32 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 22 Oct 2025 01:16:04 +0000 (21:16 -0400)
Enhance the ufshcd_print_tr() function to support dumping completion
queue (CQ) entries in MCQ mode when an error occurs.  This addition
provides more detailed debugging information by including the CQ entry
data in the error logs, aiding in the diagnosis of issues in MCQ mode.

Signed-off-by: Peter Wang <peter.wang@mediatek.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20251016023507.1000664-3-peter.wang@mediatek.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufshcd.c

index 864b2c490feba40b80ee5eeb0ae20acfb5a89ae2..22504eb2cd37f89e8ad1058f9d723b1562dbfe43 100644 (file)
@@ -5538,8 +5538,11 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp,
        } /* end of switch */
 
        if ((host_byte(result) != DID_OK) &&
-           (host_byte(result) != DID_REQUEUE) && !hba->silence_err_logs)
+           (host_byte(result) != DID_REQUEUE) && !hba->silence_err_logs) {
+               if (cqe)
+                       ufshcd_hex_dump("UPIU CQE: ", cqe, sizeof(struct cq_entry));
                ufshcd_print_tr(hba, lrbp->task_tag, true);
+       }
        return result;
 }