From patchwork Wed Mar 6 01:22:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Pylypiv X-Patchwork-Id: 779639 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 541FBDDAA for ; Wed, 6 Mar 2024 01:22:35 +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=1709688156; cv=none; b=tm5BCzKx5QgAaayzO++l7GZ/wZB2S8h5jdMesE5BmE8ZG4iKrteS9wtKJ0roMlcmxHvJyGNHKYjMhk3dIuw3S9fW5xUaUTN2UCl9TLU5i+Rd/imIuwUZ5gcGGYKm/c/Yr/g8lfadg9ijSE2x/7sF8y3LJhi7D4ujOuSy9r3QtYg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709688156; c=relaxed/simple; bh=n4LxPfG7AS9Lalbw6aTzUiw335yJJpF6kZEovqNpXTU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=nnxaQi9/Wuy0z8hJGKhjuUYi7cKdM28zNYzHv9fcn3kSAOvDH2SgQTPBGSibTl9/bHPBzy9eJCQukFL6V8vFbFe8HonWAZUPBrUGx+tcU/e+7JtiVshej30ehGFjIab0Cyc3mbxKY0ZMCKl8mcVyR8zKCw+oKIVgOE6zriP6Sus= 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=LlQ3keOV; 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="LlQ3keOV" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-609da1d86edso2760667b3.1 for ; Tue, 05 Mar 2024 17:22:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709688154; x=1710292954; 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=FSTiKWyL/nnmXNuU8GslZSbybClSIgn/PnMeem+fE3I=; b=LlQ3keOVH1NiKBPBhsf5A6vyC8eD6hnFfuv0bBkDPnuXWYgqztQh54V6SIZUWLfTQ3 PzbsRCqTjYVW+93+1QAiOGofnAPiybsek0FzmCfFv7WEPZth4Zj/ZWOLFZ/XHh18Jfp8 WmHGE+4IEb4MB8BrAiUT1IqLGWz/mAGFHzbHuAiQDuJF/bgLXP0yl2NPzlhxz3vLP4+h 4dpk0/urSBvTM7mjW9OXC3kCyHLsFdjj/MfmoLasQR/HhvkGXwoCBtx744wMndxkRXqH QHExQyfixRfYIvJ18Tb46A5Bj40QgTIssmQNyafQNHRA/ssiCNK4vtN3/AfcxnZvkd0x /g8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709688154; x=1710292954; 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=FSTiKWyL/nnmXNuU8GslZSbybClSIgn/PnMeem+fE3I=; b=XIBar3vfRZPqs7NvEQBZDSq63kwGNiHkE9XJ+8OY0ERMk5M9JQ2z10dS8rlzZynw2C eAQObKXq9ZJ6gKrHSxRIdQXwHaDLXnIxQVe26+UCpWxiTQ26VTignLCsiCT5vCdIJgO3 Ro7vtnerAC5lhIrcNCTsl4Zy/THXIoKJ5xyHiUl3l7h7sn1be3zvdWV2y1GctV21Kcf2 FtSe4zDoFm1ExaW/Umuzr0TcwLA/4S/e6B4b/XZnhbOQdCbj3M4gs4hTWVIUx0P9mfv7 2/dsRE+OK3sJzz5E1iQT1hdSdu1gtGrx3RYPHFxVpguSKUYgUWKEYJZeLiESFVaag/8B rlXQ== X-Forwarded-Encrypted: i=1; AJvYcCXPxFVEiUXXfK8lnRhLJPGqBKzlB+uR01gkARtYCQjyLaRIVY+oPGuzQnp0+5thab6vhFBWybIiXN6fWNzil3Tpbro7kcHyIPdU+w== X-Gm-Message-State: AOJu0Yz4Kzb1egckgpmfm5eT+0OVt6WTZcPLKsvMxUhuuHKCSA8d2YOR 5RbRA5OdSxnlhXZXSyphM+qwBA795/RTL6eRil2Ajz5nvRjvA4oJLTtx0C1+UCw1HsYZHinbEbO 5o97E5MRx5g== X-Google-Smtp-Source: AGHT+IGDgdAZaaUbvgWkTXP+6EFmj00+0ikeM9JhzpBpk4U5EIlsiZ7KKpZ+KsZUT+sILS7ZtWuHFzRcgbReHA== X-Received: from ipylypiv.svl.corp.google.com ([2620:15c:2c5:13:69ff:df2c:aa81:7b74]) (user=ipylypiv job=sendgmr) by 2002:a05:690c:3386:b0:609:2570:f06f with SMTP id fl6-20020a05690c338600b006092570f06fmr3759250ywb.0.1709688154461; Tue, 05 Mar 2024 17:22:34 -0800 (PST) Date: Tue, 5 Mar 2024 17:22:21 -0800 In-Reply-To: <20240306012226.3398927-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: <20240306012226.3398927-1-ipylypiv@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Message-ID: <20240306012226.3398927-3-ipylypiv@google.com> Subject: [PATCH v7 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 Reviewed-by: Jason Yan 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..92e27e7bf088 100644 --- a/include/scsi/sas_ata.h +++ b/include/scsi/sas_ata.h @@ -39,6 +39,9 @@ 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 +126,9 @@ static inline int sas_ata_add_dev(struct domain_device *parent, struct ex_phy *p sas_ata_disabled_notice(); return -ENODEV; } + +#define sas_ata_sdev_attr_group ((struct attribute_group) {}) + #endif #endif /* _SAS_ATA_H_ */ From patchwork Wed Mar 6 01:22:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Pylypiv X-Patchwork-Id: 779638 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 7CCEB1759F for ; Wed, 6 Mar 2024 01:22: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=1709688161; cv=none; b=pTB4M3EDUO9Ois2Z7E0vq3a7cR7tmCciHGWY62DRwuX4/SifDosbPpJusVb2Cs7DCtV1EspVNnmp7O1JwJIWdYPJ1zAGj3uF2EFf91UhhuTEReQgOo0HEIiA1SoVt/+MgT4fgoNnrW4Dpl6WjSHgedxf/S3hMeQe/wONueJQxTU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709688161; c=relaxed/simple; bh=wcg4s+VBRSyuqCYnMen4yuigKnSiE8NtEjtig8qUC2o=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=CoYwTGIpOWwD6E7Q35BlVFboPUjzqjbioLkcRPRsHxkHWNjQmKlQ5Nn9A6bRE4UPDuV3GdGEpddA/3v8fZSzclQKNxlNra8ex6gbNNvz4FJ1JQpoOumGQckyBonfLNW1nHsNkNLuudaG3Qk2/Xn+pqaEV54bGLy8+VF4OnWVUlQ= 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=mroJrfGy; 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="mroJrfGy" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dcf22e5b70bso10986146276.1 for ; Tue, 05 Mar 2024 17:22:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709688158; x=1710292958; 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=xvuQ4kezab1KlrTxoR3eIfXTgSjXQ9ZPEoqhGuVUIVQ=; b=mroJrfGyyEw0InFhfjPw6H4li267zjABJNkx4asSKDHCLlYGmazQQMdXZ42j4fnS+e +JOtE6KxovlBawr+yzBahaDx5mzghMSexEyPiJMR8LrzDK1tHuPwJPFnOeQYrhSW9HDW 3hsqucdPShK+iNw+YxMgbd8+txfQ3BcxIRP4/jxBBIi//noGuUqgoqhBG1K5y05MXm96 LPu32UoVScy08MR1c6arGd6thA78Fo1lPGi6Lq47Q4459P9Mx9/Yzr0ZISaCtq0GmN0h /OjtJFgBElSoLz1OkKVlGpyLfwkyytgk2+CTRn0qlFpoY44CKTzhgCzZUp3qbIRopK9O 0jgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709688158; x=1710292958; 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=xvuQ4kezab1KlrTxoR3eIfXTgSjXQ9ZPEoqhGuVUIVQ=; b=VwslGh9CEebD6QpEOXWP8qObh7dy77pjFyhUrKQYnwuOpGtSx0pkS3axy7BKyWveS6 cEeIIP+eRPj6Saq1Sgk5AQNcnGeLoofzlPwzDassHpmhlyh5oXS+PoBnnP+9DTWOzUmX 1zJVfe3mWdK89i5AO7IiWDYXYKbGHyJfXu3YI3Fhi9LSCD9ilzadcZz1jwoYvUarj9sB B/plHhUzUeENfzJSjrEg6rkC7i/7VJFlEjFTX8X9+wfNoPA3Dl5lcOl7qnSiwA/Yx4Tx Ues0DJsjGrxJaix7SLmnTqRpGQDH+iD8laWMK24lfWJ5PGT8U+8cW5iemE3+G9a9EZCZ OTjw== X-Forwarded-Encrypted: i=1; AJvYcCXwruqd48FMAw1ackgWEER6SiPBpBexX5pZ4+tieJB06JIeyLN9Q1LZ5uoFTHtwdV3YpKApPkjLQPOsJLKh78e12eKHdvOPYaR46A== X-Gm-Message-State: AOJu0Yz/DBT28kgj1LwTcZg2Aii2cPLoKwhTQMoVHumRyn3de0/zCyDs U3F46fXJVPgGD9oTK/ujT9c0//et6IgJ82lx4s+17c2OmzGTagd0oy2Xs3j3AeTPFwWRWUk3JnC v+umOtbNmcA== X-Google-Smtp-Source: AGHT+IHtVVDAQr0HlC7Y5wW7LyESC5hemfsg9S9HuZaVvIMxC3e30XENP7rU5kXxBG6Pcf0SSGSVZruuEt/ECw== X-Received: from ipylypiv.svl.corp.google.com ([2620:15c:2c5:13:69ff:df2c:aa81:7b74]) (user=ipylypiv job=sendgmr) by 2002:a25:c585:0:b0:dc2:2ace:860 with SMTP id v127-20020a25c585000000b00dc22ace0860mr493435ybe.2.1709688158684; Tue, 05 Mar 2024 17:22:38 -0800 (PST) Date: Tue, 5 Mar 2024 17:22:23 -0800 In-Reply-To: <20240306012226.3398927-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: <20240306012226.3398927-1-ipylypiv@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Message-ID: <20240306012226.3398927-5-ipylypiv@google.com> Subject: [PATCH v7 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 Reviewed-by: Jason Yan 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 Wed Mar 6 01:22:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Pylypiv X-Patchwork-Id: 779637 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 A81F41B7FB for ; Wed, 6 Mar 2024 01:22:43 +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=1709688165; cv=none; b=K5bHjack59VneQRIY0QAuFMdLUx4M4YTZ46+APsmrl+3tWmfJvTtkjziywpyNgKcVT1kuuVXI+Ks9lRytrUZWmXbh3+mZucW1lnhZP+tRg8Plr6x8/DPC8RSjsJKjiCREQE3dPjYyanGoJcUU6QmV46vrxkaK4TFu8eWVg/WWVs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709688165; c=relaxed/simple; bh=G9sVD8mPANACI8XvBa42u5K2t+gtYc3kf7MUNETx/FI=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ohOPFTJ6ooN5znmu7vnalcfIL3TtlsFReyyktBUGW7V6bAmGKdi7zmOzof7aYNwUsuZwpxKeRrwWZa595JC9PKLA1C2v5FObCTtzPHlLhM4q5M42nfN5Ny9qKRXHSKgpfdKwv1CNJcf6DQ4FLLdYhusRYKdT/Vvvob3ehvjVxHQ= 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=vmZ7zN0y; 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="vmZ7zN0y" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-609db871b90so585797b3.1 for ; Tue, 05 Mar 2024 17:22:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709688163; x=1710292963; 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=RQNseeqHGtqWgtmESvK7C+bOjnnAotGHLghFADtiiV8=; b=vmZ7zN0y7oAQ3o1IYvC/6G7lp8KHoWrQ8P/DlIeuymJNgS2JfZzSlC6Hlbk9cV8Nt6 qiFHpiWvX7iq4uR/jcnOw8b5wo/ogwn7Tv20+DGsa65zU7iOxtnWxYfqqqSjNEa5kpQu xWsASHAXgole+8k0MdUHd27VmYNOoHyWQEttpc5ahLz+DO6bZ7aOeucvpzsx+XNQ3+1c DuSW7FR1BfE4zZwkNvWxNrkDAm24DzXc4Yz/+sDNjbPcflQW0wRuaoxR0NRisFdEVqXe bdqNfyuKXFfeM3MoemIg2y+PsIUAkP0xqz2LZOvjB9p1hATN4ADILTGvlP5zjIOSwaii OJLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709688163; x=1710292963; 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=RQNseeqHGtqWgtmESvK7C+bOjnnAotGHLghFADtiiV8=; b=bBEpM15v/mQZnggp6lUFaD1HxSjLjWu5VeRrb1Gch0ScTLmVRFcwT6dZGiQEb0tE2B uNW1nJI1DMc/hN+RQeWWoGNWwsnpu6/H79MSU1uB7IzJgfQxtsL5yooSCvvva8Mm61rx vxaf9IWJOCXzHgDHGrdd0/7kc7GJyqTBPl3CFPEgx/PPOhGUmAoMEzVuy+zU5yEiZCsi w+VkbLhs6sHN0vC43nzE6MBCABRq4/NzedXa0xrVqwt7Uo462mHV5O/BGO97J5GxbaGW FOGcHyiGTUD88MSCX5N8MZPtGfnN0lVyUkKE/OgvMzszLabPQNgNLkmqR9i9n5ywpqwQ wCqw== X-Forwarded-Encrypted: i=1; AJvYcCWC6vzi94jyMWjBSNKY1fOyqH5rCzRcuAWU3jiYoP/WT7S0/2Mh+N5oxlkdnOivpl+LBTw9b7UYh8m1f+p4l0gX4ERT1b/SkFwlkQ== X-Gm-Message-State: AOJu0Yx5dDOVOdPqaHfqFaeIe8z9R3+R06aCYg/btBTl16eqFiyaC+BR +uKoe3+rFPp88qUpT2TB6Blm+m6SOEloGWSnlSv9jJDhZmaRLd3uox9WU6KuLrffA/lBOWNOng5 mVzdnzzO67Q== X-Google-Smtp-Source: AGHT+IHuf14WoeiNOQZD94FHubDwGQvZY9g2Mcsd57WWqKCAzXJp6IFbF7d+D3UEyzS77tOP8GcP5CmNZmrWww== X-Received: from ipylypiv.svl.corp.google.com ([2620:15c:2c5:13:69ff:df2c:aa81:7b74]) (user=ipylypiv job=sendgmr) by 2002:a25:260f:0:b0:dcc:f01f:65e1 with SMTP id m15-20020a25260f000000b00dccf01f65e1mr3520928ybm.8.1709688162723; Tue, 05 Mar 2024 17:22:42 -0800 (PST) Date: Tue, 5 Mar 2024 17:22:25 -0800 In-Reply-To: <20240306012226.3398927-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: <20240306012226.3398927-1-ipylypiv@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Message-ID: <20240306012226.3398927-7-ipylypiv@google.com> Subject: [PATCH v7 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 Reviewed-by: Jason Yan 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,