]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: ufs: core: Add a comment block above ufshcd_mcq_compl_all_cqes_lock()
authorBart Van Assche <bvanassche@acm.org>
Wed, 1 Apr 2026 20:24:59 +0000 (13:24 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 3 Apr 2026 01:26:44 +0000 (21:26 -0400)
Document the aspects of ufshcd_mcq_compl_all_cqes_lock() that are
nontrivial in a comment block above this function.

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

index 1b3062577945851a88a49c1355d510319523073f..c1b1d67a1ddc0493686101668d35e3441c68ff65 100644 (file)
@@ -322,6 +322,14 @@ static void ufshcd_mcq_process_cqe(struct ufs_hba *hba,
        }
 }
 
+/*
+ * This function is called from the UFS error handler with the UFS host
+ * controller disabled (HCE = 0). Reading host controller registers, e.g. the
+ * CQ tail pointer (CQTPy), may not be safe with the host controller disabled.
+ * Hence, iterate over all completion queue entries. This won't result in
+ * double completions because ufshcd_mcq_process_cqe() clears a CQE after it
+ * has been processed.
+ */
 void ufshcd_mcq_compl_all_cqes_lock(struct ufs_hba *hba,
                                    struct ufs_hw_queue *hwq)
 {