Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3217105lqp; Tue, 26 Mar 2024 03:07:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU/10G3RlgKuMzuozY6+DwfSvlJfmjOVYwdJF0SKMlQzPi9kynzDy3cvq7v+uripyL1uHXjp2pMiW9qRr73zZE6ScU9wQ8dT9asQSAbPw== X-Google-Smtp-Source: AGHT+IFzyx9NEP8BWw8/zGwJLx7rhULcv98gonbRn7P90HXf5u4njPp+udCT2+GUC68pAqE56Vmd X-Received: by 2002:a05:622a:f:b0:431:50a8:3a00 with SMTP id x15-20020a05622a000f00b0043150a83a00mr1217619qtw.6.1711447671990; Tue, 26 Mar 2024 03:07:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711447671; cv=pass; d=google.com; s=arc-20160816; b=y+xWYAaeD/ezU0AMD0oqD1lorynruwL0mqLcYQIJvCfOLMYcSBpZZznULjeBEMNT/a 7o6zX+a+t7S1s3o5ox8BOGkc1LD1drjHiETpmvZx1CC6KsCag6dWTTV0ghVkJKDjfogK SZBc25weqZe9W8dGwAVkfW+kN0SNDvz0tfbMQKT+4asKpVNeyt8PzgJqdOkUuU9ZFVxn pt4AyReizUTWuBbq8HCMzPKtGquVAEYNjxJ7sa+BNRn2PyfKXdUUC0kjb2w3U+APOXHd ibmbmddDnn90q9nF/OaQFXWBOiVwvE1CC+SOS2LkYFYxjkaqRoj3L8bAkgC3ZTlgORS+ KHtA== 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=lfM07VZQKmVsMsgtDJhfsc3PCtsVzNV3QDmE5Cpr9PM=; fh=dyd27GnsEKMs11B1Xp/GMaia0Eo08WhkFUeNl0/I1iw=; b=Ddqlkd2TLHo3MxTJAW84ud7oGeUeDfSv3lJu/uzQbJpiwFb2URdAKMlNmmZw8q5TTy 34MJ8dhBz0EBfv0HW8eglTWFaJsqVR7oXlHaZxy/Do/kkyJE9npu+3oyENmLn3Clvwbj D+yXnfOdOPiEgP+Z1YYWiqRYF813/MzYV/w+OOQgNWeRKrVkdFs+O3TdKWCP6InfgfcB +fKepESmEMZPVhxTc70pDwq9BxnOK4QwTNuCEglpYCGizM2ILnotyYxKX0zm1qXVFkeg sMCSV7yF76cYSIOlm2H6hqtINE9bhm6Mcp73OH0ExR0g1laY5o1nTju/pIBnC40Z/FFs SspA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r7ooJuTx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-118745-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118745-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 o17-20020a05622a045100b004315e248da1si2971826qtx.455.2024.03.26.03.07.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 03:07:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118745-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=r7ooJuTx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-118745-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118745-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 B563B1C321E7 for ; Tue, 26 Mar 2024 10:07:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32A9A5CDE4; Tue, 26 Mar 2024 10:07:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="r7ooJuTx" 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 3B31670CCC; Tue, 26 Mar 2024 10:07:01 +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=1711447622; cv=none; b=bgC40Q18K6ycYfa1BMDBJPmjjgUzC9AHb65gS+0HD7kF5td/lzM4iWMUcpJI/yhR/uPZi0cSWcUkGBQmqYEtcUD5t2hNzUiiuHDuMnd9RBaciZAPJeh+iw3YsKPTgStC7gHq1d05ou6FGkCsAZdtdzgaAooVnGdstNwhNE96f+8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711447622; c=relaxed/simple; bh=U4EdSS4ABUOTzZjhVULdw5aeTTxo/JKgfI7ODcfDDtg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=rmMY19+pTgKPqqc6flfobbCXyI06vHpWa5/2g+nkQ79R6UjrxHeV4Dc5TZPyBLEX7l6Pk3NM7ZInUwHlL2NFJV5nVwMgvxHcwiGYSY2SqmPi9xmQxKpSM3CfLe2e2utfmtyETjLayCZvLE+57LB+aNEh1+kLVCl657zjAGGPGJE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r7ooJuTx; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81130C433C7; Tue, 26 Mar 2024 10:06:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711447621; bh=U4EdSS4ABUOTzZjhVULdw5aeTTxo/JKgfI7ODcfDDtg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=r7ooJuTxZN+PNiPnccb67g34KjJFZGCbDEgFec7vlUu1ajdengm+9RmR5ora7u1Bv jbfwicklE0lImv+7AHkT8Ep/VdsKhRmeMG6UxrolnJ/ZzqEFl7pNfUgvwonKbip4hX r+/Yg367izpOMHHu3oKVpwsGFPu0chGtDgmxAVKs6sKAqMYx2dJagTcKGVYHwXhHhZ wml/UNgn2xqfhxKlSbephOrUcJLtFgoqjvZk8BSEuDYtEkpx8L8cCrnExrP/1wb9Lk ODqAwMdItZqnS/Pzh8wYphLB67vqAqvbENX/0iLnGHLNYv8ydBq+ejsL+ZWZy2j2K+ kY2BYUifmV2gQ== Message-ID: <66ad274d-9890-411d-9fba-90fed2eb33f5@kernel.org> Date: Tue, 26 Mar 2024 19:06:59 +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 v8 2/7] scsi: libsas: Define NCQ Priority sysfs attributes for SATA devices Content-Language: en-US To: Geert Uytterhoeven , Igor Pylypiv Cc: Niklas Cassel , John Garry , Jason Yan , "James E.J. Bottomley" , "Martin K. Petersen" , Jack Wang , Hannes Reinecke , Xiang Chen , Artur Paszkiewicz , Bart Van Assche , TJ Adams , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240307214418.3812290-1-ipylypiv@google.com> <20240307214418.3812290-3-ipylypiv@google.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 3/26/24 18:53, Geert Uytterhoeven wrote: > Hi Igor, > > On Thu, Mar 7, 2024 at 10:55 PM 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 >> Reviewed-by: Damien Le Moal >> Reviewed-by: Jason Yan >> Signed-off-by: Igor Pylypiv > > Thanks for your patch, which is now commit b4d3ddd2df7531e3 ("scsi: > libsas: Define NCQ Priority sysfs attributes for SATA devices") > in scsi-mkp/for-next > >> --- a/drivers/scsi/libsas/sas_ata.c >> +++ b/drivers/scsi/libsas/sas_ata.c > >> + >> +DEVICE_ATTR(ncq_prio_supported, S_IRUGO, sas_ncq_prio_supported_show, NULL); >> + > > [...] > >> + >> +DEVICE_ATTR(ncq_prio_enable, S_IRUGO | S_IWUSR, >> + sas_ncq_prio_enable_show, sas_ncq_prio_enable_store); >> + > > When both CONFIG_SCSI_SAS_ATA and CONFIG_SATA_HOST are enabled: I have both enabled in my config and I do not see any issue. What is special with these on ARM ? > > aarch64-linux-gnu-ld: drivers/ata/libata-sata.o:(.data+0x110): > multiple definition of `dev_attr_ncq_prio_supported'; > drivers/scsi/libsas/sas_ata.o:(.data+0x260): first defined here > aarch64-linux-gnu-ld: drivers/ata/libata-sata.o:(.data+0xd8): multiple > definition of `dev_attr_ncq_prio_enable'; > drivers/scsi/libsas/sas_ata.o:(.data+0x228): first defined here > > Making both new DEVICE_ATTR() declarations static doesn't work, > as contains a forward declaration for the existing global > dev_attr_ncq_prio_supported in libata: > > In file included from include/linux/async.h:14, > from drivers/scsi/libsas/sas_ata.c:12: > include/linux/device.h:156:33: error: static declaration of > ‘dev_attr_ncq_prio_supported’ follows non-static declaration > 156 | struct device_attribute dev_attr_##_name = > __ATTR(_name, _mode, _show, _store) > | ^~~~~~~~~ > drivers/scsi/libsas/sas_ata.c:984:8: note: in expansion of macro ‘DEVICE_ATTR’ > 984 | static DEVICE_ATTR(ncq_prio_supported, S_IRUGO, > sas_ncq_prio_supported_show, > | ^~~~~~~~~~~ > In file included from include/scsi/sas_ata.h:13, > from drivers/scsi/libsas/sas_ata.c:15: > include/linux/libata.h:508:32: note: previous declaration of > ‘dev_attr_ncq_prio_supported’ with type ‘struct device_attribute’ > 508 | extern struct device_attribute dev_attr_ncq_prio_supported; > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > In file included from include/linux/async.h:14, > from drivers/scsi/libsas/sas_ata.c:12: > include/linux/device.h:156:33: error: static declaration of > ‘dev_attr_ncq_prio_enable’ follows non-static declaration > 156 | struct device_attribute dev_attr_##_name = > __ATTR(_name, _mode, _show, _store) > | ^~~~~~~~~ > drivers/scsi/libsas/sas_ata.c:1023:8: note: in expansion of macro ‘DEVICE_ATTR’ > 1023 | static DEVICE_ATTR(ncq_prio_enable, S_IRUGO | S_IWUSR, > | ^~~~~~~~~~~ > In file included from include/scsi/sas_ata.h:13, > from drivers/scsi/libsas/sas_ata.c:15: > include/linux/libata.h:509:32: note: previous declaration of > ‘dev_attr_ncq_prio_enable’ with type ‘struct device_attribute’ > 509 | extern struct device_attribute dev_attr_ncq_prio_enable; > | ^~~~~~~~~~~~~~~~~~~~~~~~ > > Perhaps the new attributes can be renamed? > Alternatively, the DEVICE_ATTR() can be open-coded, so the actual > device_attribute structures are named differently. > > Gr{oetje,eeting}s, > > Geert > -- Damien Le Moal Western Digital Research