mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Igor Pylypiv <ipylypiv@google.com>,
	Niklas Cassel <cassel@kernel.org>,
	John Garry <john.g.garry@oracle.com>,
	Jason Yan <yanaijie@huawei.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Jack Wang <jinpu.wang@cloud.ionos.com>,
	Hannes Reinecke <hare@suse.de>,
	Xiang Chen <chenxiang66@hisilicon.com>,
	Artur Paszkiewicz <artur.paszkiewicz@intel.com>,
	Bart Van Assche <bvanassche@acm.org>
Cc: TJ Adams <tadamsjr@google.com>,
	linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/7] scsi: libsas: Define NCQ Priority sysfs attributes for SATA devices
Date: Tue, 5 Mar 2024 08:37:53 +0900	[thread overview]
Message-ID: <50427a28-1038-48ac-b3a3-6255267f9831@kernel.org> (raw)
In-Reply-To: <20240304220815.1766285-3-ipylypiv@google.com>

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@oracle.com>
> Signed-off-by: Igor Pylypiv <ipylypiv@google.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@kernel.org>

-- 
Damien Le Moal
Western Digital Research


  reply	other threads:[~2024-03-04 23:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04 22:08 [PATCH v4 0/7] NCQ Priority sysfs sttributes for libsas Igor Pylypiv
2024-03-04 22:08 ` [PATCH v4 1/7] ata: libata-sata: Factor out NCQ Priority configuration helpers Igor Pylypiv
2024-03-04 23:33   ` Damien Le Moal
2024-03-04 22:08 ` [PATCH v4 2/7] scsi: libsas: Define NCQ Priority sysfs attributes for SATA devices Igor Pylypiv
2024-03-04 23:37   ` Damien Le Moal [this message]
2024-03-05  0:54     ` Igor Pylypiv
2024-03-04 22:08 ` [PATCH v4 3/7] scsi: pm80xx: Add libsas SATA sysfs attributes group Igor Pylypiv
2024-03-04 23:38   ` Damien Le Moal
2024-03-04 22:08 ` [PATCH v4 4/7] scsi: mvsas: " Igor Pylypiv
2024-03-04 23:38   ` Damien Le Moal
2024-03-04 22:08 ` [PATCH v4 5/7] scsi: hisi_sas: " Igor Pylypiv
2024-03-04 23:39   ` Damien Le Moal
2024-03-04 22:08 ` [PATCH v4 6/7] scsi: aic94xx: " Igor Pylypiv
2024-03-04 23:39   ` Damien Le Moal
2024-03-04 22:08 ` [PATCH v4 7/7] scsi: isci: " Igor Pylypiv
2024-03-04 23:40   ` 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=50427a28-1038-48ac-b3a3-6255267f9831@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=artur.paszkiewicz@intel.com \
    --cc=bvanassche@acm.org \
    --cc=cassel@kernel.org \
    --cc=chenxiang66@hisilicon.com \
    --cc=hare@suse.de \
    --cc=ipylypiv@google.com \
    --cc=jejb@linux.ibm.com \
    --cc=jinpu.wang@cloud.ionos.com \
    --cc=john.g.garry@oracle.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=tadamsjr@google.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

all inboxes | Powered by JetHome®