[{"id":3675826,"web_url":"http://patchwork.ozlabs.org/comment/3675826/","msgid":"<2c5b50c7-b357-025d-e0de-1fce1fcddf20@linux.intel.com>","list_archive_url":null,"date":"2026-04-10T11:19:27","subject":"Re: [PATCH 14/20] alpha/PCI: Add static PCI resource attribute\n macros","submitter":{"id":83553,"url":"http://patchwork.ozlabs.org/api/people/83553/","name":"Ilpo Järvinen","email":"ilpo.jarvinen@linux.intel.com"},"content":"On Fri, 10 Apr 2026, Krzysztof Wilczyński wrote:\n\n> Add macros for declaring static binary attributes for Alpha's PCI\n> resource files:\n> \n>   - pci_dev_resource_attr(),        for dense/BWX systems (mmap dense)\n>   - pci_dev_resource_sparse_attr(), for sparse systems (mmap sparse)\n>   - pci_dev_resource_dense_attr(),  for dense companion files (mmap dense)\n> \n> Each macro creates a const bin_attribute with the BAR index stored in\n> the .private property and the appropriate .mmap callback.\n> \n> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>\n> ---\n>  arch/alpha/kernel/pci-sysfs.c | 20 ++++++++++++++++++++\n>  1 file changed, 20 insertions(+)\n> \n> diff --git a/arch/alpha/kernel/pci-sysfs.c b/arch/alpha/kernel/pci-sysfs.c\n> index 867199b988de..0e016b597b06 100644\n> --- a/arch/alpha/kernel/pci-sysfs.c\n> +++ b/arch/alpha/kernel/pci-sysfs.c\n> @@ -104,6 +104,26 @@ static int pci_mmap_resource_dense(struct file *filp, struct kobject *kobj,\n>  \treturn pci_mmap_resource(kobj, attr, vma, 0);\n>  }\n>  \n> +#define __pci_dev_resource_attr(_bar, _name, _suffix, _mmap)\t\t\\\n> +static const struct bin_attribute\t\t\t\t\t\\\n> +pci_dev_resource##_bar##_suffix##_attr = {\t\t\t\t\\\n> +\t.attr = { .name = __stringify(_name), .mode = 0600 },\t\t\\\n> +\t.private = (void *)(unsigned long)(_bar),\t\t\t\\\n> +\t.mmap = (_mmap),\t\t\t\t\t\t\\\n> +}\n> +\n> +#define pci_dev_resource_attr(_bar)\t\t\t\t\t\\\n> +\t__pci_dev_resource_attr(_bar, resource##_bar,,\t\t\t\\\n> +\t\t\t    pci_mmap_resource_dense)\n> +\n> +#define pci_dev_resource_sparse_attr(_bar)\t\t\t\t\\\n> +\t__pci_dev_resource_attr(_bar, resource##_bar##_sparse, _sparse,\t\\\n> +\t\t\t    pci_mmap_resource_sparse)\n> +\n> +#define pci_dev_resource_dense_attr(_bar)\t\t\t\t\\\n> +\t__pci_dev_resource_attr(_bar, resource##_bar##_dense, _dense,\t\\\n> +\t\t\t    pci_mmap_resource_dense)\n> +\n>  /**\n>   * pci_remove_resource_files - cleanup resource files\n>   * @pdev: pci_dev to cleanup\n> \n\nWouldn't this belong together with the next patch, or is there some good \nreason why you added them separately?","headers":{"Return-Path":"\n <linux-pci+bounces-52300-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pci@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=dyoRAYyO;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.232.135.74; helo=sto.lore.kernel.org;\n envelope-from=linux-pci+bounces-52300-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com\n header.b=\"dyoRAYyO\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=198.175.65.19","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.intel.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=linux.intel.com"],"Received":["from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fsZ8K6wQYz1yGS\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 21:19:45 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 45A77301286B\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 11:19:43 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id D23C539D6DA;\n\tFri, 10 Apr 2026 11:19:41 +0000 (UTC)","from mgamail.intel.com (mgamail.intel.com [198.175.65.19])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BA4839B955;\n\tFri, 10 Apr 2026 11:19:40 +0000 (UTC)","from fmviesa009.fm.intel.com ([10.60.135.149])\n  by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Apr 2026 04:19:40 -0700","from ijarvine-mobl1.ger.corp.intel.com (HELO localhost)\n ([10.245.244.118])\n  by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Apr 2026 04:19:30 -0700"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775819981; cv=none;\n b=EinaXqFXKmUwHStdVDvGKsIlmvWf6I5aPQHkN1OyGrRgOogrsohKN9h+JYxYmrZApZtnVwjp25oOGKnmuqS6AY7Y8cvJFW3UbxDvhXLgmSj1DMPNIDMthFEXdJ35yQkTlU0vtvi//yeqZ42ctj9T4Ug0lXSsZ89+qtm2aKd2g3E=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775819981; c=relaxed/simple;\n\tbh=y2Ft9tQbJmBllEvwEPLEzQ//AalTGbNGlcFniNwTlWc=;\n\th=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References:\n\t MIME-Version:Content-Type;\n b=sbO/LZNPi5Kvsoa1XRmMi6R8AgxK96hSkPYBZ/MM8a8D4VF17Wir/jVwWmQ9rQq52Yk/bAxjpJg7sodbK9EhEG4rEbFFhBXyvBhpk5jl7t0jUMbwF1WmzKbzFozVXRMMHsZIhM/0rR3QQgavJhopfYNUCNLqSp6P/FzsAuRAzdY=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.intel.com;\n spf=pass smtp.mailfrom=linux.intel.com;\n dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com\n header.b=dyoRAYyO; arc=none smtp.client-ip=198.175.65.19","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n  t=1775819981; x=1807355981;\n  h=from:date:to:cc:subject:in-reply-to:message-id:\n   references:mime-version:content-id;\n  bh=y2Ft9tQbJmBllEvwEPLEzQ//AalTGbNGlcFniNwTlWc=;\n  b=dyoRAYyOrLQ4nbxQ72lRD5JyyGgkFSF83fhaUIQfFqGIWWkFFKIR3A6o\n   ++W5lJspxcwbiaL5qjI8jz/OqkCaL5rsq7B8t8eHsys5CGwN2V0CxkDlI\n   pUiO+pQVK0ghTqYx4Wxw8cfBZsT9/QJgITjOih4RV9Lv0rjug7kvaLt7w\n   h3GYjG6kzGCjQy9KZWT/EWlOhvzr/l2hEUtBjTAy4HqwciJ+dswRqtNUo\n   FsIoJhNmFREA1/WNDLT27Tem+SDS+hEth4eTLCSgo0U12LQJdWj8f76p6\n   JXpf75p3v7tkkZPWQkTwSp9B0EEQsyLrna7eyyD/9krtouaUQAQCpO+oQ\n   g==;","X-CSE-ConnectionGUID":["HTZZ1ojKRpGOnfINCBiV/A==","xvtL+CXXRjqr7ImdpYZiRw=="],"X-CSE-MsgGUID":["6tJvYRfQSXGVCQPfuD3bYA==","HohmFH4wSUuwW10pd0WNPQ=="],"X-IronPort-AV":["E=McAfee;i=\"6800,10657,11754\"; a=\"76745207\"","E=Sophos;i=\"6.23,171,1770624000\";\n   d=\"scan'208\";a=\"76745207\"","E=Sophos;i=\"6.23,171,1770624000\";\n   d=\"scan'208\";a=\"222569712\""],"X-ExtLoop1":"1","From":"=?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>","Date":"Fri, 10 Apr 2026 14:19:27 +0300 (EEST)","To":"=?iso-8859-2?q?Krzysztof_Wilczy=F1ski?= <kwilczynski@kernel.org>","cc":"Bjorn Helgaas <bhelgaas@google.com>, Bjorn Helgaas <helgaas@kernel.org>,\n  Manivannan Sadhasivam <mani@kernel.org>,\n  Lorenzo Pieralisi <lpieralisi@kernel.org>,\n  Magnus Lindholm <linmag7@gmail.com>, Matt Turner <mattst88@gmail.com>,\n  Richard Henderson <richard.henderson@linaro.org>,\n  Christophe Leroy <chleroy@kernel.org>,\n  Madhavan Srinivasan <maddy@linux.ibm.com>,\n  Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,\n  Dexuan Cui <decui@microsoft.com>,\n =?iso-8859-2?q?Krzysztof_Ha=B3asa?= <khalasa@piap.pl>,\n  Lukas Wunner <lukas@wunner.de>, Oliver O'Halloran <oohall@gmail.com>,\n  Saurabh Singh Sengar <ssengar@microsoft.com>,\n  Shuan He <heshuan@bytedance.com>,\n  Srivatsa Bhat <srivatsabhat@microsoft.com>, linux-pci@vger.kernel.org,\n  linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org","Subject":"Re: [PATCH 14/20] alpha/PCI: Add static PCI resource attribute\n macros","In-Reply-To":"<20260410055040.39233-15-kwilczynski@kernel.org>","Message-ID":"<2c5b50c7-b357-025d-e0de-1fce1fcddf20@linux.intel.com>","References":"<20260410055040.39233-1-kwilczynski@kernel.org>\n <20260410055040.39233-15-kwilczynski@kernel.org>","Precedence":"bulk","X-Mailing-List":"linux-pci@vger.kernel.org","List-Id":"<linux-pci.vger.kernel.org>","List-Subscribe":"<mailto:linux-pci+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pci+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"multipart/mixed; BOUNDARY=\"8323328-866756695-1775819880=:1195\"","Content-ID":"<2a2e8981-2c02-5e58-5eae-1f1106216ee6@linux.intel.com>"}},{"id":3675847,"web_url":"http://patchwork.ozlabs.org/comment/3675847/","msgid":"<20260410114852.GA1761359@rocinante>","list_archive_url":null,"date":"2026-04-10T11:48:52","subject":"Re: [PATCH 14/20] alpha/PCI: Add static PCI resource attribute macros","submitter":{"id":86709,"url":"http://patchwork.ozlabs.org/api/people/86709/","name":"Krzysztof Wilczyński","email":"kwilczynski@kernel.org"},"content":"Hello,\n\n> > +#define __pci_dev_resource_attr(_bar, _name, _suffix, _mmap)\t\t\\\n> > +static const struct bin_attribute\t\t\t\t\t\\\n> > +pci_dev_resource##_bar##_suffix##_attr = {\t\t\t\t\\\n> > +\t.attr = { .name = __stringify(_name), .mode = 0600 },\t\t\\\n> > +\t.private = (void *)(unsigned long)(_bar),\t\t\t\\\n> > +\t.mmap = (_mmap),\t\t\t\t\t\t\\\n> > +}\n> > +\n> > +#define pci_dev_resource_attr(_bar)\t\t\t\t\t\\\n> > +\t__pci_dev_resource_attr(_bar, resource##_bar,,\t\t\t\\\n> > +\t\t\t    pci_mmap_resource_dense)\n> > +\n> > +#define pci_dev_resource_sparse_attr(_bar)\t\t\t\t\\\n> > +\t__pci_dev_resource_attr(_bar, resource##_bar##_sparse, _sparse,\t\\\n> > +\t\t\t    pci_mmap_resource_sparse)\n> > +\n> > +#define pci_dev_resource_dense_attr(_bar)\t\t\t\t\\\n> > +\t__pci_dev_resource_attr(_bar, resource##_bar##_dense, _dense,\t\\\n> > +\t\t\t    pci_mmap_resource_dense)\n> > +\n> >  /**\n> >   * pci_remove_resource_files - cleanup resource files\n> >   * @pdev: pci_dev to cleanup\n> > \n> \n> Wouldn't this belong together with the next patch, or is there some good \n> reason why you added them separately?\n\nNo specific reason other than to make it easier to review.  The pattern\nhere is: macros first and then users later (when converting things over).\n\nThank you!\n\n\tKrzysztof","headers":{"Return-Path":"\n <linux-pci+bounces-52306-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pci@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=TbE+TtYG;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=linux-pci+bounces-52306-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"TbE+TtYG\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fsZp95ffgz1yGS\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 21:49:05 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 3BD693029D59\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 11:49:00 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 4C3903BC66D;\n\tFri, 10 Apr 2026 11:48:55 +0000 (UTC)","from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 29E223BC664;\n\tFri, 10 Apr 2026 11:48:54 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 4C988C19421;\n\tFri, 10 Apr 2026 11:48:54 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775821735; cv=none;\n b=tQoIguiKx1TKYzMErbbSeAa+79sRcfFeKYQ7X3w4whXoHnBDAJHzpSIaxozCj5dBfJbde8oTkMhEM/xofIsodvKE+nol6YEoRjc4wSorX38VceYTQf/Pr1bTANQo6+tkh9DP4dran4rOZr2Jb/PN+LQkOjEVBDqnCyHVfNg6eR8=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775821735; c=relaxed/simple;\n\tbh=LZilPulN3qlgDY3IxRp/Zcm4TbaTOPqVA6WSuY47T5E=;\n\th=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:\n\t Content-Type:Content-Disposition:In-Reply-To;\n b=dD8vKON39QCj4y6ntAs+5P+2elgWe+YVzfq6GepJewGEanUOiD0Iv8U75yJqYnO6k7kgBigz1jpg66OdxoiFZ8vxd84atotCkNC2Bla1Gnoat1zJTX9ogJuxy+8KfSRLBvmySt+hlGso5Et8eRCTMRZvUMGnMTYJDYzVQS5o2Es=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=TbE+TtYG; arc=none smtp.client-ip=10.30.226.201","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1775821734;\n\tbh=LZilPulN3qlgDY3IxRp/Zcm4TbaTOPqVA6WSuY47T5E=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=TbE+TtYGOr1Hy4myyKWvvk1P2h7Vxhu8skNaAGe/jW4iBxEEXsK4jt8HwjFzOfbfg\n\t V4wQvrxksT9bTS+Ge4keWG1lgcI9FpM+5LZOyo9TcUoB2qPyLMtbnrDGbHNLJPtCSq\n\t 4IiH5OKUaNI0b9oY2dK1MZA+QquqKwoxA8OMYgRsd6L5/A2Ofe9UNBAjsPd3EfKtCi\n\t oYdcZcyaQGv33aiJSdEzhOehJjwJjkzBRTS70S/bCsFy8m4ifTze2+TeeWnC00xN8X\n\t 49zICxu10mM5Bo7ALz0On5lo6oB7Z6qdXSzOD8v0NKftzd6B80g90n04HBaLinJuhg\n\t NuTZwUKrQPU/w==","Date":"Fri, 10 Apr 2026 20:48:52 +0900","From":"Krzysztof =?utf-8?q?Wilczy=C5=84ski?= <kwilczynski@kernel.org>","To":"Ilpo =?utf-8?b?SsOkcnZpbmVu?= <ilpo.jarvinen@linux.intel.com>","Cc":"Bjorn Helgaas <bhelgaas@google.com>, Bjorn Helgaas <helgaas@kernel.org>,\n Manivannan Sadhasivam <mani@kernel.org>,\n Lorenzo Pieralisi <lpieralisi@kernel.org>,\n Magnus Lindholm <linmag7@gmail.com>, Matt Turner <mattst88@gmail.com>,\n Richard Henderson <richard.henderson@linaro.org>,\n Christophe Leroy <chleroy@kernel.org>,\n Madhavan Srinivasan <maddy@linux.ibm.com>,\n Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,\n Dexuan Cui <decui@microsoft.com>,\n Krzysztof =?utf-8?q?Ha=C5=82asa?= <khalasa@piap.pl>,\n Lukas Wunner <lukas@wunner.de>, Oliver O'Halloran <oohall@gmail.com>,\n Saurabh Singh Sengar <ssengar@microsoft.com>,\n Shuan He <heshuan@bytedance.com>, Srivatsa Bhat <srivatsabhat@microsoft.com>,\n linux-pci@vger.kernel.org, linux-alpha@vger.kernel.org,\n linuxppc-dev@lists.ozlabs.org","Subject":"Re: [PATCH 14/20] alpha/PCI: Add static PCI resource attribute macros","Message-ID":"<20260410114852.GA1761359@rocinante>","References":"<20260410055040.39233-1-kwilczynski@kernel.org>\n <20260410055040.39233-15-kwilczynski@kernel.org>\n <2c5b50c7-b357-025d-e0de-1fce1fcddf20@linux.intel.com>","Precedence":"bulk","X-Mailing-List":"linux-pci@vger.kernel.org","List-Id":"<linux-pci.vger.kernel.org>","List-Subscribe":"<mailto:linux-pci+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pci+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<2c5b50c7-b357-025d-e0de-1fce1fcddf20@linux.intel.com>"}}]