Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp787571lqs; Tue, 5 Mar 2024 17:22:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXqnovnJL5CkZvueKiWB0N9sWmHmNttfiwWVmikoD/7J80l1auDdcJBMvXzchjsJsQY/InIur/TeSsxkR85S0RUt7gfGYU4+yh9ejs1qg== X-Google-Smtp-Source: AGHT+IETgZtGtVha/4X3B7adhcVwxCAtzojR0f4yi5pY0icpDTgI7DSoq72nbUfhsO9in4CqfCRI X-Received: by 2002:a05:6402:5c2:b0:567:6a66:d103 with SMTP id n2-20020a05640205c200b005676a66d103mr4364748edx.0.1709688163087; Tue, 05 Mar 2024 17:22:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709688163; cv=pass; d=google.com; s=arc-20160816; b=FD26SfzaJ74Iw4tUOW0is3YFFsrxQRQTGTA85+UusIkcwsh+gHSXcIu/oYohBKezuz H4kGq+fJnF5MjEQfR9EnwCXn9Qj5FYwAiSpwLi5CNbpeDa1eBn2rjidFGK1X2+0KoV8L rod2dYoVsW+scGnB8NrXkL+ZQ9t4tmwsVcl1K3TVvljq/oTQtGhIsB+nr857+htJpbql Rs/UHcLHZZfyZyYtbLFMPwLNT699x4RGdUT8nttDn2bTHWXPvk4AAeSqPigyfbkr4feA 9LFFaiWtkuyAlA8RJd3vIog7UiA4fS6JTHbK/jABII2iSp/SmSMjaQW1wMsIhZuFuJ5H aZEA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=rWap45PpMlOg/VvjoTJwWhXfR/oS7SDDWB/wilCHSAM=; fh=iq9EubwLj9Q2W51tj5DP9kyK4u2/0R7mDxgY/sxwVno=; b=XqH5kgy+gIroYSr9UKQpYnz+nRn6pz1Uib4TXzTg0s1LB/hC2AUXs3fzvEjCAm9FP0 HAJZsTCG8FjPhKBnQhcoFiaGjlvRUe/sFblmarE2lHC0jKn6SFR19ntbaBQjO+cQ1AUj PUPf9CKRhAa8FZauFOG4tsZs0ioZy/slhxHuQKbfqWdsVoUL6tjH95oAdo8UjwLM+ZSE 4B2QMIhlLt3JBZv0X0MFkG3VTt8fFL3jD0H9QO367F5Q9okger7NQ04wFw7do496ZRkT qgI5w/4E7g7nyCjJMB9SVR1AHISipBMMNY2fL4DzaOv5EKsst0vRoZlklkBdGAS1rmgO y2TQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="r//sWaZO"; arc=pass (i=1 spf=pass spfdomain=flex--ipylypiv.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-93188-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93188-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id r19-20020a056402235300b00567e67e781esi147569eda.24.2024.03.05.17.22.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 17:22:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93188-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="r//sWaZO"; arc=pass (i=1 spf=pass spfdomain=flex--ipylypiv.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-93188-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93188-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9F06A1F245AC for ; Wed, 6 Mar 2024 01:22:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 158F979F2; Wed, 6 Mar 2024 01:22:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="r//sWaZO" 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 9B45E63DF for ; Wed, 6 Mar 2024 01:22:31 +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=1709688153; cv=none; b=TpRCF4RZOpw+vDrW3JCCElZzzprYktV1N56KrwMDv89VKu2qP5GeyDxZUJhZSea2+bcxe20VIe0bCNXoPmzo5vwVffXe0fp0XB+q2ctLhajsJEIqM5yIu24tcL+o+APd22j/Ok8EkhVq0JmVQiKGzQzurUUkwxWdQ8PChed+jG0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709688153; c=relaxed/simple; bh=ovWANtziTLgaKyP6RnT4RlvydmnOGNyzgBpAYyn9GeY=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=tEVR6eigBQ7bIfy+e7YrXY10p2+NySQvjuEq0o5HCvJyLudWP5Dzk6mcpoDGK73AlS4VoehDjxobPLXyImmHbfXW+JwwE80MSXo62mPUEy9ml99Ip86rCv2qbBR+iZvSKihTigF7gb3dWDa/b6w9w9R87l69zPFr/5EsHS4PwzY= 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=r//sWaZO; 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 Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-6096c745c33so118385327b3.3 for ; Tue, 05 Mar 2024 17:22:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709688150; x=1710292950; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=rWap45PpMlOg/VvjoTJwWhXfR/oS7SDDWB/wilCHSAM=; b=r//sWaZOznVcLRjqJE56ddUu8Nej3/uSPnU4u+wX2rXgciSJ/3E50vbcZIC95wDG4I vBP4VGM/38XCPR8bhnQ7a1kHskXyXXrGY23/nQqjHzNEuGV18VjA/1/l4lTYMGKavl1M pTtAdw72ZeydPEszbkG7Hx8D1GMXrsQbSalpMmoPFv/Ynn8RpEgPBXXIJLjQbcCRiou9 ujSNVF1uGD4qOZteSbk3LOIeY2qU+BtNr5J5yFqMUziuLPM7SfrO+w8INFqmAKZZj/so kIqlNjfce3bTMwRBURmYyR80v0/oedFlzuDkgBCAdmLMqtpVRjablZAch1rxFc31f88N dIpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709688150; x=1710292950; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=rWap45PpMlOg/VvjoTJwWhXfR/oS7SDDWB/wilCHSAM=; b=AH1trRppK/qR12UZmzYjXMdIE157oJCTUJcs6F4aJKxOHhmwiF0ZtSbhLuQeZeOgqO 61pP5xd3b9TfaqE1wvfr+L3izPIPPlGqGehMzEYX6N1vRr8CV4IvqJ/otgJERcE5+9Hz +kqL9nX+wkkTxCMOZL5xOhhezsO9MZRLJa9TVdZAprExgui9GZz0wuKdCuvNibh6JP3s GKzvuKQJJb0PFcAasIzyFeSCroFTJruvUJmw7Zo1tYj0zU5dS9iBm5YsDsa83YW9CLJ1 muPUMEDASGg9ltxp4WYNoyKAZGNBS/md1Pgz3oJ35nZMc16QvfDfCHtDBVJqcGS4jclB UQ8g== X-Forwarded-Encrypted: i=1; AJvYcCUM9Wa+Vud5JHCPgsMakroHXbYv2tgxtcelc8M9bF6jDUSF/AUmzqTyNYkoDQFbIOUgkkivOCEW4yweZeZEvM6a9NlPlmBFOOEKnDmR X-Gm-Message-State: AOJu0Yy4ThJdGgNzKBYk7v7LZXlgwMOOQNCfMsTabpCUgaH7Zis9SMz3 daYw/bBrMzeXFLsRQ9HTMhcsXt4u3jYd/IKyX10HZeEVFBlxY1IcaTZHstoiJjeSH6s3MCxRGBu c8n5P53YvJg== X-Received: from ipylypiv.svl.corp.google.com ([2620:15c:2c5:13:69ff:df2c:aa81:7b74]) (user=ipylypiv job=sendgmr) by 2002:a05:6902:1081:b0:dc2:550b:a4f4 with SMTP id v1-20020a056902108100b00dc2550ba4f4mr3564063ybu.1.1709688150355; Tue, 05 Mar 2024 17:22:30 -0800 (PST) Date: Tue, 5 Mar 2024 17:22:19 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Message-ID: <20240306012226.3398927-1-ipylypiv@google.com> Subject: [PATCH v7 0/7] NCQ Priority sysfs sttributes for libsas 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 Content-Type: text/plain; charset="UTF-8" This patch series adds sas_ncq_prio_supported and sas_ncq_prio_enable sysfs sttributes for libsas managed SATA devices. Existing libata sysfs attributes cannot be used directly because the ata_port location is different for libsas. Changes since v6: - Replaced sas_ata_sdev_attr_group definition with a macro for the "CONFIG_SCSI_SAS_ATA is not set" case. The macro defines an empty rvalue struct eliminating the variable definition. Changes since v5: - Added __maybe_unused attribute to sas_ata_sdev_attr_group to prevent an unused-const-variable warning when CONFIG_SCSI_SAS_ATA is not set. Changes since v4: - Updated sas_ncq_prio_* sysfs functions to use WARN_ON_ONCE() instead of WARN_ON(). Changes since v3: - Changed ata_ncq_prio_supported() and ata_ncq_prio_enabled() to store the result into a boolean variable passed by address. - Removed the "usable with both libsas and libata" wording from ata_ncq_prio_* helper's function comments. - Removed the unlikely() in ata_ncq_prio_enable() because the function is not in a fastpath. - Dropped hisi_sas v1 HW driver changes because it doesn't support SATA. Changes since v2: - Added libsas SATA sysfs attributes to aic94xx and isci. Changes since v1: - Dropped the "sas_" prefix to align sysfs sttributes naming with AHCI. - Dropped ternary operators to make the code more readable. - Corrected the formatting %u -> %d in sysfs_emit(). - Changed kstrtol() to kstrtobool() in [ata|sas]_ncq_prio_enable_store(). - Changed comments to use the "/* */" style instead of "//". - Added libsas SATA sysfs attributes to mvsas and hisi_sas. - Dropped the 'Reviewed-by' tags because they were not sent in-reply to the patch emails. Igor Pylypiv (7): ata: libata-sata: Factor out NCQ Priority configuration helpers scsi: libsas: Define NCQ Priority sysfs attributes for SATA devices scsi: pm80xx: Add libsas SATA sysfs attributes group scsi: mvsas: Add libsas SATA sysfs attributes group scsi: hisi_sas: Add libsas SATA sysfs attributes group scsi: aic94xx: Add libsas SATA sysfs attributes group scsi: isci: Add libsas SATA sysfs attributes group drivers/ata/libata-sata.c | 140 ++++++++++++++++++------- drivers/scsi/aic94xx/aic94xx_init.c | 8 ++ drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 6 ++ drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 6 ++ drivers/scsi/isci/init.c | 6 ++ drivers/scsi/libsas/sas_ata.c | 94 +++++++++++++++++ drivers/scsi/mvsas/mv_init.c | 7 ++ drivers/scsi/pm8001/pm8001_ctl.c | 5 + drivers/scsi/pm8001/pm8001_init.c | 1 + drivers/scsi/pm8001/pm8001_sas.h | 1 + include/linux/libata.h | 6 ++ include/scsi/sas_ata.h | 6 ++ 12 files changed, 247 insertions(+), 39 deletions(-) -- 2.44.0.278.ge034bb2e1d-goog