From patchwork Mon Mar 4 22:08:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Pylypiv X-Patchwork-Id: 777932 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 783477BAE2 for ; Mon, 4 Mar 2024 22:08:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709590108; cv=none; b=q4PXT3fa3fWnqRaUGmaveO5KzgeOgvL0fqmk2tWDWyoSVSSvHyIwi+X4riFJeaIOVgEgbQlG/L/u/Qf5WfWCy0EG+rz4+kS9VtNpOIIsKrUZlGAKVKjvtNVsfx+M7+rkDPe0943KEUnKbyk8nMU6PFCEcDYDlXjKRaV83BF1SK4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709590108; c=relaxed/simple; bh=KICc4dnvLGTzCC3FNqjGxTvq8eAy0dBzW/l8FVRxPb0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=IJZEnXBpAF5v+98UqZmCKL4Zq+dEt7mZV58mtYVTBTKnOQ41nzJuhZsy6cGLWK7pRJEoTzWf7fLBZO18NooolGj5zgHnm/M/pkUPX3LwANSUtribrqkOlYUhfYnCeGJxmysURuZ3nij3MC4R7FEQQZUuPTfl/5Kw+2c9NuZAU9k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ipylypiv.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=oHcY164w; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ipylypiv.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="oHcY164w" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dc64f63d768so17534276.2 for ; Mon, 04 Mar 2024 14:08:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709590105; x=1710194905; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=JzsWWAo/xYiW4zw4aIXFlbocWe20WgmvCuPELvrmNDA=; b=oHcY164wFyyLolDBKByz903bcg+LfeKhxRyvxDB5msPR3mp8W3uYcKfCzUpYMSjHpp x1t1leSE3/G4Assjn7Xt4T898pfrPNk9B9sD/D/BmjsEOJ2yLmcDAL1GkTlsDFfwVyJp Io817hdATpyCgiIUf8E0TOj8P2CP6h2MDDChIHdVfKyThO+DFdVxAMLpSauj65Kn9M5y M0o9SX+zQHjlFEkuqNisKLv6Ru+0pReqUOK3x9QIdq3uI4EcaGFeO5WAd4aoG4545pQR gcce3rdehKeXR9NuYXmjQO4VeLHR9F3QWcS//q9CuBwJBEFTbN8zz7jVUKaFXkEEzQ5k DqdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709590105; x=1710194905; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JzsWWAo/xYiW4zw4aIXFlbocWe20WgmvCuPELvrmNDA=; b=X8Y+FqyuEmuAG+kOuSz/zkV/1xRPlP7J7kbHVTORB01OLbYiLpdK9aLUMbAA43lgZB PhuyxACh9rTBniY7tqQiKfkpBQGvpuIorAx6Jw+BBfzyHxgQzFsiXhqYu9bNmAwEz26L YPVa0MJ4mAcrSSNayPMCWvuuiOUcCE2uce28tlIASjT/izR+yoYDdDrw6SDUXu1t7PZr IZX8DJ0yh9boeyVaE8ZT7TLeQhB6sg+y7uP0QvC2ap8vsWQfe3WJa9YbzzdyBZuyCH5K /n7E1rmULB8jpkIFMzbtfedV4v7GfQ6pSXWgR3emgdMJCXcrK7qt7NDPSAE06yj6IO7p zGgw== X-Forwarded-Encrypted: i=1; AJvYcCXl4LSLsEEGU7DE/BwJLFJJ3WO8JzXayl10i+chaDe8sIknSCsYqGreJ8uXrqj9zNRHWweogvyllX8E8O0VV94zH8m32FoNp4O3tw== X-Gm-Message-State: AOJu0YwbczBUW1mw8vS08UYPIULH4vbfFFP8fyvLleUnNyhRlj/dokyQ vHUq2OKISy4jW+IBBaWyCdD3QAN4O4l46GjEFPXSlayH8d6Vm3gIfCJ27APu/46QMeTc1rfVTQA Dp6Kr8SlmXw== X-Google-Smtp-Source: AGHT+IEOaRN+2rpttgqPFFy44Mzu7rFPJhfK2j2F4PJmr0F0Ze4t1QA1Pg58rXLR6v1jmCQrYWR+aZmCF9C+YQ== X-Received: from ipylypiv.svl.corp.google.com ([2620:15c:2c5:13:e901:e760:20cd:d870]) (user=ipylypiv job=sendgmr) by 2002:a05:6902:150d:b0:dc6:fa35:b42 with SMTP id q13-20020a056902150d00b00dc6fa350b42mr2867409ybu.2.1709590105483; Mon, 04 Mar 2024 14:08:25 -0800 (PST) Date: Mon, 4 Mar 2024 14:08:09 -0800 In-Reply-To: <20240304220815.1766285-1-ipylypiv@google.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240304220815.1766285-1-ipylypiv@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Message-ID: <20240304220815.1766285-2-ipylypiv@google.com> Subject: [PATCH v4 1/7] ata: libata-sata: Factor out NCQ Priority configuration helpers From: Igor Pylypiv To: Damien Le Moal , Niklas Cassel , John Garry , Jason Yan , "James E.J. Bottomley" , "Martin K. Petersen" , Jack Wang , Hannes Reinecke , Xiang Chen , Artur Paszkiewicz , Bart Van Assche Cc: TJ Adams , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Igor Pylypiv Export libata NCQ Priority configuration helpers to be reused for libsas managed SATA devices. Signed-off-by: Igor Pylypiv --- drivers/ata/libata-sata.c | 140 +++++++++++++++++++++++++++----------- include/linux/libata.h | 6 ++ 2 files changed, 107 insertions(+), 39 deletions(-) diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c index 0fb1934875f2..f00dd02dc6f8 100644 --- a/drivers/ata/libata-sata.c +++ b/drivers/ata/libata-sata.c @@ -848,80 +848,122 @@ DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR, ata_scsi_lpm_show, ata_scsi_lpm_store); EXPORT_SYMBOL_GPL(dev_attr_link_power_management_policy); -static ssize_t ata_ncq_prio_supported_show(struct device *device, - struct device_attribute *attr, - char *buf) +/** + * ata_ncq_prio_supported - Check if device supports NCQ Priority + * @ap: ATA port of the target device + * @sdev: SCSI device + * @supported: Address of a boolean to store the result + * + * Helper to check if device supports NCQ Priority feature. + */ +int ata_ncq_prio_supported(struct ata_port *ap, struct scsi_device *sdev, + bool *supported) { - struct scsi_device *sdev = to_scsi_device(device); - struct ata_port *ap = ata_shost_to_port(sdev->host); struct ata_device *dev; - bool ncq_prio_supported; + unsigned long flags; int rc = 0; - spin_lock_irq(ap->lock); + spin_lock_irqsave(ap->lock, flags); dev = ata_scsi_find_dev(ap, sdev); if (!dev) rc = -ENODEV; else - ncq_prio_supported = dev->flags & ATA_DFLAG_NCQ_PRIO; - spin_unlock_irq(ap->lock); + *supported = dev->flags & ATA_DFLAG_NCQ_PRIO; + spin_unlock_irqrestore(ap->lock, flags); + return rc; +} +EXPORT_SYMBOL_GPL(ata_ncq_prio_supported); + +static ssize_t ata_ncq_prio_supported_show(struct device *device, + struct device_attribute *attr, + char *buf) +{ + struct scsi_device *sdev = to_scsi_device(device); + struct ata_port *ap = ata_shost_to_port(sdev->host); + bool supported; + int rc; - return rc ? rc : sysfs_emit(buf, "%u\n", ncq_prio_supported); + rc = ata_ncq_prio_supported(ap, sdev, &supported); + if (rc) + return rc; + + return sysfs_emit(buf, "%d\n", supported); } DEVICE_ATTR(ncq_prio_supported, S_IRUGO, ata_ncq_prio_supported_show, NULL); EXPORT_SYMBOL_GPL(dev_attr_ncq_prio_supported); -static ssize_t ata_ncq_prio_enable_show(struct device *device, - struct device_attribute *attr, - char *buf) +/** + * ata_ncq_prio_enabled - Check if NCQ Priority is enabled + * @ap: ATA port of the target device + * @sdev: SCSI device + * @enabled: Address of a boolean to store the result + * + * Helper to check if NCQ Priority feature is enabled. + */ +int ata_ncq_prio_enabled(struct ata_port *ap, struct scsi_device *sdev, + bool *enabled) { - struct scsi_device *sdev = to_scsi_device(device); - struct ata_port *ap = ata_shost_to_port(sdev->host); struct ata_device *dev; - bool ncq_prio_enable; + unsigned long flags; int rc = 0; - spin_lock_irq(ap->lock); + spin_lock_irqsave(ap->lock, flags); dev = ata_scsi_find_dev(ap, sdev); if (!dev) rc = -ENODEV; else - ncq_prio_enable = dev->flags & ATA_DFLAG_NCQ_PRIO_ENABLED; - spin_unlock_irq(ap->lock); - - return rc ? rc : sysfs_emit(buf, "%u\n", ncq_prio_enable); + *enabled = dev->flags & ATA_DFLAG_NCQ_PRIO_ENABLED; + spin_unlock_irqrestore(ap->lock, flags); + return rc; } +EXPORT_SYMBOL_GPL(ata_ncq_prio_enabled); -static ssize_t ata_ncq_prio_enable_store(struct device *device, - struct device_attribute *attr, - const char *buf, size_t len) +static ssize_t ata_ncq_prio_enable_show(struct device *device, + struct device_attribute *attr, + char *buf) { struct scsi_device *sdev = to_scsi_device(device); - struct ata_port *ap; - struct ata_device *dev; - long int input; - int rc = 0; + struct ata_port *ap = ata_shost_to_port(sdev->host); + bool enabled; + int rc; - rc = kstrtol(buf, 10, &input); + rc = ata_ncq_prio_enabled(ap, sdev, &enabled); if (rc) return rc; - if ((input < 0) || (input > 1)) - return -EINVAL; - ap = ata_shost_to_port(sdev->host); - dev = ata_scsi_find_dev(ap, sdev); - if (unlikely(!dev)) - return -ENODEV; + return sysfs_emit(buf, "%d\n", enabled); +} + +/** + * ata_ncq_prio_enable - Enable/disable NCQ Priority + * @ap: ATA port of the target device + * @sdev: SCSI device + * @enable: true - enable NCQ Priority, false - disable NCQ Priority + * + * Helper to enable/disable NCQ Priority feature. + */ +int ata_ncq_prio_enable(struct ata_port *ap, struct scsi_device *sdev, + bool enable) +{ + struct ata_device *dev; + unsigned long flags; + int rc = 0; + + spin_lock_irqsave(ap->lock, flags); - spin_lock_irq(ap->lock); + dev = ata_scsi_find_dev(ap, sdev); + if (!dev) { + rc = -ENODEV; + goto unlock; + } if (!(dev->flags & ATA_DFLAG_NCQ_PRIO)) { rc = -EINVAL; goto unlock; } - if (input) { + if (enable) { if (dev->flags & ATA_DFLAG_CDL_ENABLED) { ata_dev_err(dev, "CDL must be disabled to enable NCQ priority\n"); @@ -934,9 +976,29 @@ static ssize_t ata_ncq_prio_enable_store(struct device *device, } unlock: - spin_unlock_irq(ap->lock); + spin_unlock_irqrestore(ap->lock, flags); + return rc; +} +EXPORT_SYMBOL_GPL(ata_ncq_prio_enable); + +static ssize_t ata_ncq_prio_enable_store(struct device *device, + struct device_attribute *attr, + const char *buf, size_t len) +{ + struct scsi_device *sdev = to_scsi_device(device); + struct ata_port *ap = ata_shost_to_port(sdev->host); + bool enable; + int rc; + + rc = kstrtobool(buf, &enable); + if (rc) + return rc; + + rc = ata_ncq_prio_enable(ap, sdev, enable); + if (rc) + return rc; - return rc ? rc : len; + return len; } DEVICE_ATTR(ncq_prio_enable, S_IRUGO | S_IWUSR, diff --git a/include/linux/libata.h b/include/linux/libata.h index 26d68115afb8..6dd9a4f9ca7c 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -1157,6 +1157,12 @@ extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth); extern int ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev, int queue_depth); +extern int ata_ncq_prio_supported(struct ata_port *ap, struct scsi_device *sdev, + bool *supported); +extern int ata_ncq_prio_enabled(struct ata_port *ap, struct scsi_device *sdev, + bool *enabled); +extern int ata_ncq_prio_enable(struct ata_port *ap, struct scsi_device *sdev, + bool enable); extern struct ata_device *ata_dev_pair(struct ata_device *adev); extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev); extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap); From patchwork Mon Mar 4 22:08:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Pylypiv X-Patchwork-Id: 778248 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 889777BB17 for ; Mon, 4 Mar 2024 22:08:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709590110; cv=none; b=D60sPfTazELadlAMx63a2AGB5/04n1OLGbuwniIqrO3hiPjgXUUd7RchFX38O0Jm51RAgPNsa6UKBsOkBnOAoxZaFBPWM5vWlQg993pbwDzee7CFsIneHCsj6zskx6froN6+Yh73QHLAghu0pf6g9wlLanow+1oYbfBMJc7iGYI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709590110; c=relaxed/simple; bh=3/t65CKOH2IM75rZtN+yfmvVZGp1YUepR4CA+qimXNQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=IbqHQEtqVtzAmzbTmtc99RQO09/OYYPUbegeSd4Os3xKNbT3qXk4sW5DpyqA8QY7eyIBUwZrL2GrjI9riLc7R3UynGQejqOP/X0Mw2UOYZH04/M/CGZ9VBYlBYUVZET1GzgGRVJ2USBO3TKFlrtgIgoS7avzV+dYhKeGpHFNANs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ipylypiv.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=mm3o2EGL; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ipylypiv.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="mm3o2EGL" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-60971264c48so69492307b3.0 for ; Mon, 04 Mar 2024 14:08:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709590107; x=1710194907; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=sk3CpW1nBlC9B2u3M2hZXqAOuqsrucoph9Nx8BkR6sY=; b=mm3o2EGLjKCvgfOjTd5TwuJ7fAFYzkmhabYRif73iE1bQrJGc3lu3uxcqR82e7QHz2 ZS6rQy8WZFZfcDUaZtgyIPMNSelAngJ3OJ629soDnktXAam3nlj4JH8scLxWlLDA0321 wi9V7PFb5uISCqHpCM5ttxprcSnwJ5n7PXzgmaQNjPZI//zgPl60isX8kk/kEMt+ypSS ZNoogYzc145NV1d70SCIrDyuYykf8JMRmCyvLXq/I8dTlhXXQWcy/8EVAoPeZF1oJIRs U9zfkTwT/eDEh4VCsmvJKK8/9cdkY5/ExL6p+hIc8bf6R1jY6GqdzLMfu4EwfKHFRtQH QB8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709590107; x=1710194907; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sk3CpW1nBlC9B2u3M2hZXqAOuqsrucoph9Nx8BkR6sY=; b=tSGngmvs0FITu5YEIz+EnJRsH1h8dCeueIDP/qkC99O3XMbVJIPwXZWWXBZSFS/h6p v7k0xyD1Rf051FQycvG9Iks3ZDuxRnFjKZHa7JH3USXkFVEUpvxono88XgjBq+p95DOU j+L7i6Vht4Ajnhrqx79scmnD9UMIZvFGwJ7p7zDhGw2OYEIB7ao35zoBaqI5GdQ1hyVc FYfsxE3zyApJY+ztkwP3fS5eUQppujVwpsU6sbudbiopcnJfN0RL1cd2Zpa+5sjVsz2+ 5zhI7fuLgEOskyRO4sSk1LoLypRqpNQFlSX8i7iZQbya50NUuZdLWfvYVPsx/uEB39mA uV0A== X-Forwarded-Encrypted: i=1; AJvYcCXaDvmKocQ1CqfGFyE/Vnr5mXm+klz7s9axOXSEUs7oRyDLhJvY7XlWEmEPBcXkZMM04qA7xcoNQv2SHmEmZUdYv6ZAs+Y+X4B9Wg== X-Gm-Message-State: AOJu0YzAsyJwejrSJSspIgLlllB1A04FXL+JPWX4M1S0NKdvQXQkaYsK l0LYhb6Zx+JKWFrh8pM2QTMv2ProW6D/9DKJniAaAC+EnB6X0ZsJ6bEk6g2xutPcrh5iXmdlxPi 3J1WQ4aNM8g== X-Google-Smtp-Source: AGHT+IGbrVs/xGjoy/8mD2A+QYmJDL7JVA1UBnSzKmsnIwl2Xr2YOnQasS8U5287oSsOsBSxoeeXBH71ukNoSw== X-Received: from ipylypiv.svl.corp.google.com ([2620:15c:2c5:13:e901:e760:20cd:d870]) (user=ipylypiv job=sendgmr) by 2002:a05:690c:3581:b0:609:4293:23eb with SMTP id fr1-20020a05690c358100b00609429323ebmr2224960ywb.10.1709590107631; Mon, 04 Mar 2024 14:08:27 -0800 (PST) Date: Mon, 4 Mar 2024 14:08:10 -0800 In-Reply-To: <20240304220815.1766285-1-ipylypiv@google.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240304220815.1766285-1-ipylypiv@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Message-ID: <20240304220815.1766285-3-ipylypiv@google.com> Subject: [PATCH v4 2/7] scsi: libsas: Define NCQ Priority sysfs attributes for SATA devices From: Igor Pylypiv To: Damien Le Moal , Niklas Cassel , John Garry , Jason Yan , "James E.J. Bottomley" , "Martin K. Petersen" , Jack Wang , Hannes Reinecke , Xiang Chen , Artur Paszkiewicz , Bart Van Assche Cc: TJ Adams , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Igor Pylypiv 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 Signed-off-by: Igor Pylypiv --- 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))) + return -EINVAL; + + rc = ata_ncq_prio_supported(ddev->sata_dev.ap, sdev, &supported); + if (rc) + return rc; + + return sysfs_emit(buf, "%d\n", supported); +} + +DEVICE_ATTR(ncq_prio_supported, S_IRUGO, sas_ncq_prio_supported_show, NULL); + +static ssize_t sas_ncq_prio_enable_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 enabled; + int rc; + + /* This attribute shall be visible for SATA devices only */ + if (WARN_ON(!dev_is_sata(ddev))) + return -EINVAL; + + rc = ata_ncq_prio_enabled(ddev->sata_dev.ap, sdev, &enabled); + if (rc) + return rc; + + return sysfs_emit(buf, "%d\n", enabled); +} + +static ssize_t sas_ncq_prio_enable_store(struct device *device, + struct device_attribute *attr, + const char *buf, size_t len) +{ + struct scsi_device *sdev = to_scsi_device(device); + struct domain_device *ddev = sdev_to_domain_dev(sdev); + bool enable; + int rc; + + /* This attribute shall be visible for SATA devices only */ + if (WARN_ON(!dev_is_sata(ddev))) + return -EINVAL; + + rc = kstrtobool(buf, &enable); + if (rc) + return rc; + + rc = ata_ncq_prio_enable(ddev->sata_dev.ap, sdev, enable); + if (rc) + return rc; + + return len; +} + +DEVICE_ATTR(ncq_prio_enable, S_IRUGO | S_IWUSR, + sas_ncq_prio_enable_show, sas_ncq_prio_enable_store); + +static struct attribute *sas_ata_sdev_attrs[] = { + &dev_attr_ncq_prio_supported.attr, + &dev_attr_ncq_prio_enable.attr, + NULL +}; + +static umode_t sas_ata_attr_is_visible(struct kobject *kobj, + struct attribute *attr, int i) +{ + struct device *dev = kobj_to_dev(kobj); + struct scsi_device *sdev = to_scsi_device(dev); + struct domain_device *ddev = sdev_to_domain_dev(sdev); + + if (!dev_is_sata(ddev)) + return 0; + + return attr->mode; +} + +const struct attribute_group sas_ata_sdev_attr_group = { + .attrs = sas_ata_sdev_attrs, + .is_visible = sas_ata_attr_is_visible, +}; +EXPORT_SYMBOL_GPL(sas_ata_sdev_attr_group); diff --git a/include/scsi/sas_ata.h b/include/scsi/sas_ata.h index 2f8c719840a6..cded782fdf33 100644 --- a/include/scsi/sas_ata.h +++ b/include/scsi/sas_ata.h @@ -39,6 +39,8 @@ int smp_ata_check_ready_type(struct ata_link *link); int sas_discover_sata(struct domain_device *dev); int sas_ata_add_dev(struct domain_device *parent, struct ex_phy *phy, struct domain_device *child, int phy_id); + +extern const struct attribute_group sas_ata_sdev_attr_group; #else static inline void sas_ata_disabled_notice(void) @@ -123,6 +125,10 @@ static inline int sas_ata_add_dev(struct domain_device *parent, struct ex_phy *p sas_ata_disabled_notice(); return -ENODEV; } + +static const struct attribute_group sas_ata_sdev_attr_group = { + .attrs = NULL, +}; #endif #endif /* _SAS_ATA_H_ */ From patchwork Mon Mar 4 22:08:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Pylypiv X-Patchwork-Id: 777931 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70A817C0A9 for ; Mon, 4 Mar 2024 22:08:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709590112; cv=none; b=OBwIPKUID1fuVaHirv0yo3sJ9YaFa2WwRcHft32HBE8E0NeVO9qsAbDUadA45qVwnB6HJHrsIc4W+DFm5S+wTBdqEyrblpXBT6svleMdmPpLsziB6m/KrGa1759dm+6Sdu9UfUGX5G6vdA84vP3n2Tlsp/LRhabDJuMLtfBIr+0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709590112; c=relaxed/simple; bh=4eQXovcqrUDWoGBWOuiv3q6lQ/J5LYDMhi5YjcOJ/04=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=pE3TU1C3Xpouhk26NYGnmJeYueo3Em2OuMImUD/uVu+iTGKtmMjgXdDYsSym6bFZmnIw2HsnKgLzPbCq5M9JemF8g0nn4qA0GxsVz6nHnnx0ZEDhWYOuUU9UqqavKcxgeg91e8tFtmmtcaY9ozXpUylQdTGDNpKhWnULJ4vxsmc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ipylypiv.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=dQpeHjQ7; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ipylypiv.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="dQpeHjQ7" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-607e613a1baso87442447b3.1 for ; Mon, 04 Mar 2024 14:08:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709590109; x=1710194909; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=wUKdE6MTHBYVYLvqGpfj3dqBxke0cNrMBiaXjFQf2rA=; b=dQpeHjQ7QA1pIn72m6EPynv0sAURg/7YHYkUXYOYH7v4eiqXDr4HbB+wkkKeWBe5Kg GfPVdgiDgJZvZ/vodAYi6cXnd1+Ofv3QPq7Slgp+QLqdYUhWZbSxnZbPayw3+MCJ+jCj /5tvEqOsAy1KxicWnfc3zQvTxMYaqeab1fextsOe7IANm81qC1JxdrjOcfn5K9bvmemU /XY7rVnEypG4dEFyjqXyFk4KOEv517xPRNPWw5bAyzUMUxGo54RccMcr525HMofP6+5p jPJmEUgJhYVpmMtMQW1z7ezDyttaBaJ4jrQNMpsnla3mjQoBSl7MAq2aN31WvKRCAi6Y LiWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709590109; x=1710194909; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wUKdE6MTHBYVYLvqGpfj3dqBxke0cNrMBiaXjFQf2rA=; b=CCcIFvUdiqTVZGlbRrA2F+7bM1vUmW5oAsOOJsl85M4IGjn1CnRX16W7beosNf1Qze yYOT7LgNucpnQPYaLG7vrGO/sepXsuYmKPccevh53aEFhYCzRZ5g6SO9M588vjbOwkEb b7xc5y4XgNhzY9BXMhaUVGZ79CmfOxo97D67ji59V72+S1aVUc3059N6aq4EB/LQsiXU xCi41oQaV8sw0ldbZI3s022yqJeLPt6FqRwHha4cXuK5sUFMJoh6vvmiXH8w/Pucrmfl 4Kg3iPjEqabaz2k72iU4kp1NoNqGlXpr7GHden/sDFdeRI6UlOYBD1usEdMLeLDXSdly 4Mzw== X-Forwarded-Encrypted: i=1; AJvYcCU/VSdIrMk25kvakUuHfqnu0ESJbVCGB1yVu7mhqJU0I26NqIXLwU3Z82eJ6UnzTAyOEJRlGGUSTN13ebXrKGRtbkhN3iLRH81sMQ== X-Gm-Message-State: AOJu0YyymB0VqNiur4NLGosC4Qec4/VaqcZpPF6OXbHYwAdzY9SO5hpM BJdECT+VWdRuB+Q4nBjc5+beMBy837oxNt8+mtfYn2KujoacH4pNiM/qqkGwFLKn49wqMNW4+wq c2ys4zIsKjg== X-Google-Smtp-Source: AGHT+IE8lX6WVuWWnn+9WEDVf2LWVefLzFHcWIYYTkcxD81I7BR8+w/C+POVnwC/z3ALXprVXAPmFcSXSykyhA== X-Received: from ipylypiv.svl.corp.google.com ([2620:15c:2c5:13:e901:e760:20cd:d870]) (user=ipylypiv job=sendgmr) by 2002:a81:98cf:0:b0:608:bee6:150c with SMTP id p198-20020a8198cf000000b00608bee6150cmr3168816ywg.8.1709590109648; Mon, 04 Mar 2024 14:08:29 -0800 (PST) Date: Mon, 4 Mar 2024 14:08:11 -0800 In-Reply-To: <20240304220815.1766285-1-ipylypiv@google.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240304220815.1766285-1-ipylypiv@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Message-ID: <20240304220815.1766285-4-ipylypiv@google.com> Subject: [PATCH v4 3/7] scsi: pm80xx: Add libsas SATA sysfs attributes group From: Igor Pylypiv To: Damien Le Moal , Niklas Cassel , John Garry , Jason Yan , "James E.J. Bottomley" , "Martin K. Petersen" , Jack Wang , Hannes Reinecke , Xiang Chen , Artur Paszkiewicz , Bart Van Assche Cc: TJ Adams , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Igor Pylypiv , Jack Wang The added sysfs attributes group enables the configuration of NCQ Priority feature for HBAs that rely on libsas to manage SATA devices. Acked-by: Jack Wang Reviewed-by: John Garry Signed-off-by: Igor Pylypiv --- drivers/scsi/pm8001/pm8001_ctl.c | 5 +++++ drivers/scsi/pm8001/pm8001_init.c | 1 + drivers/scsi/pm8001/pm8001_sas.h | 1 + 3 files changed, 7 insertions(+) diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c index 5c26a13ffbd2..9ffe1a868d0f 100644 --- a/drivers/scsi/pm8001/pm8001_ctl.c +++ b/drivers/scsi/pm8001/pm8001_ctl.c @@ -1039,3 +1039,8 @@ const struct attribute_group *pm8001_host_groups[] = { &pm8001_host_attr_group, NULL }; + +const struct attribute_group *pm8001_sdev_groups[] = { + &sas_ata_sdev_attr_group, + NULL +}; diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index ed6b7d954dda..e6b1108f6117 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c @@ -134,6 +134,7 @@ static const struct scsi_host_template pm8001_sht = { .compat_ioctl = sas_ioctl, #endif .shost_groups = pm8001_host_groups, + .sdev_groups = pm8001_sdev_groups, .track_queue_depth = 1, .cmd_per_lun = 32, .map_queues = pm8001_map_queues, diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h index 3ccb7371902f..ced6721380a8 100644 --- a/drivers/scsi/pm8001/pm8001_sas.h +++ b/drivers/scsi/pm8001/pm8001_sas.h @@ -717,6 +717,7 @@ int pm80xx_fatal_errors(struct pm8001_hba_info *pm8001_ha); void pm8001_free_dev(struct pm8001_device *pm8001_dev); /* ctl shared API */ extern const struct attribute_group *pm8001_host_groups[]; +extern const struct attribute_group *pm8001_sdev_groups[]; #define PM8001_INVALID_TAG ((u32)-1) From patchwork Mon Mar 4 22:08:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Pylypiv X-Patchwork-Id: 778247 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9AC47D086 for ; Mon, 4 Mar 2024 22:08:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709590114; cv=none; b=XZMPOKoT/4FaeD9MEnKlovTZWbgX3s05Q87hYRFA8PyCN4r5s9Y0xvY6ghwFKXbBQyR3eC2eaRX4BZyu1RnVP7M6Xr8isibuARLrC5vhEONgLLzHwzerhZRjAy2VxqpQJdvr9VvXSzjMH7+GLDL28xXtIq07wqRZ2WJk/olf1vg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709590114; c=relaxed/simple; bh=7lui4HEwt3nyzuBq3kOGgxhbVfQ4kTvXlTnHRxF4y2g=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=P88vwo5fZvUN6KG3PyIt+9XBpNXY9XbbbbM7V6vxA0Q/337rsCfrg8yHt/XpC67Pk2QOwk1w5TK8f8GG2lnL0YM16CTZUfSRpGLyC5e/vEMcV0dAhJ7MlnJCKTdEHHttWQT0N/bxzi7jKjs0n6B8t+WStaixbzDeBJkyfzWXUYE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ipylypiv.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=OyE/bcIB; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ipylypiv.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="OyE/bcIB" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dd001f821caso6144763276.0 for ; Mon, 04 Mar 2024 14:08:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709590112; x=1710194912; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=fllhBTjW6GX9iEnv/LwNN/tFNgKMHmXcnmtxo/1RJIg=; b=OyE/bcIBE9zeJ/Bm0iuOrgXR/lfkIGCqbljW+669V6DIikYmROin9LG7goN/I+b1s2 PBjjWjYK0kMp3ezTV6VPVPoh/rrzORxIMi8F9vCxLKOnfRM7Tien7sU/ywiYMZP+3V96 j44FvMTXl0ojTaG9VeepmRf0cjjQneTS7A4Jpby24hqq7pY5pcY/j6zCq8NJWg16Cxn6 B6ztXIcXrUXmWRJwBAoAguW4D0thCdddkP3KrxPHD5O1VrJ5Gc676hae7ohrCYftAb5k e+8Znkp0lO01iIzbFvsmjoxJAeZ9onKBgWMhuwBBq+E5/Zr4QW2w97OjpZ+xjdtFiyl8 WP9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709590112; x=1710194912; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fllhBTjW6GX9iEnv/LwNN/tFNgKMHmXcnmtxo/1RJIg=; b=TUTycutJFONJNaCrPDZwDonnCsfHZAjpgwODmc7sW7hzwxO1sf9lSSOaYemoC6QaRu nNOvXT55X1PwQ/MjI3u61Hgh+dljiVJmfi5PW9Y7Mj8hsj6OYFzO5uaMzYVa4jiel+Mu DJkDfjq0GEVqSVUft0V8hUI8EZ3+X4wqq+mBfZ1r28D2+7zxeSkkn35X0rNLn3n9Y4us 5ErJyWXy9qinQ2LjCX2PsUx1lcVRdPptTZzss5UoHTO+TAi3bs8KuxOTHXHOU1kQyA7k d54/24EPybFgE3JMd1NqbSCNR2h91zeW5sqRNpR5lQ4qrZWYz41Nz/z05K6NYv8EE0zR oZGg== X-Forwarded-Encrypted: i=1; AJvYcCVcyaOp1g2SXlOXMGX+m2eDo/LD9ZQF4K91Ad0eDJFn574Ga/ECxppWkK761FAklaylR0L9rSEGK0LIaCtcBriDtd6RmaAYpSjC1Q== X-Gm-Message-State: AOJu0YwQIk1PqXEC2joKub0E0ZdWsTHykd7h0LWUt6dGbt2p45NAe1HX dEtWhJ67vhY60Ba5plu6WFBXykidLdxb1qu+Yq71pMoW/MMxyTeQCcsfPzHohdFvgpASIX72pKd HsB/OcV5u3w== X-Google-Smtp-Source: AGHT+IHptqL+KH146p/jJHXv8G+GG/vYikPUWRaYAjtq0JMV4p7qsJi+Ner0U+3RmjBfP4O7X2Cx+gNL7fNivw== X-Received: from ipylypiv.svl.corp.google.com ([2620:15c:2c5:13:e901:e760:20cd:d870]) (user=ipylypiv job=sendgmr) by 2002:a25:8a87:0:b0:dc7:463a:46d2 with SMTP id h7-20020a258a87000000b00dc7463a46d2mr158322ybl.0.1709590112026; Mon, 04 Mar 2024 14:08:32 -0800 (PST) Date: Mon, 4 Mar 2024 14:08:12 -0800 In-Reply-To: <20240304220815.1766285-1-ipylypiv@google.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240304220815.1766285-1-ipylypiv@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Message-ID: <20240304220815.1766285-5-ipylypiv@google.com> Subject: [PATCH v4 4/7] scsi: mvsas: Add libsas SATA sysfs attributes group From: Igor Pylypiv To: Damien Le Moal , Niklas Cassel , John Garry , Jason Yan , "James E.J. Bottomley" , "Martin K. Petersen" , Jack Wang , Hannes Reinecke , Xiang Chen , Artur Paszkiewicz , Bart Van Assche Cc: TJ Adams , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Igor Pylypiv The added sysfs attributes group enables the configuration of NCQ Priority feature for HBAs that rely on libsas to manage SATA devices. Reviewed-by: John Garry Signed-off-by: Igor Pylypiv --- drivers/scsi/mvsas/mv_init.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c index 43ebb331e216..f1090bb5f2c9 100644 --- a/drivers/scsi/mvsas/mv_init.c +++ b/drivers/scsi/mvsas/mv_init.c @@ -26,6 +26,7 @@ static const struct mvs_chip_info mvs_chips[] = { }; static const struct attribute_group *mvst_host_groups[]; +static const struct attribute_group *mvst_sdev_groups[]; #define SOC_SAS_NUM 2 @@ -53,6 +54,7 @@ static const struct scsi_host_template mvs_sht = { .compat_ioctl = sas_ioctl, #endif .shost_groups = mvst_host_groups, + .sdev_groups = mvst_sdev_groups, .track_queue_depth = 1, }; @@ -779,6 +781,11 @@ static struct attribute *mvst_host_attrs[] = { ATTRIBUTE_GROUPS(mvst_host); +static const struct attribute_group *mvst_sdev_groups[] = { + &sas_ata_sdev_attr_group, + NULL +}; + module_init(mvs_init); module_exit(mvs_exit); From patchwork Mon Mar 4 22:08:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Pylypiv X-Patchwork-Id: 777930 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E4387E105 for ; Mon, 4 Mar 2024 22:08:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709590117; cv=none; b=fwU98qsKkMmegkWdKIqgidQAIXRne9mlQMB1VN5E29f3wY/YAiVlxB2MouuBaYtNknzIlfsUECOpTAYT6ymwjqpe3J2pJuPhZFSH1pgmjEvPRbnGe6ld6kuVpQisIR2JmP0UzC5F26fRyXFUvS3Sk19FLxWM85EQkmtiik11Ueo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709590117; c=relaxed/simple; bh=SbjbdjZWUXBzT2LxbKT4DNqotCfdqsZJ3zhnbS10R1g=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ilPlkgJBteSbmeXwJA1JT04at663s7DlUJdPoYywbG1bxfIrKPlUrkLN/d+qFXIm24AcvXZS3j5CqCzAINHhagv0vMVgrqru3iL2KhS9XKG9Ej3l2Eu4uNmPNy6y4zGQpknGhxholztvh67kKZ5Rq+a5xB8VJ8uE54jt/pSvIx4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ipylypiv.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=YFF2GFFk; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ipylypiv.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="YFF2GFFk" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-60942936e31so89101337b3.1 for ; Mon, 04 Mar 2024 14:08:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709590114; x=1710194914; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=u66W4yA8M+KF0Llg68xH23MwaMjWX70CKgHvWJ3oECY=; b=YFF2GFFkect0CcmJBk6glB9KZUeLUXgxIcsgpYgUr8T2Vq4vqlCF+bQLvgOP1ZTmtO GF7PseOy70CcoeozA+NodicCvjCi+rtuVIy6j9QTUlHIRgzSNRCJOK6jHc+/GfpgvGJr FerfHqQupkyZadxBDohuqNYYH6jGkcZUKDuRO6pZfTCt4UoPI+siEvXAz2ud89LpsCOg D8zyHD20UKBwW7Ow458+3eBrPUp7ryWU81E7SPRMPXM/Jw6gh+L8yxnLl1KGi/nDI0mj IHxLHI710sjYLhN/TsbzlWye5+YAH5no1nS5CdLpcpLiSMzXtUvCJAH1thNdKgRp27yL sRYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709590114; x=1710194914; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=u66W4yA8M+KF0Llg68xH23MwaMjWX70CKgHvWJ3oECY=; b=u25wP7yX8H0+Z+DhXSoC6H97KGcYcZotlOtIguOIqRFVyUMYuFpSFJetcS5k1uFyOW VhmxZjdbykjSyH8Wv8P2iLwosp/kFb5SVSkge3hgAhqC4bjZpNNwIX7EfB2kGITuhhaG BQag68raNyZwnEwr5RQPBBzw8Kl9DNmZ1gOfFggXREQWSg9KZbEm5OlottYZX8Zqlpep WtdDS0+JpzsOjVlrIDlB6SG5DHVwqTkqQKLpiMdwOjsdzwch7m7cPRqnqbBtJxXEHfbI +W2NFtoWnxis6AuStAHh5pr8P93oAnvF60Lzs8W2siD3nD55AbqWrmDJgJNPpDwdVAwc 1iPw== X-Forwarded-Encrypted: i=1; AJvYcCXgR41TlnnctYN/0CNfXQ+DnnDV8bD9WnCzdIF3yr1Oqbo4RYLimfyAoQPtmnKG+myE2m86j0ZCKUiQcIPrnf6bVMEgQCPjgMkogg== X-Gm-Message-State: AOJu0Yw4jp34YwTnWVUcs4SPlHf3E0UgqOl+gzV6yRqHFtSU+KkrvoAV eLiwS/ZX1tHLv1J6akkygPnegsLIWLaEU49Ph1BK0kaaU1/E8vKHafDRQet/EDmTC28v9iTbqth 9J444Jjt8iw== X-Google-Smtp-Source: AGHT+IFZfyS+uFwGZLzMHFOeD5UY68eEdzKNnsQfushZQwAV/48zAAnVPGQYWTjxCo6N90NONLdqyIYTRFvRSQ== X-Received: from ipylypiv.svl.corp.google.com ([2620:15c:2c5:13:e901:e760:20cd:d870]) (user=ipylypiv job=sendgmr) by 2002:a25:abc2:0:b0:dc6:e5e9:f3af with SMTP id v60-20020a25abc2000000b00dc6e5e9f3afmr2651172ybi.9.1709590114389; Mon, 04 Mar 2024 14:08:34 -0800 (PST) Date: Mon, 4 Mar 2024 14:08:13 -0800 In-Reply-To: <20240304220815.1766285-1-ipylypiv@google.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240304220815.1766285-1-ipylypiv@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Message-ID: <20240304220815.1766285-6-ipylypiv@google.com> Subject: [PATCH v4 5/7] scsi: hisi_sas: Add libsas SATA sysfs attributes group From: Igor Pylypiv To: Damien Le Moal , Niklas Cassel , John Garry , Jason Yan , "James E.J. Bottomley" , "Martin K. Petersen" , Jack Wang , Hannes Reinecke , Xiang Chen , Artur Paszkiewicz , Bart Van Assche Cc: TJ Adams , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Igor Pylypiv The added sysfs attributes group enables the configuration of NCQ Priority feature for HBAs that rely on libsas to manage SATA devices. Reviewed-by: John Garry Signed-off-by: Igor Pylypiv --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 6 ++++++ drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c index 73b378837da7..b5d379ebe05d 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -3544,6 +3544,11 @@ static struct attribute *host_v2_hw_attrs[] = { ATTRIBUTE_GROUPS(host_v2_hw); +static const struct attribute_group *sdev_groups_v2_hw[] = { + &sas_ata_sdev_attr_group, + NULL +}; + static void map_queues_v2_hw(struct Scsi_Host *shost) { struct hisi_hba *hisi_hba = shost_priv(shost); @@ -3585,6 +3590,7 @@ static const struct scsi_host_template sht_v2_hw = { .compat_ioctl = sas_ioctl, #endif .shost_groups = host_v2_hw_groups, + .sdev_groups = sdev_groups_v2_hw, .host_reset = hisi_sas_host_reset, .map_queues = map_queues_v2_hw, .host_tagset = 1, diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index b56fbc61a15a..9b69ea16a1e6 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -2929,6 +2929,11 @@ static struct attribute *host_v3_hw_attrs[] = { ATTRIBUTE_GROUPS(host_v3_hw); +static const struct attribute_group *sdev_groups_v3_hw[] = { + &sas_ata_sdev_attr_group, + NULL +}; + #define HISI_SAS_DEBUGFS_REG(x) {#x, x} struct hisi_sas_debugfs_reg_lu { @@ -3340,6 +3345,7 @@ static const struct scsi_host_template sht_v3_hw = { .compat_ioctl = sas_ioctl, #endif .shost_groups = host_v3_hw_groups, + .sdev_groups = sdev_groups_v3_hw, .tag_alloc_policy = BLK_TAG_ALLOC_RR, .host_reset = hisi_sas_host_reset, .host_tagset = 1, From patchwork Mon Mar 4 22:08:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Pylypiv X-Patchwork-Id: 778246 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B4287D09D for ; Mon, 4 Mar 2024 22:08:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709590119; cv=none; b=YwezhRghvBp4H+zC0B2+kgTcocA0TKW39fEc0bz9rk2QFvPZ8V85IAeUj9wgfWRjOpX6rrDyecO3lHfgTjDw/yFnU65HruVYr16WTCWu7X3bhsuVP9aZFdYczAbM8ftYGm9InhdwFUDW7+A4gb9JC6MOCUqgcX8XCYFFj27Sclg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709590119; c=relaxed/simple; bh=+W8+jAS8TcKEHOvO1hK8FP573ZHzjv14SAApm78n2C8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=s1Os565UWi7ZGbY1GhGCQVXUSefWbhI0WQNzCQeCs+cOdgRQ5RMgywj7GYmtlTlqt642aEC7CsABgXBROkER0quD3Kw8ql9uADo2tN8szNi+EUwkpLZweDTmbJTdLSMRvF70NFEOVTDz1nF/POlNjzUYvuZwKzfeQt01zlCbtWU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ipylypiv.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=jq5CMMTs; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ipylypiv.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="jq5CMMTs" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dc746178515so7181617276.2 for ; Mon, 04 Mar 2024 14:08:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709590116; x=1710194916; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=a8s/WnKeWQhMXiOREl+4FjUl4dsbGRC/O45o0rQHXl0=; b=jq5CMMTszGoc6KtHjXu93dCbv3ZkNK7hKQopicErzvbiRtfHSNUprthlrLj/DJuW76 x7USHaYPNSEtnRaXd3+V1Vl4FNjcVvB+mqjSCesUMVbPUG4rAzcIH0raALcUCIUTaUoR cfF4TR/sv9PPn5Fmc6EedOMNL2msewbB8DTlj64ZWP2AnckqGsciK21fagPnysEYIEz9 v2L1dA+aFC8JTGV+85yQlligmwTwyIjW1dcM/pzbD9jNPKi1XEDXaeK9sqttZi1m0ddL mF3lJ5w1FQacQ9f64c4zKxp+KfPTkZn7WlU+5ivrIrfaoiqCcrSJrnCv19oAedDAIfC5 5xHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709590116; x=1710194916; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=a8s/WnKeWQhMXiOREl+4FjUl4dsbGRC/O45o0rQHXl0=; b=u0A/W2BE0YehwfjedYK474GCyJPpfejuVdjrfutLyfolmnQKZTkt3Drxsel0rrpFfi VQ+S7zEt2xCbPcmDyEJkvODq7B30IGhZF4qiBZqn7h6HtreCck7nAMHwGgUi+9wFrRkt ecKKbQnEtGy0ZtS9xL95JzWFtJ6HmenMhLKbVxIMHPK884j1B33blj86PpSG+RiRPX9s 9llNMNHVT9CmoE10WP9uZ0cBzbRdtxV8bebCMz7YVQ2+xs1dcbIdaXQCa9HJf8sG5y9i F3vNqRu1JfbHEcazc5w2XRjZzJ3yWIgBTZNTv0K2wY+siTZBOc6MaAHUZAatrsPWhDLL 4tyg== X-Forwarded-Encrypted: i=1; AJvYcCWpmTbPN1vUDvOnPMY5oY/U/Xez7dvQ/KI298qKJ5ZP4MdUJ8OZWrhX/AwA2bozgAfKfIRoMkdC/Wx0AKz+Vl9KWdMMcJZA4RoBiA== X-Gm-Message-State: AOJu0YyNKwgUjjlCZijBlw8xLg23spJXsl7F9i187pPT+vjPxO658anN hc8yCG49CQVjkVbtblXGc4mgvFsOO6fDziZv2wVhaGLTB2X99NUUYd+WRmxU2ydCD12uD5Tg7QE u3lUoh0RpWA== X-Google-Smtp-Source: AGHT+IEBxY4gG1avJfrX23Im3p+o1GJRwp1gaa7HUGf3AiaFkIi5rLcnT340Q/8auSlTGt7JW3Xn5y3De4hTRw== X-Received: from ipylypiv.svl.corp.google.com ([2620:15c:2c5:13:e901:e760:20cd:d870]) (user=ipylypiv job=sendgmr) by 2002:a05:6902:1004:b0:dc7:42:ecd with SMTP id w4-20020a056902100400b00dc700420ecdmr2634387ybt.6.1709590116613; Mon, 04 Mar 2024 14:08:36 -0800 (PST) Date: Mon, 4 Mar 2024 14:08:14 -0800 In-Reply-To: <20240304220815.1766285-1-ipylypiv@google.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240304220815.1766285-1-ipylypiv@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Message-ID: <20240304220815.1766285-7-ipylypiv@google.com> Subject: [PATCH v4 6/7] scsi: aic94xx: Add libsas SATA sysfs attributes group From: Igor Pylypiv To: Damien Le Moal , Niklas Cassel , John Garry , Jason Yan , "James E.J. Bottomley" , "Martin K. Petersen" , Jack Wang , Hannes Reinecke , Xiang Chen , Artur Paszkiewicz , Bart Van Assche Cc: TJ Adams , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Igor Pylypiv The added sysfs attributes group enables the configuration of NCQ Priority feature for HBAs that rely on libsas to manage SATA devices. Reviewed-by: John Garry Signed-off-by: Igor Pylypiv --- drivers/scsi/aic94xx/aic94xx_init.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c index 8a3340d8d7ad..ccccd0eb6275 100644 --- a/drivers/scsi/aic94xx/aic94xx_init.c +++ b/drivers/scsi/aic94xx/aic94xx_init.c @@ -14,6 +14,7 @@ #include #include +#include #include #include "aic94xx.h" @@ -34,6 +35,7 @@ MODULE_PARM_DESC(use_msi, "\n" static struct scsi_transport_template *aic94xx_transport_template; static int asd_scan_finished(struct Scsi_Host *, unsigned long); static void asd_scan_start(struct Scsi_Host *); +static const struct attribute_group *asd_sdev_groups[]; static const struct scsi_host_template aic94xx_sht = { .module = THIS_MODULE, @@ -60,6 +62,7 @@ static const struct scsi_host_template aic94xx_sht = { .compat_ioctl = sas_ioctl, #endif .track_queue_depth = 1, + .sdev_groups = asd_sdev_groups, }; static int asd_map_memio(struct asd_ha_struct *asd_ha) @@ -951,6 +954,11 @@ static void asd_remove_driver_attrs(struct device_driver *driver) driver_remove_file(driver, &driver_attr_version); } +static const struct attribute_group *asd_sdev_groups[] = { + &sas_ata_sdev_attr_group, + NULL +}; + static struct sas_domain_function_template aic94xx_transport_functions = { .lldd_dev_found = asd_dev_found, .lldd_dev_gone = asd_dev_gone, From patchwork Mon Mar 4 22:08:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Pylypiv X-Patchwork-Id: 777929 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD0C87EF0F for ; Mon, 4 Mar 2024 22:08:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709590121; cv=none; b=lChXoxc3UKSPtpFocagDOjDp5jGkTXRzJ8H51uZnQulduiNMT/mjvf+xQ0GoRwFdnWnnzrsino2txvDu62+4d/h37q8uS0jhFPCiKFRro6C1jooOt21M5T09TY8NW5YZ/09FrJcqY1omnbIUd9x7mL9E3kT/UmUC2r8A9ooZ3FI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709590121; c=relaxed/simple; bh=k2RsKVsqn0SP6W3+GcW/+9UaRpSxki2AedJQ+0T1tis=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=bvSXNh+xmNSOpVtbbJOaO17c8SOJ0V7hlLezI/Bh15Dr3BA8ieTyLScBG+EIao/B/VhP/mxA8Zgn4vx7EKhsM4BgHLqmAtLv0LBEgrfcGiQyGPn4C2O7PpnKrmdlD+2TWnGEh6oWt4HRVqRsxtYuW8ifN4fn29Jw0BHO9RAD69k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ipylypiv.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=4rcYLe3e; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ipylypiv.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="4rcYLe3e" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dc6b269686aso7380606276.1 for ; Mon, 04 Mar 2024 14:08:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709590119; x=1710194919; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=9BOHqZcuLWtFyhT4gaG3Cu9uWAk1ebaqFWaPcojfGUM=; b=4rcYLe3eKUErXai23zunRAGizqBe2Zj1IhUCSk00l+gyZc6OtX7u0H78rboYT/DtD/ vINoZT6ZkkkY2xJRReZAbBHXWymHFSRSc5+ZYtMpjD2/OV8+QIGqblDoy65c9ibp8Q6Z 7FlS2bDBRxmCvxKQ5EzPcLkhZQQYK7zoxnTqfW7Nc14xN2hDPaYalkkEYX6+bfyYcdae KOlHMZhI4poYEikDdJ0zg4ZPT/kIcpsrdmvHHUkSU6QwZS35sQZZuT1TOxlMeId3HWni 9iitkZd4xSIx5dHNVihsPKCrTrtZ6EhxZGQZ0cICF+bZ7Gs3nT5K25jo6AQPanN56T+F fmnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709590119; x=1710194919; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9BOHqZcuLWtFyhT4gaG3Cu9uWAk1ebaqFWaPcojfGUM=; b=vmIkmP2xhHpCSMw0bmF78qA9Kg0i91Xo9DOKhLaFIyiaIRBmk8md/SJqjRkKAT8fuq bYcNL/BcEfXz2T4iT0UVHVdQXD68zlW0U31XE0B09L+Vn4MlUwyPYBXrSaf4VKcmdr7o 1Hmft6tpNMoCurdp0Gva3yfyVd+0+knMhd/sTdQEroilSfLnN/86l7U0yIU99KKdgm/a HHOiT9s84cyzpQU0dH2dn8UfB19f38FlBg78KVRqQu/tZ9ZTts9+/imyDrKs1fttNYvS pWsa2e/460GI2cUPMUkVoRxdWl12rtG1q9j9cDCahZGr6rkFKwgPZtKif8chxQzUGXzA 6JfA== X-Forwarded-Encrypted: i=1; AJvYcCXfA8yo2+FYrvMkL8iSuv2acE0tL4SAVjb+uA0PqAiQn9buNwyjOmQ8tWl+ATTGFmSXym8y9qKa6j8ENrSGVJGEDHFqs310nA4/+g== X-Gm-Message-State: AOJu0YyafS9Joci0RpNmVisacYkNozKYiRmIKKbYrxe2xjFZ9Bm8NYi5 5PelYLSFr6aTVUQ9i+DkG8PBJxh5A90rgLpTdUc3AEm6aMruH8mlGQjnJibNxZmT2BeJ2mSX/+S pG9zuxF0AXQ== X-Google-Smtp-Source: AGHT+IFKnkpuBehKxAI5KNP9ibb1U2ESkcGB5dQvh7Jo0lfObivCLCwOiAc4Lh6eu52G+uxOMieIcl2LF17sIA== X-Received: from ipylypiv.svl.corp.google.com ([2620:15c:2c5:13:e901:e760:20cd:d870]) (user=ipylypiv job=sendgmr) by 2002:a25:dc4c:0:b0:dc6:d1d7:d03e with SMTP id y73-20020a25dc4c000000b00dc6d1d7d03emr444115ybe.8.1709590118871; Mon, 04 Mar 2024 14:08:38 -0800 (PST) Date: Mon, 4 Mar 2024 14:08:15 -0800 In-Reply-To: <20240304220815.1766285-1-ipylypiv@google.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240304220815.1766285-1-ipylypiv@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Message-ID: <20240304220815.1766285-8-ipylypiv@google.com> Subject: [PATCH v4 7/7] scsi: isci: Add libsas SATA sysfs attributes group From: Igor Pylypiv To: Damien Le Moal , Niklas Cassel , John Garry , Jason Yan , "James E.J. Bottomley" , "Martin K. Petersen" , Jack Wang , Hannes Reinecke , Xiang Chen , Artur Paszkiewicz , Bart Van Assche Cc: TJ Adams , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Igor Pylypiv The added sysfs attributes group enables the configuration of NCQ Priority feature for HBAs that rely on libsas to manage SATA devices. Reviewed-by: John Garry Signed-off-by: Igor Pylypiv --- drivers/scsi/isci/init.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c index 6277162a028b..8658dcd61b87 100644 --- a/drivers/scsi/isci/init.c +++ b/drivers/scsi/isci/init.c @@ -149,6 +149,11 @@ static struct attribute *isci_host_attrs[] = { ATTRIBUTE_GROUPS(isci_host); +static const struct attribute_group *isci_sdev_groups[] = { + &sas_ata_sdev_attr_group, + NULL +}; + static const struct scsi_host_template isci_sht = { .module = THIS_MODULE, @@ -176,6 +181,7 @@ static const struct scsi_host_template isci_sht = { .compat_ioctl = sas_ioctl, #endif .shost_groups = isci_host_groups, + .sdev_groups = isci_sdev_groups, .track_queue_depth = 1, };