Re: [PATCH v2 2/2] scsi: ufs: core: Decouple CQ sweep from request iterator in MCQ
From: Peter Wang (王信友)
Date: Wed Sep 30 2026 - 03:38:15 EST
On Fri, 2026-09-25 at 10:26 -0700, Bart Van Assche wrote:
> A correction: the INIT_LIST_HEAD(&cmd->eh_entry) statement is not
> reached while SCSI host recovery is in progress because
> SCMD_STATE_COMPLETE is set for all pending commands before the SCSI
> host recovery starts. scsi_done() skips SCSI commands for which that
> bit is set due to the following code:
>
> if (unlikely(test_and_set_bit(SCMD_STATE_COMPLETE, &cmd-
> >state)))
> return;
>
> Hence, the scmd->result value is ignored if scsi_done() is called
> while SCSI host recovery is in progress.
>
> Bart.
Thanks to Bart and Stanley for the detailed explanation.
It is clear to me now.
Thanks
Peter