From: Niklas Cassel <nks@flawful.org>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
Bart Van Assche <bvanassche@acm.org>,
Hannes Reinecke <hare@suse.de>,
linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org,
linux-block@vger.kernel.org
Subject: Re: [PATCH v6 09/19] scsi: allow enabling and disabling command duration limits
Date: Tue, 11 Apr 2023 13:59:44 +0200 [thread overview]
Message-ID: <ZDVLsIi/OhkxNcGb@x1-carbon> (raw)
In-Reply-To: <15ad7cf9-e385-9cea-964a-4a2eac35385c@kernel.org>
On Tue, Apr 11, 2023 at 04:38:48PM +0900, Damien Le Moal wrote:
> On 4/11/23 16:23, Christoph Hellwig wrote:
> > On Tue, Apr 11, 2023 at 04:09:34PM +0900, Damien Le Moal wrote:
> >> But yes, I guess we could just unconditionally enable CDL for ATA on device scan
> >> to be on par with scsi, which has CDL always enabled.
> >
> > I'd prefer that. With a module option to not enable it just to be
> > safe.
>
> Then it may be better to move the cdl_enable attribute store definition for ATA
> devices to libata. That would be less messy that way. Let me see if that can be
> done cleanly.
I don't think that the SCSI mode select can just be replaced with simple
SET FEATURES in libata.
If we move the SET FEATURES call to a function in libata, and then use a
function pointer in the scsi_host_template, and let only libata set this
function pointer (similar to e.g. how the queue_depth sysfs attribute works),
then the code will no longer work for SATA devices connected to a SAS HBA.
The current code simply checks if VPD page89 (the ATA Information VPD
page - which is defined in the SCSI to ATA Translation (SAT) standard)
exists. This page (and thus the sdev->vpd_pg89 pointer) will only exist
if either:
1) An ATA device is connected to a SATA controller. This page will then
be implemented by libata.
2) An ATA device is connected to a SAS HBA. The SAS HB will then provide
this page. (The page will not exist for SCSI devices connected to the
same SAS HBA.)
For case 1) with the current code, scsi.c will call scsi_mode_select()
which will be translated by libata before being sent down to the device.
For case 2) with the current code, scsi.c will send down a SCSI mode
select to the SAS HBA, and the SAS HBA will be responsible for translating
the command before sending it to the device.
So I actually think that the current way to check if vpd page89 exists
is probably the "cleanest" solution that I can think of.
If you have a better suggestion that will work for both case 1) and
case 2), I will be happy to change the code accordingly.
Kind regards,
Niklas
next prev parent reply other threads:[~2023-04-11 12:00 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-06 11:32 [PATCH v6 00/19] Add Command Duration Limits support Niklas Cassel
2023-04-06 11:32 ` [PATCH v6 01/19] ioprio: cleanup interface definition Niklas Cassel
2023-04-11 6:14 ` Christoph Hellwig
2023-04-06 11:32 ` [PATCH v6 02/19] block: introduce ioprio hints Niklas Cassel
2023-04-11 6:14 ` Christoph Hellwig
2023-04-06 11:32 ` [PATCH v6 03/19] block: introduce BLK_STS_DURATION_LIMIT Niklas Cassel
2023-04-11 6:15 ` Christoph Hellwig
2023-04-06 11:32 ` [PATCH v6 04/19] scsi: core: allow libata to complete successful commands via EH Niklas Cassel
2023-04-06 11:32 ` [PATCH v6 05/19] scsi: rename and move get_scsi_ml_byte() Niklas Cassel
2023-04-06 11:32 ` [PATCH v6 06/19] scsi: support retrieving sub-pages of mode pages Niklas Cassel
2023-04-11 6:21 ` Christoph Hellwig
2023-04-06 11:32 ` [PATCH v6 07/19] scsi: support service action in scsi_report_opcode() Niklas Cassel
2023-04-06 11:32 ` [PATCH v6 08/19] scsi: detect support for command duration limits Niklas Cassel
2023-04-06 11:32 ` [PATCH v6 09/19] scsi: allow enabling and disabling " Niklas Cassel
2023-04-11 6:16 ` Christoph Hellwig
2023-04-11 7:09 ` Damien Le Moal
2023-04-11 7:23 ` Christoph Hellwig
2023-04-11 7:38 ` Damien Le Moal
2023-04-11 11:59 ` Niklas Cassel [this message]
2023-04-11 12:20 ` Niklas Cassel
2023-04-12 0:59 ` Damien Le Moal
2023-04-12 4:43 ` Christoph Hellwig
2023-04-12 5:32 ` Damien Le Moal
2023-04-12 5:34 ` Christoph Hellwig
2023-04-11 8:40 ` Damien Le Moal
2023-04-11 8:15 ` Niklas Cassel
2023-04-11 6:44 ` Hannes Reinecke
2023-04-06 11:32 ` [PATCH v6 10/19] scsi: sd: set read/write commands CDL index Niklas Cassel
2023-04-11 6:17 ` Christoph Hellwig
2023-04-06 11:32 ` [PATCH v6 11/19] scsi: sd: handle read/write CDL timeout failures Niklas Cassel
2023-04-06 11:32 ` [PATCH v6 12/19] ata: libata-scsi: remove unnecessary !cmd checks Niklas Cassel
2023-04-11 6:17 ` Christoph Hellwig
2023-04-06 11:32 ` [PATCH v6 13/19] ata: libata: change ata_eh_request_sense() to not set CHECK_CONDITION Niklas Cassel
2023-04-06 11:32 ` [PATCH v6 14/19] ata: libata: detect support for command duration limits Niklas Cassel
2023-04-11 6:17 ` Christoph Hellwig
2023-04-06 11:32 ` [PATCH v6 15/19] ata: libata-scsi: handle CDL bits in ata_scsiop_maint_in() Niklas Cassel
2023-04-11 6:18 ` Christoph Hellwig
2023-04-06 11:32 ` [PATCH v6 16/19] ata: libata-scsi: add support for CDL pages mode sense Niklas Cassel
2023-04-11 6:18 ` Christoph Hellwig
2023-04-06 11:32 ` [PATCH v6 17/19] ata: libata: add ATA feature control sub-page translation Niklas Cassel
2023-04-06 11:32 ` [PATCH v6 18/19] ata: libata: set read/write commands CDL index Niklas Cassel
2023-04-11 6:19 ` Christoph Hellwig
2023-04-11 6:46 ` Hannes Reinecke
2023-04-06 11:32 ` [PATCH v6 19/19] ata: libata: handle completion of CDL commands using policy 0xD Niklas Cassel
2023-04-11 6:20 ` Christoph Hellwig
2023-04-12 22:29 ` [PATCH v6 00/19] Add Command Duration Limits support Damien Le Moal
2023-04-13 1:17 ` Martin K. Petersen
2023-04-15 2:38 ` Damien Le Moal
2023-04-18 5:35 ` 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=ZDVLsIi/OhkxNcGb@x1-carbon \
--to=nks@flawful.org \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=dlemoal@kernel.org \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=jejb@linux.ibm.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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