From: John Garry <john.g.garry@oracle.com>
To: Damien Le Moal <dlemoal@kernel.org>,
linux-ide@vger.kernel.org, Niklas Cassel <cassel@kernel.org>,
linux-scsi@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: Igor Pylypiv <ipylypiv@google.com>, Jason Yan <yanaijie@huawei.com>
Subject: Re: [PATCH v5 2/2] scsi: libsas: terminate deferred commands on time out
Date: Thu, 16 Jul 2026 11:57:09 +0100 [thread overview]
Message-ID: <6717aabe-a2a3-427c-bbfd-2078d8bb60ef@oracle.com> (raw)
In-Reply-To: <20260716083847.926102-3-dlemoal@kernel.org>
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<ipylypiv@google.com>
> Signed-off-by: Igor Pylypiv<ipylypiv@google.com>
> Fixes: 0ea84089dbf6 ("ata: libata-scsi: avoid Non-NCQ command starvation")
> Cc:stable@vger.kernel.org
> Signed-off-by: Damien Le Moal<dlemoal@kernel.org>
Reviewed-by: John Garry <john.g.garry@oracle.com>
next prev parent reply other threads:[~2026-07-16 10:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 8:38 [PATCH v5 0/2] fixup handling of timeouts with deferred QCs Damien Le Moal
2026-07-16 8:38 ` [PATCH v5 1/2] ata: libata-scsi: terminate deferred commands on time out Damien Le Moal
2026-07-16 13:46 ` Hannes Reinecke
2026-07-16 8:38 ` [PATCH v5 2/2] scsi: libsas: " Damien Le Moal
2026-07-16 10:57 ` John Garry [this message]
2026-07-16 13:47 ` Hannes Reinecke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6717aabe-a2a3-427c-bbfd-2078d8bb60ef@oracle.com \
--to=john.g.garry@oracle.com \
--cc=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=ipylypiv@google.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=yanaijie@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox