Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Niklas Cassel <cassel@kernel.org>
Cc: linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Igor Pylypiv <ipylypiv@google.com>,
	John Garry <john.g.garry@oracle.com>,
	Jason Yan <yanaijie@huawei.com>
Subject: Re: [PATCH v7 1/2] ata: libata-scsi: terminate deferred commands on time out
Date: Tue, 28 Jul 2026 12:31:45 +0900	[thread overview]
Message-ID: <b5ca79f0-cf1d-4a44-98fb-cb470f01a102@kernel.org> (raw)
In-Reply-To: <amfCVx43BCYFWFFY@ryzen>

On 7/28/26 05:40, Niklas Cassel wrote:
> Might be a quite subtle difference, but I think it is much clearer if you
> would instead write this as:
> 
> 		if (timedout_scmd && qc->scsicmd == timedout_scmd) {
> 			host_byte = DID_TIME_OUT;
> 			action = SCSI_EH_DONE;
> 		} else {
> 			host_byte = DID_REQUEUE;
> 		}
> 		ata_scsi_qc_done(qc, true, host_byte << 16);
> 
> 
> Because that more clearly highlights the special case.
> (And is more in line with my suggested comment, so it also makes it easier
> to corroborate the comment with the actual code.)
> 
> The special case is if timedout_scmd is non-NULL AND is the deferred QC.
> 
> For all other cases, if timedout_scmd is non-NULL but is not the deferred
> QC, or if the timedout_cmd is NULL, we want to requeue.

I added all your suggested comments and code changes and added the patches to
for-7.2-fixes.

-- 
Damien Le Moal
Western Digital Research

  reply	other threads:[~2026-07-28  3:31 UTC|newest]

Thread overview: 11+ 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
2026-07-21  7:43     ` Damien Le Moal
2026-07-23 14:33   ` Igor Pylypiv
2026-07-27 18:17   ` Niklas Cassel
2026-07-27 19:35   ` Niklas Cassel
2026-07-27 20:40   ` Niklas Cassel
2026-07-28  3:31     ` Damien Le Moal [this message]
2026-07-21  6:40 ` [PATCH v7 2/2] scsi: libsas: " Damien Le Moal
2026-07-23  4:20 ` [PATCH v7 0/2] fixup handling of timeouts with deferred QCs Igor Pylypiv

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=b5ca79f0-cf1d-4a44-98fb-cb470f01a102@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=cassel@kernel.org \
    --cc=ipylypiv@google.com \
    --cc=john.g.garry@oracle.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