Re: [PATCH v5 2/2] scsi: libsas: terminate deferred commands on time out
John Garry <[email protected]> Thu, 16 Jul 2026 11:57:09 +0100
| Newsgroups | gmane.linux.scsi,gmane.linux.ide |
|---|---|
| Organization | Oracle Corporation |
| Message-ID | <[email protected]> |
On 16/07/2026 09:38, Damien Le Moal wrote: > If a command timeout occurs while we have a deferred non-NCQ command > waiting to be issued, the SCSI EH task is not immediately woken up as the > waiting deferred command is never issued nor completed, thus leaving this > command to always be counted as "busy" for the SCSI host. This results in > the test "shost->host_failed != scsi_host_busy(shost))" in the function > scsi_error_handler() to always be true, keeping the EH task sleeping. > Eventually, when the deferred command also times out, the SCSI EH task > is woken up and the timeout processing occurs. > > Avoid this unnecessary additional SCSI EH trigger wait time with the same > method as implemented in libata-scsi, using the eh_timed_out SCSI host > template operation. The function sas_eh_timed_out() implements this > operation and executes the function ata_scsi_retry_deferred_qc() > for SATA devices. > > Co-developed-by: Igor Pylypiv<[email protected]> > Signed-off-by: Igor Pylypiv<[email protected]> > Fixes: 0ea84089dbf6 ("ata: libata-scsi: avoid Non-NCQ command starvation") > Cc:[email protected] > Signed-off-by: Damien Le Moal<[email protected]> Reviewed-by: John Garry <[email protected]>