Re: [PATCH v2 2/2] scsi: ufs: core: Decouple CQ sweep from request iterator in MCQ

From: Peter Wang

Date: Wed Sep 23 2026 - 02:09:58 EST


On Tue, 2026-09-22 at 09:30 -0700, Bart Van Assche wrote:
> A SCSI host controller reset must abort all pending commands.
> Requeuing
> SCSI commands during a host controller reset violates the API
> contract
> between the SCSI error handler and SCSI LLDs. I'm not aware of any
> other
> SCSI LLD than the UFS host controller driver that requeues pending
> commands upon a host controller reset instead of aborting these.
>
> .eh_host_reset_handler() is expected to reset all logical units and
> the
> host controller. The SCSI architecture manual (SAM) mentions
> explicitly
> that resetting logical units involves aborting all commands.
>
> Thanks,
>
> Bart.

Hi Bart,

I'm not sure if I misunderstood your point. SCSI reset
(ufshcd_eh_host_reset_handler) does indeed abort all commands
by trigger ufshcd_err_handler and call ufshcd_abort_all.
This shouldn't violate the SCSI API contract. But whether the
subsequent re-queue (DID_REQUEUE) violates, I haven't seen any
prohibition?

Because currently the UFS error handler (ufshcd_err_handler)
directly re-queues (By set DID_REQUEUE) the unfinish command,
and err handler might be triggered in many places, for example,
like UIC errors, directly resetting and re-queueing should be
reasonable and can be handled quickly.

If it cannot directly re-queue, then ufshcd_eh_host_reset_handler
would need another similar function that does not handle re-queueing.
But this looks unnecessary, direct re-queuing seems safe?

Thanks
Peter