RE: [PATCH v6 2/2] ufs: mcq: poll OCS after sq cleanup for device management commands

From: Kiwoong Kim

Date: Thu Nov 05 2026 - 20:56:39 EST


> >> This code also waits for the interrupt handler to process the CQE.
> >> Why not reap the CQE from this function? ufshcd_clear_lu_cmds()
> >> already does that by calling ufshcd_mcq_poll_cqe_lock(hba, hwq) after
> ufshcd_clear_cmd().
> >> Calling ufshcd_mcq_poll_cqe_lock() before reading the OCS would
> >> remove the dependency on interrupt delivery and match the existing code.
> >
> > Because a successful SQ cleanup leads to OCS update, which
> > subsequently leads to raising IS.CQES when MCQ is enabled. I
> > understand your idea with ufshcd_clear_lu_cmds, then do you intend
> > Ignoring IS.CQES event in this case?
> That's not what I meant. An interrupt is generated after the status has
> been changed to OCS_ABORTED, isn't it? Has it been considered to wait for
> that interrupt instead of polling the OCS status?
>
> Thanks,
>
> Bart.

Okay, got it. From what I understand, it's a loop to call ufshcd_mcq_poll_cqe_lock and check OCS.
If I get yours wrong, please let me know.

Thanks

Kiwoong Kim
BRs.