From: Bart Van Assche <bvanassche@acm.org>
To: Damien Le Moal <dlemoal@kernel.org>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH v2] scsi: Remember if a device is an ATA device
Date: Wed, 11 Jun 2025 08:46:10 -0700 [thread overview]
Message-ID: <aca75eab-45b4-4afd-8319-e2662fd9d9e8@acm.org> (raw)
In-Reply-To: <20250611093421.2901633-1-dlemoal@kernel.org>
On 6/11/25 2:34 AM, Damien Le Moal wrote:
> scsi_add_lun() tests the device vendor string of SCSI devices to detect
> if a SCSI device is in fact an ATA device, in order to correctly handle
> SATL power management. The function scsi_cdl_enable() also requires
> knowing if a SCSI device is an ATA device to control the state of the
> device CDL feature but this function does that by testing for the
> presence of the VPD page 89h (ATA INFORMATION page).
> sd_read_write_same() also has a similar test.
>
> Simplify these different methods by adding the is_ata field to struct
> scsi_device to remember that a SCSI device is in fact an ATA one based
> on the device vendor name test. This filed can also allow low level
> SCSI host adapter drivers to take special actions for ATA devices
> (e.g. to better handle ATA NCQ errors).
>
> With this, simplify scsi_cdl_enable() and sd_read_write_same().
Hi Damien,
There is only one "if (is_ata)" check in the SCSI core as far as I can
see. Can it be avoided that ATA code leaks into the SCSI core by
introducing a new function pointer, e.g. in struct Scsi_Host, and by
calling that new function pointer if it has been set from
scsi_cdl_enable()?
Thanks,
Bart.
next prev parent reply other threads:[~2025-06-11 15:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-11 9:34 [PATCH v2] scsi: Remember if a device is an ATA device Damien Le Moal
2025-06-11 15:46 ` Bart Van Assche [this message]
2025-06-11 23:14 ` Damien Le Moal
2025-06-12 16:13 ` Bart Van Assche
2025-06-12 22:32 ` Damien Le Moal
2025-06-12 2:33 ` Igor Pylypiv
2025-06-16 18:32 ` Martin K. Petersen
2025-06-20 3:18 ` Martin K. Petersen
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=aca75eab-45b4-4afd-8319-e2662fd9d9e8@acm.org \
--to=bvanassche@acm.org \
--cc=dlemoal@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