Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: sashiko-reviews@lists.linux.dev, linux-ide@vger.kernel.org,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH v2 1/2] ata: libata-scsi: terminate deferred commands on time out
Date: Fri, 10 Jul 2026 10:48:35 +0200	[thread overview]
Message-ID: <alCx41Qlh4TStKmB@fedora> (raw)
In-Reply-To: <43c999f5-84bd-45f1-8194-cc80a535ef0a@kernel.org>

On Fri, Jul 10, 2026 at 05:29:56PM +0900, Damien Le Moal wrote:
> On 7/10/26 17:06, Niklas Cassel wrote:
> 
> Yes, it seems that nothing blocks new commands until scsi_eh_scmd_add() as that
> is the function setting the host state to recovery.
> 
> So back to the drawing board. A simple requeue will not cut it.
> 

My thinking is that if we set ATA_QCFLAG_RETRY and call
ata_qc_schedule_eh(qc, ...).

We should end up in:
https://github.com/torvalds/linux/blob/v7.2-rc2/drivers/ata/libata-eh.c#L4075-L4082

And this function will only run from EH itself, so obviously new
command will be blocked at this time.

And, if EH itself requeues the command, there should not be any
race between scsi_timeout() and scsi_complete() (since scsi_timeout()
will only add the command to the list of failed commands if SCMD_STATE_COMPLETE
is not set).


Kind regards,
Niklas

  reply	other threads:[~2026-07-10  8:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10  0:06 [PATCH v2 0/2] fixup handling of timeouts with deferred QCs Damien Le Moal
2026-07-10  0:06 ` [PATCH v2 1/2] ata: libata-scsi: terminate deferred commands on time out Damien Le Moal
2026-07-10  0:24   ` sashiko-bot
2026-07-10  7:25     ` Damien Le Moal
2026-07-10  8:06       ` Niklas Cassel
2026-07-10  8:29         ` Damien Le Moal
2026-07-10  8:48           ` Niklas Cassel [this message]
2026-07-10  8:39     ` Niklas Cassel
2026-07-10  7:32   ` Niklas Cassel
2026-07-10  0:06 ` [PATCH v2 2/2] scsi: libsas: " Damien Le Moal
2026-07-10  1:53   ` Jason Yan

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=alCx41Qlh4TStKmB@fedora \
    --to=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