RE: [PATCH v3] scsi: ufs: core: handle PM SSU timeout before SCSI EH

From: Fang Hongjie(方洪杰)

Date: Tue Jun 02 2026 - 00:45:03 EST



> > @@ -6517,6 +6548,8 @@ static void ufshcd_complete_requests(struct
> > ufs_hba *hba, bool force_compl)
> >  {
> >         if (hba->mcq_enabled)
> >                 ufshcd_mcq_compl_pending_transfer(hba, force_compl);
> > +       else if (force_compl)
> > +               ufshcd_force_compl_pending_transfer(hba);
> >
>
> Hi Hongjie,
>
> Why will an SSU timeout invoke ufshcd_complete_requests
> if SCSI_EH_DONE is returned in ufshcd_eh_timed_out?
>
An SSU timeout reaches ufshcd_complete_requests(hba, true) through the
direct recovery path:
ufshcd_eh_timed_out()
ufshcd_link_recovery()
ufshcd_host_reset_and_restore()
ufshcd_complete_requests(hba, true)

>
> >         else
> >                 ufshcd_transfer_req_compl(hba);
> >
> > @@ -9466,7 +9499,7 @@ static enum scsi_timeout_action
> > ufshcd_eh_timed_out(struct scsi_cmnd *scmd)
> >  {
> >         struct ufs_hba *hba = shost_priv(scmd->device->host);
> >
> > -       if (!hba->system_suspending) {
> > +       if (!hba->pm_op_in_progress || !ufshcd_is_scsi_cmd(scmd)) {
> >
>
> UFS internal device-management command timeouts will never
> reach ufshcd_eh_timed_out, right?

They are still executed via blk_execute_rq(), so their timeout handling still goes
through scsi_timeout() and the host eh_timed_out() callback.


Best.