From: sashiko-bot@kernel.org
To: "Damien Le Moal" <dlemoal@kernel.org>
Cc: linux-scsi@vger.kernel.org, dlemoal@kernel.org,
cassel@kernel.org, linux-ide@vger.kernel.org
Subject: Re: [PATCH v7 1/2] ata: libata-scsi: terminate deferred commands on time out
Date: Tue, 21 Jul 2026 07:00:30 +0000 [thread overview]
Message-ID: <20260721070030.8AC0F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260721064027.2081195-2-dlemoal@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing call to ata_scsi_schedule_deferred_qc() in atapi_qc_complete() leads to starvation and timeouts of deferred commands.
--
--- Patch [1]: [PATCH v7 1/2] ata: libata-scsi: terminate deferred commands on time out ---
commit 3b26adffba8da435c70bdca03b617603f9f9ae76
Author: Damien Le Moal <dlemoal@kernel.org>
ata: libata-scsi: terminate deferred commands on time out
This commit avoids unnecessary SCSI EH task wake-ups by scheduling
a retry of all waiting deferred QCs using the new ata_scsi_eh_timed_out
operation. It also updates ata_scsi_requeue_deferred_qc to terminate
timed-out deferred commands directly and schedule libata EH to prevent
the block layer from re-issuing them immediately.
> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
> index 5868526301a2b..c2f2f711fd987 100644
> --- a/drivers/ata/libata-scsi.c
> +++ b/drivers/ata/libata-scsi.c
[ ... ]
> @@ -2936,7 +3014,15 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc)
> if (qc->cdb[0] == ALLOW_MEDIUM_REMOVAL && qc->dev->sdev)
> qc->dev->sdev->locked = 0;
>
> - ata_scsi_qc_done(qc, true, SAM_STAT_CHECK_CONDITION);
> + if (cmd->result)
> + ata_scsi_qc_done(qc, false, 0);
> + else
> + ata_scsi_qc_done(qc, true, SAM_STAT_CHECK_CONDITION);
> + return;
> + }
> +
> + if (cmd->result) {
> + ata_scsi_qc_done(qc, false, 0);
> return;
> }
>
[Severity: High]
This isn't a bug introduced by this patch, but should atapi_qc_complete()
be calling ata_scsi_schedule_deferred_qc(link) before returning?
Unlike ata_scsi_qc_complete() which kicks deferred commands,
atapi_qc_complete() misses this call on all of its exit paths, including
the ones modified here. If an ATAPI command is executing on a shared PATA
link and a concurrent command is issued to the other device, it gets
deferred by ata_std_qc_defer(). When the ATAPI command finishes, it
appears the deferred command will be trapped in link->deferred_qc and
never issued, eventually failing with DID_TIME_OUT and causing device hangs.
Could this function be missing a call to ata_scsi_schedule_deferred_qc()
to prevent starvation?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260721064027.2081195-1-dlemoal@kernel.org?part=1
next prev parent reply other threads:[~2026-07-21 7:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 6:40 [PATCH v7 0/2] fixup handling of timeouts with deferred QCs Damien Le Moal
2026-07-21 6:40 ` [PATCH v7 1/2] ata: libata-scsi: terminate deferred commands on time out Damien Le Moal
2026-07-21 7:00 ` sashiko-bot [this message]
2026-07-21 7:43 ` Damien Le Moal
2026-07-21 6:40 ` [PATCH v7 2/2] scsi: libsas: " Damien Le Moal
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=20260721070030.8AC0F1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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