Re: [PATCH v4] scsi: ufs: core: handle PM commands timeout before SCSI EH

From: Peter Wang (王信友)

Date: Wed Jun 03 2026 - 02:59:27 EST


On Tue, 2026-06-02 at 20:41 +0800, Hongjie Fang wrote:
> +       /*
> +        * ufshcd_link_recovery() may already have completed @scmd,
> e.g. via
> +        * the existing MCQ force-completion path.
> +        */
> +       if (!test_bit(SCMD_STATE_COMPLETE, &scmd->state)) {
> +               if (!hba->mcq_enabled) {
>

Hi Hongjie,

MCQ will complete all uncompleted scmd by setting force_compl.
Hence, if there are still uncompleted scmd, it should be 
in legacy mode, and there is no need to check 
if (!hba->mcq_enabled), right?


> +                       unsigned long flags;
> +                       struct request *rq = scsi_cmd_to_rq(scmd);
> +
> +                       spin_lock_irqsave(&hba->outstanding_lock,
> flags);
> +                       __clear_bit(rq->tag, &hba->outstanding_reqs);
> +                       spin_unlock_irqrestore(&hba-
> >outstanding_lock, flags);
> +               }
> +
> +               set_host_byte(scmd, DID_TIME_OUT);
>

Why does MCQ mode set DID_REQUEUE, while legacy mode sets DID_TIME_OUT?

Thanks
Peter