Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp73084lqs; Mon, 4 Mar 2024 15:38:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU1p88UY0ilG7mXaMAvAQKwPQRKlcKw1Nh14QdP8EOXsJXESK8ZvjQcEfdI1LbzzqJ3KHioUPr+2ZAStosioYsO7J1Wg3NauDqgXTF1zg== X-Google-Smtp-Source: AGHT+IE2s9cQq7/b44ykuROWkntTvfvLSMpfmCK7gAtP1GaTunUueqBIRJgtxX8n92T2NimLp2l9 X-Received: by 2002:a05:620a:2495:b0:787:a7d6:f8f4 with SMTP id i21-20020a05620a249500b00787a7d6f8f4mr434421qkn.5.1709595486049; Mon, 04 Mar 2024 15:38:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709595486; cv=pass; d=google.com; s=arc-20160816; b=fkghPM7mS41TGhta6a2kXtCVzGzTFDc5RWyJ4pSTBHG7wbLTX62ZAbz0lt2gVZR+zP Qsw0oaW1YHYyoH6ogPClW4zC9mkZS0met8bD6e9spDWha9AhKK3cfQKT/i7NW8hdT8P/ rCVPDh5nP0oy90tNTLPZ4Dy3vpHMJN5p5Mn7FrveP24NuJtGXo2j0psiPBZ2y4kq7s0q rZC1BinErsqn7qBFkNfFKFImbLKad+AjJ1th5u0EqswYCBpULfc2+8Bvdg/Rxot7rfJd e+nf1N9EUpDtWSRtayPKCFap25DiGFmEg5mB0tv/hvS8+gQzK0IceaZx2DQdaG3x5rrQ dEEA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=mvSufY0ZH/UOo1VWeMwcZ4SMJ3fr9+ZmwU9jVMex5Es=; fh=1Vgl52C8cVxALgSGulN55gikLM7V7fvkOI6Fq9egdA8=; b=vppuo/Y67KnZyxp7g4HU9devwDo5UL0cdfob2aG6M1qE1FenLHzrz8wfKq5aiwrWen WqkgRcSPZl15Oxj6a6TYaNmSHV++UkFkCvUbi3TX6lPxIRUOS8iw5uVxdpLV8Tt/tZOw 16epcAbkdGPJijaUbt9z/krdKihRuqgzuaXBfp8xlyeBEWR5/rWgdad2hQhMiH0V2cf9 f2MAlbBMffCSY0P84sTTyCbQzwfoth0I3Jykc7bmKfoqj20ecIxI4IkYFHjmWnvMGWTx QdEunig3qy8mqsrBE9apehXQYwIUaWsjV1Gv6wHfhZS0MmM4HIpLRCyowIzauAWGS0H+ CV4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Rq4wSOOw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-91409-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91409-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ea5-20020a05620a488500b007882e843281si2356648qkb.244.2024.03.04.15.38.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 15:38:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91409-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Rq4wSOOw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-91409-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91409-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C5E1A1C22435 for ; Mon, 4 Mar 2024 23:38:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D3FEF7D07F; Mon, 4 Mar 2024 23:37:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Rq4wSOOw" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 009BC1E4A2; Mon, 4 Mar 2024 23:37:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709595477; cv=none; b=YM0dwI5zBI9yHSFGby7IUfPvNNJP/dKyLGJUrIV69Y+OXim3Fo3GYCeUc4JJAu3YlIROzGTdPyv+SZijDiFavsZOAnPCqDxyglJEdf7ZKtVcRAzLEu21zuEwQjjA9VhzAhJtRB4/5xb1EuLSW0RlzqO2zJ1MkgL9ZD6rGMgW83g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709595477; c=relaxed/simple; bh=rIorM/h/3cCcoMG9xBOuBOOed/zsrwBaA2MJyxxSyPw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=u6/DVvIJm0omH59KKumAjNihRs3pnXw1tAAzx5vuxBdtKQLEcBSgXQbxPFko6K/zU99x+29/laVCLnyE0uozOK/IRWVSZVYFjcC36Rwev9s7R/lVId1kdP/RRSOKmRdld4ddzLh3VBt6mP8FJ/f+iMm+PYO/PA4x4Iau0jTJxLM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Rq4wSOOw; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57A7DC433C7; Mon, 4 Mar 2024 23:37:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709595476; bh=rIorM/h/3cCcoMG9xBOuBOOed/zsrwBaA2MJyxxSyPw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Rq4wSOOwj1HP5xzLdNOTkAhtJKvgYbw5GwbemIqbWS+Wbys88A84z3gv0fxpw3u1x j6DMisnkB/UTn9je3sNf9CjVcZO/NH3reHkmc53gTjyL1Vj3cpIrvI0/g23sfqpAeo /wNq53ZypJXu3b6iHH7/hxnx0VHV3AKsyjjNlESO+g8w+jYwRU01jz3ncWu0UiaENx AqEYTEx5LKqzj5SAEkdFgNf/NJWqXfs73wDW2XtkWA8Fdc7mR+WLuRqGR+AsGVbTlA xMU41AWomodQ+hlxHACYDuRgXxHulXB4LgNbS+319Gk+0dMz5TcoRrHrosrNEfj+iG sAgqUzIR/bfZg== Message-ID: <50427a28-1038-48ac-b3a3-6255267f9831@kernel.org> Date: Tue, 5 Mar 2024 08:37:53 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 2/7] scsi: libsas: Define NCQ Priority sysfs attributes for SATA devices Content-Language: en-US To: Igor Pylypiv , 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 References: <20240304220815.1766285-1-ipylypiv@google.com> <20240304220815.1766285-3-ipylypiv@google.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20240304220815.1766285-3-ipylypiv@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/5/24 07:08, Igor Pylypiv wrote: > Libata sysfs attributes cannot be used for libsas managed SATA devices > because the ata_port location is different for libsas. > > Defined sysfs attributes (visible for SATA devices only): > - /sys/block/sda/device/ncq_prio_enable > - /sys/block/sda/device/ncq_prio_supported > > The newly defined attributes will pass the correct ata_port to libata > helper functions. > > Reviewed-by: John Garry > 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))) WARN_ON_ONCE() please. Same comment for all the occurences of this check. With that, looks good to me. Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research