From patchwork Tue Mar 5 00:50:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Pylypiv X-Patchwork-Id: 778244 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 2D5578F62 for ; Tue, 5 Mar 2024 00:51:12 +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=1709599873; cv=none; b=rEnIxhppRvpwpl7PkZ2M1by91/6ibCBEe6gkb8F05fgHX7moxRLNsW2RmZiahWk87a/yzFaUOazRuD7ExwcIMCx/I8UQoJHfPTMP9GMWFQcPJcSOyePoORfgWB3dbl3u4xCDpxK4mssEF2ZJ/6a8MY9Iup2bQP97dPINWzhnfT8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709599873; c=relaxed/simple; bh=YTgx3WEe4nP8Np9FZNVT4X89BHfmUTsxsDDNkC5GZ1c=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=NmXxQLg/Jmtb0tZ99soMC9UujBa08m/qq1l7nSd9HZJs6ThwPZtU6cx86JztZdV4hI8cDHvn+bcFlsK9ObdZJfDfrR1UUp8gWnHzPWITIusCXPMVj7QlMrzj3XJCYHQ/Ri4SW6j4civg6troVdqrt+d0xyWXYO1qr2vB61w/3iY= 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=x9KHuD5s; 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="x9KHuD5s" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dcc0bcf9256so6527524276.3 for ; Mon, 04 Mar 2024 16:51:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709599871; x=1710204671; 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=4Rvi5ygT6WAyce3RYZ1KHwBcishPIpdItYF4EiC3R2c=; b=x9KHuD5sysZFEmVAIS3VKO8Sg/YFwZrLKm6i9lTjSXxJR7AaOTTwGuOK2J7DxPHCJh 0pBCZ+SxoHjQBY0CtIMw069uMQZwEsyv9Y/76yoh6MiJkTs3TV6FLtAHZv8u3aUUFq/1 5z9V6jPY86q+qbbCYGPcw2hsGQFTDFwYBb3wsgjLI0DtahEVWX6g1o8U3MUp87jKlpdN VfOXp42BvmqjflzzDYfyhnT11DIH7aVOLDCvMQZ+qHqRR13pIEYSp3DEVXgCXn05GjOJ f4EgYrdIeNcaqNeAx/002dVtm7L0y2TBDsK1SM7TBBKkIyB5q5/bFyZ7wqxBl1vCWzyh b1jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709599871; x=1710204671; 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=4Rvi5ygT6WAyce3RYZ1KHwBcishPIpdItYF4EiC3R2c=; b=NntWcEvuKpJaWSY9T4uGpVyttsT95ycc6Ty641ELVzB2RzX402DE17IxURfljSY+G0 KNT3YP53n/xDh8TANi98k7/fFt/nNX15MUaQjj9XNViNB54E36M2aBeqLLHdMtjjScGS inGfiCJLi5tfmzvRY5bcNyvgLEzI2FtisEUuFBjugJcDCcYV7Qr6bJeHuJAwN7BGbJeG SFYkvvfN7dK3NtJUTLLM6xUJunOs3Qqb+sgT7KLoq13ip741lCK0HAJZGfiBNtqdiJrZ xH4YCb4ixFqkopx5JjGCbL4gwtY8h9l4t/ANupqbKO8eWDAHXYM/qTxfIhvLnkTwia3z wA8w== X-Forwarded-Encrypted: i=1; AJvYcCWEFehQrEp1qmDBUpsC3hupSdmLcQDHRZUCrMScG6MZmH7VKdgdDVUNLmSe4wFflfbjl0eTLLHPqaj+RjuL+g5FqGLM6Ti51GT6ww== X-Gm-Message-State: AOJu0YzhJH7Z/QLrosdKlwsYZje+ipWWa8K6mXqPF4DmYUDADIu1d4W8 t1jDCXtNoqhQJ2ZyV3+7ERelyWYNod6JC8tLDZxgO5SaHVe4JpN/MEEszOgIKK3f+ryC3by0oBr 6D8FwsPGiiw== X-Google-Smtp-Source: AGHT+IFJjsZYiWXboDnHwWPLxZRDjqhfWxS4gVjqhuk3la2dYUeCqDR/H3YDuZseHOnChRDRlRD8ggqzL2MK6Q== X-Received: from ipylypiv.svl.corp.google.com ([2620:15c:2c5:13:e901:e760:20cd:d870]) (user=ipylypiv job=sendgmr) by 2002:a05:6902:154e:b0:dc7:3189:4e75 with SMTP id r14-20020a056902154e00b00dc731894e75mr362935ybu.3.1709599871454; Mon, 04 Mar 2024 16:51:11 -0800 (PST) Date: Mon, 4 Mar 2024 16:50:58 -0800 In-Reply-To: <20240305005103.1849325-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: <20240305005103.1849325-1-ipylypiv@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Message-ID: <20240305005103.1849325-3-ipylypiv@google.com> Subject: [PATCH v5 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 Reviewed-by: Damien Le Moal 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..04b0bd9a4e01 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_ONCE(!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_ONCE(!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_ONCE(!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 Tue Mar 5 00:51:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Pylypiv X-Patchwork-Id: 778243 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 A627AFBF7 for ; Tue, 5 Mar 2024 00:51:16 +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=1709599878; cv=none; b=UJZmzloiqTZfFwANeTfXAySo95jnIZ929W9pdzzxABYFUGnrpnyKlFwJMILbeuWejYjaurnAFyrNDffisH3uOI0XVssLzQsuUBV292lIaHBC24yidBx+d7eGXxIp5bP0MCCp09A20TL6ymLcpqy02+CrdQDfJV8fPWISrLUki2s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709599878; c=relaxed/simple; bh=aLtlNr+1l6B3hxzUR9P9kYxIKT0n3xMBf3jWVQlgYvU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=eVgVjMfqLbNO863oRnm9mQVtvtMRireSC2hSTlMwS8m97z8TIhDBrZBdawfxQ1tcXPH+yQHKxAOIapvK7vZTVdKb5LibinjTXFLeEHyD8eLsvXQaRtfQrgW8KN2u8YN92X7Ob+SPKhCUovWlTOsqgE5lLYPLCZ8e844Y+/awIdo= 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=oxGUfsj+; 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="oxGUfsj+" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-608ab197437so79596277b3.1 for ; Mon, 04 Mar 2024 16:51:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709599876; x=1710204676; 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=qnc29GOaNlgSeW09Vh8SN3Fp8isMCFvcbYSFbDWlfBM=; b=oxGUfsj+QYXgE92OqVw+J7XKAvJJxIWlBczs0LmObEqvHI6GaHZDaO23wfXpIZ6gVh 3w7hiAMtU2YEP5KVl/BmOS/Cf7AevdMlqD9estfdBJYOzlJu7PIDz+GP0VcxkVp6WWWf Bx0kNiisaeBo3bAFC6amsEvNfqu3T27E5ECbIPR9iDseoQmYhyg6UM84o7Vj9Mfk3PAb IAwXSWWe/LZ+YDeNOfI7viycluTff1IhK0UsBDq5eFAsM5GG2mMVik1z/+Z5W12nyLjX NSQMTQ236q36ld7Fb1s5lNQO9XxWkbb6DyK0kBxYCgnbumhT5eOEtKT1sQ+ExzSqte07 fh0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709599876; x=1710204676; 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=qnc29GOaNlgSeW09Vh8SN3Fp8isMCFvcbYSFbDWlfBM=; b=WfPBuvB2HsquTRn0iXMsNwxA4+H3NGyXyTmr1VrX2m2FONM1ZmNhzsltEBlD2dNYF+ k/ThMifR5Ht5fjS3dkAwCsr2eeRC8BSfK4mQnsG86J7z3uHGuKWSLzqHM214apPix59T +zsZiV50u2Dlno+3qpi8AlXWv4h7tljX/CiUXPlEDgVsgNtEyn5j8p6onMPQxa5InhBZ LnND4v+QI2Plg3NLL7sLNyOl6H5nHED52yOOorqDb3SblYCL/kb2GCp92Bw6rxmVqm7m qo5KKIWYXodUZkLeqlNRksxZBPUqhWf6KvCv5k3nQ0a4y+68pZaY8imCu3j/6Endtk7A CpWA== X-Forwarded-Encrypted: i=1; AJvYcCVXcJE7PKel+Y+PAo2lKZ6X8vOCbLZYznj/1fQ7uSGbGTf/GPzsf+xeoX1FCUk9LGgV36aDHSNjZCkjd0Cwk8waJ1A63alLGkKg9Q== X-Gm-Message-State: AOJu0YyB/PTkL5svgrype+X7FvLTnmsI0AmD3qa62tQicvoaPNvGEsCP wWMvLKCDwChcrJxVP8Vffc7INq2DbBmyEWy/qLgQMu6UkQKbt2WEZ9Bv6sqpMbq7uZoye0/NnQz Pqm0hGJ6U3g== X-Google-Smtp-Source: AGHT+IGZSbdF2pSwc+4EzWStbZeghU2//j/2zWX2HQSKUA0vm+Yo3YKGSF39AsfdaP2nXqgALpckPtLnyivnaA== X-Received: from ipylypiv.svl.corp.google.com ([2620:15c:2c5:13:e901:e760:20cd:d870]) (user=ipylypiv job=sendgmr) by 2002:a05:690c:fcd:b0:609:33af:cca8 with SMTP id dg13-20020a05690c0fcd00b0060933afcca8mr3011166ywb.2.1709599875824; Mon, 04 Mar 2024 16:51:15 -0800 (PST) Date: Mon, 4 Mar 2024 16:51:00 -0800 In-Reply-To: <20240305005103.1849325-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: <20240305005103.1849325-1-ipylypiv@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Message-ID: <20240305005103.1849325-5-ipylypiv@google.com> Subject: [PATCH v5 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 Reviewed-by: Damien Le Moal 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 Tue Mar 5 00:51:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Pylypiv X-Patchwork-Id: 778242 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 E32B812B71 for ; Tue, 5 Mar 2024 00:51:20 +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=1709599883; cv=none; b=a0xbpc4a/z2bRSa8zeyW1QJbx9Ff50HYZJfbMYGgjnxrAk1TWHk4ev7K3wy+izyq54SBz94JAK2BgwQKdsay2KgLqFs3cdndZpE4foksCC70QlKq94tQvyue536CpNZ5uIw6KnQuyLw/HmSfhglckZHRWL1tO7yq5RRe6T/2M4E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709599883; c=relaxed/simple; bh=l1B7DL+QxZKXAInqPgoxYQhQfMm3hZjNqcIgYcFRiA0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=eXmnBzpGzhkFCc/rH32QuMxWpo4H8Qz+uo71iuA2L9Ub6zC4xiPfBYwwEf3/HkBWJ2fPBuGw0ohI2mFwjC/16JfNGhlMFIDNYlyMJYENVn1vkSHESfd9ylsDlNnlXLAF+nBJ+Aq6zw+jqUzT7RDhxPQvps0IUH86bgLo9+3ax7o= 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=ln1VZLKu; 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="ln1VZLKu" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-609a8fc232bso22000777b3.0 for ; Mon, 04 Mar 2024 16:51:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709599880; x=1710204680; 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=/rSrKaEP0cu2EEhDxf63kSlEB7iQAh36Fr8Ir9gTxu4=; b=ln1VZLKu5+RmXA1sFmdN5RLOFSeHEvBQQuxNFPSMvRvaOrd0Pk4eLH082LtqedwjXJ 9H91dKjKnun1LO9vq57Xkr5j2VjJ07C5pkiDWieMvRYt3lBhAv0hNJNffY6yz+ZLgTai DNWjUluuL5AsxpqwO9IpLg6FSsLdr+ynR1DwGcEN4K0subUdDnBM9TrlquJrFNxzOkI9 rprR0cVzZDWvUbVmh1HVE1Ng2o0sSOJE4YSh1HJI0CjudrtbVI6qcqA+Ee5eKy8Mx2Q5 shdvR3IMqByi9uCkYIZ8zqPq3lf8zeQQ7r+h58i8DYbCsk35g39fmSTJsCyyfPXTkxBf /BLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709599880; x=1710204680; 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=/rSrKaEP0cu2EEhDxf63kSlEB7iQAh36Fr8Ir9gTxu4=; b=m0cU6sLrJMugASFIHJY8I6IDjuZfK3UcVhesxqYY6Cg9NCTDICB1lOHOCzeev6dttK dhK5BsHlrMPERmWEvNtekJpPAtKyg3Ao+QoGpaN+LnCek4OirPNPTIxQA1hh80hXos/5 +uaBunZVz3ud6cTvVvxmf3UYmuQbrQd1Cgr9LREhxsJEGUyzdX/WblQlgSQiDs0R29pB MyHFB7Q/9DSJCGDadTYFIvIfmZrthAjrViQI7VjD5P/olvol7FegiwC/mvMewAy1ZoF4 BuPlo5LKUULlHJ86lmTuw/T1b3j3loj1BVEWxoRe7EepkE1zdYz8DIw9XHOz1XTqMQ+r ky0w== X-Forwarded-Encrypted: i=1; AJvYcCXtrTGdb+AWBYvNFEFMtO6aYMq6w4lgi0dRTIB6/S3Po0EBxWQ6tI2wSXt9Ss2OwaA73300RQRBMHrY2bM5IUnjSH6pnmFQ6yiZrw== X-Gm-Message-State: AOJu0Yx37aE2ix/9acotb+LldDc2lUspkHwtwWdfxMGuaw5V1a3+SQOe Eq/D9qvcpK+lysPXDUJquI3tQteeB1hGay1WEVLpvHn7Cbrjd5Fl/aflYIcJ8VgJln46yaMfELW HyJMwnc9gLw== X-Google-Smtp-Source: AGHT+IH0taBqeMsbYKpUMKAKLG8w3t/pn1bQnH1/UJUTTJL6q6kvljHPQbPcYP7rtlwNxzaYSsc13QQM44B3KA== X-Received: from ipylypiv.svl.corp.google.com ([2620:15c:2c5:13:e901:e760:20cd:d870]) (user=ipylypiv job=sendgmr) by 2002:a81:9a05:0:b0:608:2ad5:cd28 with SMTP id r5-20020a819a05000000b006082ad5cd28mr2227317ywg.4.1709599880122; Mon, 04 Mar 2024 16:51:20 -0800 (PST) Date: Mon, 4 Mar 2024 16:51:02 -0800 In-Reply-To: <20240305005103.1849325-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: <20240305005103.1849325-1-ipylypiv@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Message-ID: <20240305005103.1849325-7-ipylypiv@google.com> Subject: [PATCH v5 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 Reviewed-by: Damien Le Moal 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,