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

From: Bart Van Assche

Date: Wed Sep 23 2026 - 13:47:00 EST


On 9/23/26 4:18 AM, Stanley Jhu wrote:
Would DID_RESET be a better fit after a controller reset (including
ufshcd_eh_timed_out() right after ufshcd_link_recovery()), similar
to mpi3mr_flush_scmd() and mpt3sas's _scsih_flush_running_cmds()?
It reports what the driver actually knows at that point without
pulling the command into the SCSI error handler.

Calling scsi_done() from a .eh_host_reset_handler() implementation is
not allowed because calling scsi_done() for a command that is on the
SCSI error handler list corrupts that list. One of the functions called
by scsi_done() is scsi_complete(). From that function:

INIT_LIST_HEAD(&cmd->eh_entry);

This corrupts the command lists maintained by the SCSI error handler,
e.g. work_q and done_q.

Bart.