From: Damien Le Moal <dlemoal@kernel.org>
To: Bart Van Assche <bvanassche@acm.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: Fri, 13 Jun 2025 07:32:58 +0900 [thread overview]
Message-ID: <c02d01dc-aa40-40dc-9b64-1805580f99cf@kernel.org> (raw)
In-Reply-To: <5cf544f9-202d-4018-8ed1-0733d48bace1@acm.org>
On 6/13/25 01:13, Bart Van Assche wrote:
> On 6/11/25 4:14 PM, Damien Le Moal wrote:
>> And no, we cannot avoid trying to detect if we are dealing with an ATA/SAT
>> device or a real SCSI device in all 3 places where this "if" is done.
>> 2 of these used VPD page dereference under rcu lock before, which is rather
>> heavy handed. The point of this patch is to simplify that.
>
> Hi Damien,
>
> The code under "if (is_ata)" in scsi_cdl_enable() seems very
> ATA-specific to me. Shouldn't that code be moved under drivers/ata/?
You seem to be forgetting that when ATA devices are attached to a SAS HBA (one
that does not use libsas), then the code in drivers/ata is irrelevant as it is
not used at all.
All these "if (is_ata)" cases are addressing shortcomings of the SAT
specifications regarding incompatibilities between SPC/SBC and ACS
specifications. E.g., for CDL, the CDL feature has an enable/disable action
defined in ACS but not in SPC (CDL is always enabled if it is supported).
>
> Regarding the following code in scsi_add_lun():
>
> if (strncmp(sdev->vendor, "ATA ", 8) == 0)
> sdev->allow_restart = 1;
>
> Other SCSI LLDs set the 'allow_restart' flag in their sdev_configure
> callback. Can this be done for ATA disks too?
>
> Regarding the code that sets the no_write_same flag:
>
> if (sdev->is_ata)
> sdev->no_write_same = 1;
>
> Why is the RCU reader lock held around that code, a lock that protects
> reading from the VPD pages while the above code does not access the
> contents of any VPD page?
>
> Other SCSI LLDs set the 'no_write_same' flag in their sdev_configure
> callback. Can this be done for ATA disks too?
See above. If this is moved to ATA code, then it will never be done for ATA
drives connected to SAS HBAs.
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2025-06-12 22:32 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
2025-06-11 23:14 ` Damien Le Moal
2025-06-12 16:13 ` Bart Van Assche
2025-06-12 22:32 ` Damien Le Moal [this message]
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=c02d01dc-aa40-40dc-9b64-1805580f99cf@kernel.org \
--to=dlemoal@kernel.org \
--cc=bvanassche@acm.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