[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50427a28-1038-48ac-b3a3-6255267f9831@kernel.org>
Date: Tue, 5 Mar 2024 08:37:53 +0900
From: Damien Le Moal <dlemoal@...nel.org>
To: Igor Pylypiv <ipylypiv@...gle.com>, Niklas Cassel <cassel@...nel.org>,
John Garry <john.g.garry@...cle.com>, Jason Yan <yanaijie@...wei.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Jack Wang <jinpu.wang@...ud.ionos.com>, Hannes Reinecke <hare@...e.de>,
Xiang Chen <chenxiang66@...ilicon.com>,
Artur Paszkiewicz <artur.paszkiewicz@...el.com>,
Bart Van Assche <bvanassche@....org>
Cc: TJ Adams <tadamsjr@...gle.com>, linux-ide@...r.kernel.org,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 2/7] scsi: libsas: Define NCQ Priority sysfs attributes
for SATA devices
On 3/5/24 07:08, Igor Pylypiv wrote:
> Libata sysfs attributes cannot be used for libsas managed SATA devices
> because the ata_port location is different for libsas.
>
> Defined sysfs attributes (visible for SATA devices only):
> - /sys/block/sda/device/ncq_prio_enable
> - /sys/block/sda/device/ncq_prio_supported
>
> The newly defined attributes will pass the correct ata_port to libata
> helper functions.
>
> Reviewed-by: John Garry <john.g.garry@...cle.com>
> Signed-off-by: Igor Pylypiv <ipylypiv@...gle.com>
> ---
> drivers/scsi/libsas/sas_ata.c | 94 +++++++++++++++++++++++++++++++++++
> include/scsi/sas_ata.h | 6 +++
> 2 files changed, 100 insertions(+)
>
> diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
> index 12e2653846e3..4ecdfa2a12c3 100644
> --- a/drivers/scsi/libsas/sas_ata.c
> +++ b/drivers/scsi/libsas/sas_ata.c
> @@ -964,3 +964,97 @@ int sas_execute_ata_cmd(struct domain_device *device, u8 *fis, int force_phy_id)
> force_phy_id, &tmf_task);
> }
> EXPORT_SYMBOL_GPL(sas_execute_ata_cmd);
> +
> +static ssize_t sas_ncq_prio_supported_show(struct device *device,
> + struct device_attribute *attr,
> + char *buf)
> +{
> + struct scsi_device *sdev = to_scsi_device(device);
> + struct domain_device *ddev = sdev_to_domain_dev(sdev);
> + bool supported;
> + int rc;
> +
> + /* This attribute shall be visible for SATA devices only */
> + if (WARN_ON(!dev_is_sata(ddev)))
WARN_ON_ONCE() please. Same comment for all the occurences of this check.
With that, looks good to me.
Reviewed-by: Damien Le Moal <dlemoal@...nel.org>
--
Damien Le Moal
Western Digital Research
Powered by blists - more mailing lists