[{"id":3675848,"web_url":"http://patchwork.ozlabs.org/comment/3675848/","msgid":"<13001ba0-35fb-f38d-5764-3c95fc3eb074@linux.intel.com>","list_archive_url":null,"date":"2026-04-10T11:47:22","subject":"Re: [PATCH 19/20] PCI/sysfs: Convert legacy I/O and memory attributes\n to static definitions","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> Currently, legacy_io and legacy_mem are dynamically allocated and\n> created by pci_create_legacy_files(), with pci_adjust_legacy_attr()\n> updating the attributes at runtime on Alpha to rename them and shift\n> the size for sparse addressing.\n> \n> Convert to four static const attributes (legacy_io, legacy_io_sparse,\n> legacy_mem, legacy_mem_sparse) with is_bin_visible() callbacks that\n> use pci_legacy_has_sparse() to select the appropriate variant per bus.\n> The sizes are compile-time constants and .size is set directly on\n> each attribute.\n> \n> Register the groups in pcibus_groups[] under a HAVE_PCI_LEGACY guard\n> so the driver model handles creation and removal automatically.\n> \n> Stub out pci_create_legacy_files() and pci_remove_legacy_files() as\n> the dynamic creation is no longer needed.  Remove the __weak\n> pci_adjust_legacy_attr(), Alpha's override, and its declaration from\n> both Alpha and PowerPC asm/pci.h headers.\n> \n> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>\n> ---\n>  arch/alpha/include/asm/pci.h   |   4 +-\n>  arch/alpha/kernel/pci-sysfs.c  |  24 ----\n>  arch/powerpc/include/asm/pci.h |   2 -\n>  drivers/pci/pci-sysfs.c        | 200 ++++++++++++++++++++-------------\n>  4 files changed, 122 insertions(+), 108 deletions(-)\n> \n> diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h\n> index ef19295f2e33..ad5d1391e1fa 100644\n> --- a/arch/alpha/include/asm/pci.h\n> +++ b/arch/alpha/include/asm/pci.h\n> @@ -84,8 +84,8 @@ extern int pci_legacy_write(struct pci_bus *bus, loff_t port, u32 val,\n>  extern int pci_mmap_legacy_page_range(struct pci_bus *bus,\n>  \t\t\t\t      struct vm_area_struct *vma,\n>  \t\t\t\t      enum pci_mmap_state mmap_state);\n> -extern void pci_adjust_legacy_attr(struct pci_bus *bus,\n> -\t\t\t\t   enum pci_mmap_state mmap_type);\n> +extern bool pci_legacy_has_sparse(struct pci_bus *bus,\n> +\t\t\t\t  enum pci_mmap_state type);\n>  #define HAVE_PCI_LEGACY\t1\n>  \n>  extern const struct attribute_group pci_dev_resource_attr_group;\n> diff --git a/arch/alpha/kernel/pci-sysfs.c b/arch/alpha/kernel/pci-sysfs.c\n> index 2031a3b6972c..2db91169bf5a 100644\n> --- a/arch/alpha/kernel/pci-sysfs.c\n> +++ b/arch/alpha/kernel/pci-sysfs.c\n> @@ -197,30 +197,6 @@ bool pci_legacy_has_sparse(struct pci_bus *bus, enum pci_mmap_state type)\n>  \treturn has_sparse(hose, type);\n>  }\n>  \n> -/**\n> - * pci_adjust_legacy_attr - adjustment of legacy file attributes\n> - * @bus: bus to create files under\n> - * @mmap_type: I/O port or memory\n> - *\n> - * Adjust file name and size for sparse mappings.\n> - */\n> -void pci_adjust_legacy_attr(struct pci_bus *bus, enum pci_mmap_state mmap_type)\n> -{\n> -\tstruct pci_controller *hose = bus->sysdata;\n> -\n> -\tif (!has_sparse(hose, mmap_type))\n> -\t\treturn;\n> -\n> -\tif (mmap_type == pci_mmap_mem) {\n> -\t\tbus->legacy_mem->attr.name = \"legacy_mem_sparse\";\n> -\t\tbus->legacy_mem->size <<= 5;\n> -\t} else {\n> -\t\tbus->legacy_io->attr.name = \"legacy_io_sparse\";\n> -\t\tbus->legacy_io->size <<= 5;\n> -\t}\n> -\treturn;\n> -}\n> -\n>  /* Legacy I/O bus read/write functions */\n>  int pci_legacy_read(struct pci_bus *bus, loff_t port, u32 *val, size_t size)\n>  {\n> diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h\n> index 46a9c4491ed0..72f286e74786 100644\n> --- a/arch/powerpc/include/asm/pci.h\n> +++ b/arch/powerpc/include/asm/pci.h\n> @@ -82,8 +82,6 @@ extern int pci_legacy_write(struct pci_bus *bus, loff_t port, u32 val,\n>  extern int pci_mmap_legacy_page_range(struct pci_bus *bus,\n>  \t\t\t\t      struct vm_area_struct *vma,\n>  \t\t\t\t      enum pci_mmap_state mmap_state);\n> -extern void pci_adjust_legacy_attr(struct pci_bus *bus,\n> -\t\t\t\t   enum pci_mmap_state mmap_type);\n>  #define HAVE_PCI_LEGACY\t1\n>  \n>  extern void pcibios_claim_one_bus(struct pci_bus *b);\n> diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c\n> index fe079fb31dce..dc0bb0488317 100644\n> --- a/drivers/pci/pci-sysfs.c\n> +++ b/drivers/pci/pci-sysfs.c\n> @@ -702,11 +702,6 @@ static const struct attribute_group pcibus_group = {\n>  \t.attrs = pcibus_attrs,\n>  };\n>  \n> -const struct attribute_group *pcibus_groups[] = {\n> -\t&pcibus_group,\n> -\tNULL,\n> -};\n> -\n>  static ssize_t boot_vga_show(struct device *dev, struct device_attribute *attr,\n>  \t\t\t     char *buf)\n>  {\n> @@ -1025,91 +1020,136 @@ bool __weak pci_legacy_has_sparse(struct pci_bus *bus,\n>  \treturn false;\n>  }\n>  \n> -/**\n> - * pci_adjust_legacy_attr - adjustment of legacy file attributes\n> - * @b: bus to create files under\n> - * @mmap_type: I/O port or memory\n> - *\n> - * Stub implementation. Can be overridden by arch if necessary.\n> - */\n> -void __weak pci_adjust_legacy_attr(struct pci_bus *b,\n> -\t\t\t\t   enum pci_mmap_state mmap_type)\n> +static inline umode_t __pci_legacy_is_visible(struct kobject *kobj,\n> +\t\t\t\t\t      const struct bin_attribute *a,\n> +\t\t\t\t\t      enum pci_mmap_state type,\n> +\t\t\t\t\t      bool sparse)\n>  {\n> +\tstruct pci_bus *bus = to_pci_bus(kobj_to_dev(kobj));\n> +\n> +\tif (pci_legacy_has_sparse(bus, type) != sparse)\n> +\t\treturn 0;\n> +\n> +\treturn a->attr.mode;\n>  }\n>  \n> -/**\n> - * pci_create_legacy_files - create legacy I/O port and memory files\n> - * @b: bus to create files under\n> - *\n> - * Some platforms allow access to legacy I/O port and ISA memory space on\n> - * a per-bus basis.  This routine creates the files and ties them into\n> - * their associated read, write and mmap files from pci-sysfs.c\n> - *\n> - * On error unwind, but don't propagate the error to the caller\n> - * as it is ok to set up the PCI bus without these files.\n> - */\n> -void pci_create_legacy_files(struct pci_bus *b)\n> +static umode_t pci_legacy_io_is_visible(struct kobject *kobj,\n> +\t\t\t\t\tconst struct bin_attribute *a, int n)\n>  {\n> -\tint error;\n> -\n> -\tif (!sysfs_initialized)\n> -\t\treturn;\n> -\n> -\tb->legacy_io = kzalloc_objs(struct bin_attribute, 2, GFP_ATOMIC);\n> -\tif (!b->legacy_io)\n> -\t\tgoto kzalloc_err;\n> -\n> -\tsysfs_bin_attr_init(b->legacy_io);\n> -\tb->legacy_io->attr.name = \"legacy_io\";\n> -\tb->legacy_io->size = 0xffff;\n> -\tb->legacy_io->attr.mode = 0600;\n> -\tb->legacy_io->read = pci_read_legacy_io;\n> -\tb->legacy_io->write = pci_write_legacy_io;\n> -\t/* See pci_create_attr() for motivation */\n> -\tb->legacy_io->llseek = pci_llseek_resource;\n> -\tb->legacy_io->mmap = pci_mmap_legacy_io;\n> -\tb->legacy_io->f_mapping = iomem_get_mapping;\n> -\tpci_adjust_legacy_attr(b, pci_mmap_io);\n> -\terror = device_create_bin_file(&b->dev, b->legacy_io);\n> -\tif (error)\n> -\t\tgoto legacy_io_err;\n> -\n> -\t/* Allocated above after the legacy_io struct */\n> -\tb->legacy_mem = b->legacy_io + 1;\n> -\tsysfs_bin_attr_init(b->legacy_mem);\n> -\tb->legacy_mem->attr.name = \"legacy_mem\";\n> -\tb->legacy_mem->size = 1024*1024;\n> -\tb->legacy_mem->attr.mode = 0600;\n> -\tb->legacy_mem->mmap = pci_mmap_legacy_mem;\n> -\t/* See pci_create_attr() for motivation */\n> -\tb->legacy_mem->llseek = pci_llseek_resource;\n> -\tb->legacy_mem->f_mapping = iomem_get_mapping;\n> -\tpci_adjust_legacy_attr(b, pci_mmap_mem);\n> -\terror = device_create_bin_file(&b->dev, b->legacy_mem);\n> -\tif (error)\n> -\t\tgoto legacy_mem_err;\n> -\n> -\treturn;\n> -\n> -legacy_mem_err:\n> -\tdevice_remove_bin_file(&b->dev, b->legacy_io);\n> -legacy_io_err:\n> -\tkfree(b->legacy_io);\n> -\tb->legacy_io = NULL;\n> -kzalloc_err:\n> -\tdev_warn(&b->dev, \"could not create legacy I/O port and ISA memory resources in sysfs\\n\");\n> +\treturn __pci_legacy_is_visible(kobj, a, pci_mmap_io, false);\n>  }\n>  \n> -void pci_remove_legacy_files(struct pci_bus *b)\n> +static umode_t pci_legacy_io_sparse_is_visible(struct kobject *kobj,\n> +\t\t\t\t\t       const struct bin_attribute *a,\n> +\t\t\t\t\t       int n)\n>  {\n> -\tif (b->legacy_io) {\n> -\t\tdevice_remove_bin_file(&b->dev, b->legacy_io);\n> -\t\tdevice_remove_bin_file(&b->dev, b->legacy_mem);\n> -\t\tkfree(b->legacy_io); /* both are allocated here */\n> -\t}\n> +\treturn __pci_legacy_is_visible(kobj, a, pci_mmap_io, true);\n>  }\n> +\n> +static umode_t pci_legacy_mem_is_visible(struct kobject *kobj,\n> +\t\t\t\t\t const struct bin_attribute *a, int n)\n> +{\n> +\treturn __pci_legacy_is_visible(kobj, a, pci_mmap_mem, false);\n> +}\n> +\n> +static umode_t pci_legacy_mem_sparse_is_visible(struct kobject *kobj,\n> +\t\t\t\t\t\tconst struct bin_attribute *a,\n> +\t\t\t\t\t\tint n)\n> +{\n> +\treturn __pci_legacy_is_visible(kobj, a, pci_mmap_mem, true);\n> +}\n> +\n> +static const struct bin_attribute pci_legacy_io_attr = {\n> +\t.attr = { .name = \"legacy_io\", .mode = 0600 },\n> +\t.size = 0xffff,\n> +\t.read = pci_read_legacy_io,\n> +\t.write = pci_write_legacy_io,\n> +\t.mmap = pci_mmap_legacy_io,\n> +\t.llseek = pci_llseek_resource,\n> +\t.f_mapping = iomem_get_mapping,\n> +};\n> +\n> +static const struct bin_attribute pci_legacy_io_sparse_attr = {\n> +\t.attr = { .name = \"legacy_io_sparse\", .mode = 0600 },\n> +\t.size = 0xffff << 5,\n> +\t.read = pci_read_legacy_io,\n> +\t.write = pci_write_legacy_io,\n> +\t.mmap = pci_mmap_legacy_io,\n> +\t.llseek = pci_llseek_resource,\n> +\t.f_mapping = iomem_get_mapping,\n> +};\n> +\n> +static const struct bin_attribute pci_legacy_mem_attr = {\n> +\t.attr = { .name = \"legacy_mem\", .mode = 0600 },\n> +\t.size = 0x100000,\n> +\t.mmap = pci_mmap_legacy_mem,\n> +\t.llseek = pci_llseek_resource,\n> +\t.f_mapping = iomem_get_mapping,\n> +};\n> +\n> +static const struct bin_attribute pci_legacy_mem_sparse_attr = {\n> +\t.attr = { .name = \"legacy_mem_sparse\", .mode = 0600 },\n> +\t.size = 0x100000 << 5,\n\nI suggest naming these legacy literals with defines. At least the mem one \ncould also use SZ_1M:\n\n#define PCI_LEGACY_MEM_SIZE\tSZ_1M\n\n> +\t.mmap = pci_mmap_legacy_mem,\n> +\t.llseek = pci_llseek_resource,\n> +\t.f_mapping = iomem_get_mapping,\n> +};\n> +\n> +static const struct bin_attribute *const pci_legacy_io_attrs[] = {\n> +\t&pci_legacy_io_attr,\n> +\tNULL,\n> +};\n> +\n> +static const struct bin_attribute *const pci_legacy_io_sparse_attrs[] = {\n> +\t&pci_legacy_io_sparse_attr,\n> +\tNULL,\n> +};\n> +\n> +static const struct bin_attribute *const pci_legacy_mem_attrs[] = {\n> +\t&pci_legacy_mem_attr,\n> +\tNULL,\n> +};\n> +\n> +static const struct bin_attribute *const pci_legacy_mem_sparse_attrs[] = {\n> +\t&pci_legacy_mem_sparse_attr,\n> +\tNULL,\n> +};\n> +\n> +static const struct attribute_group pci_legacy_io_group = {\n> +\t.bin_attrs = pci_legacy_io_attrs,\n> +\t.is_bin_visible = pci_legacy_io_is_visible,\n> +};\n> +\n> +static const struct attribute_group pci_legacy_io_sparse_group = {\n> +\t.bin_attrs = pci_legacy_io_sparse_attrs,\n> +\t.is_bin_visible = pci_legacy_io_sparse_is_visible,\n> +};\n> +\n> +static const struct attribute_group pci_legacy_mem_group = {\n> +\t.bin_attrs = pci_legacy_mem_attrs,\n> +\t.is_bin_visible = pci_legacy_mem_is_visible,\n> +};\n> +\n> +static const struct attribute_group pci_legacy_mem_sparse_group = {\n> +\t.bin_attrs = pci_legacy_mem_sparse_attrs,\n> +\t.is_bin_visible = pci_legacy_mem_sparse_is_visible,\n> +};\n> +\n> +void pci_create_legacy_files(struct pci_bus *b) { }\n> +void pci_remove_legacy_files(struct pci_bus *b) { }\n>  #endif /* HAVE_PCI_LEGACY */\n>  \n> +const struct attribute_group *pcibus_groups[] = {\n> +\t&pcibus_group,\n> +#ifdef HAVE_PCI_LEGACY\n> +\t&pci_legacy_io_group,\n> +\t&pci_legacy_io_sparse_group,\n> +\t&pci_legacy_mem_group,\n> +\t&pci_legacy_mem_sparse_group,\n> +#endif\n> +\tNULL,\n> +};\n> +\n>  #if defined(HAVE_PCI_MMAP) || defined(ARCH_GENERIC_PCI_MMAP_RESOURCE)\n>  /**\n>   * pci_mmap_resource - map a PCI resource into user memory space\n>","headers":{"Return-Path":"\n <linux-pci+bounces-52305-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=OZdmYK0n;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-52305-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=\"OZdmYK0n\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=192.198.163.14","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 sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\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 4fsZr86dq1z1yGb\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 21:50:48 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id B991E30078E7\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 11:47:41 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id CA3543A16BA;\n\tFri, 10 Apr 2026 11:47:39 +0000 (UTC)","from mgamail.intel.com (mgamail.intel.com [192.198.163.14])\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 F289F39F192;\n\tFri, 10 Apr 2026 11:47:37 +0000 (UTC)","from orviesa009.jf.intel.com ([10.64.159.149])\n  by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Apr 2026 04:47:37 -0700","from ijarvine-mobl1.ger.corp.intel.com (HELO localhost)\n ([10.245.244.118])\n  by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Apr 2026 04:47:26 -0700"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775821659; cv=none;\n b=s9emuGAADHC90+c2lsh0clzN5flmrbvWDy2aHcZ0I+IK1bX+ussdHHqIpMdMv5YflpA/fCxG7peaH8w9Wj+detA9JOXkro/xA9lqWZOZCADStbVJxHoNeTdaEkB00bqyaF2Cy64NmqrFTMk0+O38W41h0vvwQWvIXVUGLfkODhw=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775821659; c=relaxed/simple;\n\tbh=0pWx6KeF8UUq1KmtaLtAIvWwx3IczipWJf0r+7YAW4Q=;\n\th=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References:\n\t MIME-Version:Content-Type;\n b=hDnlngPf8FEJ2KQYQ43Et2YaQSnOeoDAOQeQrW7avTeX7XD+91OdPn4gG/q471E2o8zCVzm2QTV1W+gKAuTjHHRO3Wi7IgLJ89g9Lhm8KoitzobMR6h3HPNRbb4YJPfDm2cqCS9qU5yj7NRJsyzyUGDsqpPjIXOonDkfe+GozNk=","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=OZdmYK0n; arc=none smtp.client-ip=192.198.163.14","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n  t=1775821658; x=1807357658;\n  h=from:date:to:cc:subject:in-reply-to:message-id:\n   references:mime-version;\n  bh=0pWx6KeF8UUq1KmtaLtAIvWwx3IczipWJf0r+7YAW4Q=;\n  b=OZdmYK0neVs9gCKyggMjFb32GyjC5nbvdorAjjjgOJMk8Z7fEYjlJ5Or\n   jmdpBdrr3S5y6e0IvwEd1Bmer+6x1P+K8yRT8gJpwQ06RZMc0vVqdTcKD\n   VsXeWdnks9MXGiJKoF7hvLUTxR8gfjcQYgOwsjxX6sgvD1uhSbnAoPmLm\n   HK0aY0ZF7b2jdRmjghnHUkvjpJogKTUgYpHgDxht+Xu8btm3b5TQKAVhG\n   23PrsVRhAiHswp6l+XCmFXmg26f8vpTA9KJOmPg4+L5X6BOFqM7SOQGhW\n   EBIR6Cl3SsfVi5j4+pk59tnlLFzfB8L4tDsnYiGfBOKW5kRln8E+eUgCW\n   w==;","X-CSE-ConnectionGUID":["VS+nYnBiSUaGFFEb6lWRgw==","WbZ76Js1RNy+Y+L6H9CAjw=="],"X-CSE-MsgGUID":["eIlDKSgTQxiZJrXK9iZoxQ==","fKqyVJQ2Q+SRhjuV+qc1GA=="],"X-IronPort-AV":["E=McAfee;i=\"6800,10657,11754\"; a=\"76912794\"","E=Sophos;i=\"6.23,171,1770624000\";\n   d=\"scan'208\";a=\"76912794\"","E=Sophos;i=\"6.23,171,1770624000\";\n   d=\"scan'208\";a=\"228943873\""],"X-ExtLoop1":"1","From":"=?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>","Date":"Fri, 10 Apr 2026 14:47:22 +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 19/20] PCI/sysfs: Convert legacy I/O and memory attributes\n to static definitions","In-Reply-To":"<20260410055040.39233-20-kwilczynski@kernel.org>","Message-ID":"<13001ba0-35fb-f38d-5764-3c95fc3eb074@linux.intel.com>","References":"<20260410055040.39233-1-kwilczynski@kernel.org>\n <20260410055040.39233-20-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-1569654593-1775821642=:1195\""}},{"id":3675860,"web_url":"http://patchwork.ozlabs.org/comment/3675860/","msgid":"<20260410120458.GA1775649@rocinante>","list_archive_url":null,"date":"2026-04-10T12:04:58","subject":"Re: [PATCH 19/20] PCI/sysfs: Convert legacy I/O and memory\n attributes to static definitions","submitter":{"id":86709,"url":"http://patchwork.ozlabs.org/api/people/86709/","name":"Krzysztof Wilczyński","email":"kwilczynski@kernel.org"},"content":"Hello,\n\n> > +static const struct bin_attribute pci_legacy_mem_sparse_attr = {\n> > +\t.attr = { .name = \"legacy_mem_sparse\", .mode = 0600 },\n> > +\t.size = 0x100000 << 5,\n> \n> I suggest naming these legacy literals with defines. At least the mem one \n> could also use SZ_1M:\n> \n> #define PCI_LEGACY_MEM_SIZE\tSZ_1M\n\nSounds good.  Will do.\n\nThank you!\n\n\tKrzysztof","headers":{"Return-Path":"\n <linux-pci+bounces-52308-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=F+N6pl49;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-52308-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=\"F+N6pl49\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\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 4fsb932wK4z1yGb\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 22:05:27 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 0B4BD301348D\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 12:05:02 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id A24683A9D82;\n\tFri, 10 Apr 2026 12:05:00 +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 729BE3A3E9E;\n\tFri, 10 Apr 2026 12:05:00 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id BE7C9C19421;\n\tFri, 10 Apr 2026 12:04:59 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775822700; cv=none;\n b=BbNz2DyhbtEq4XDZ+BoapOGQygK653A6j21OLsCU3mu4UZ9AJWpMwvNRov6e7IGTkE2/wFpJ3JqlU9kxvmeSOmI6xABQvJHEVU+3zzwQVp1RQ17AWrGZt9IW6tqTZ9D4RRL8erKbAWBQqnvhMbBV7H4xPA+J4EyZj++FMmsKS7g=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775822700; c=relaxed/simple;\n\tbh=g4mf8jIyz2Yyw0wByKD90nIRoBjbahgRzYirW2U5NPc=;\n\th=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:\n\t Content-Type:Content-Disposition:In-Reply-To;\n b=Uk3porf3Hip9VoNp/0V7r9Zs6JIcKSWa38mrCqy22GcpJXbThb01MPfg1f7PLAkjwXVY1tZ1mXIyN7ZfExX6/HAQTwApfjNlI4RoIqYzSrcc68MlMKLkkbM7LT0jQ4ZPe7DAdeYSZ79hG1M/letZac3EfA0Q8H9aSydrQL4Tv3s=","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=F+N6pl49; 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=1775822700;\n\tbh=g4mf8jIyz2Yyw0wByKD90nIRoBjbahgRzYirW2U5NPc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=F+N6pl49rZtSUtIekcaWHqJh0s8QPcIJClDtbMJCck0OPociCN/nvqJ+ZJXS0Ztc9\n\t fbSU/X4dCcxznxYYCwW8Z+bFFX4MxROerDt7mlN0CSkcYaMgVvNiCuM+kxRNEsfrnb\n\t XJoJF/N970ODaAsQjtyzo6dLqn5HFQsBl539kH5B6zkaAK70ZWH1f8hMv7okcs3jIr\n\t bJ+L+Jz3FTIf8v/r9xDj9yecFJ/L/2rwwRyyQTc5mbf0YdtGl0S3zQEMIXi79tpHv1\n\t OLYcHl1kdFl/g8UzYRSDUNc3OJhaZH6U8g4qz5CRM0vceard8FuNYV+CpRrCCL/FMz\n\t xW06SPmUTOIlA==","Date":"Fri, 10 Apr 2026 21:04:58 +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 19/20] PCI/sysfs: Convert legacy I/O and memory\n attributes to static definitions","Message-ID":"<20260410120458.GA1775649@rocinante>","References":"<20260410055040.39233-1-kwilczynski@kernel.org>\n <20260410055040.39233-20-kwilczynski@kernel.org>\n <13001ba0-35fb-f38d-5764-3c95fc3eb074@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":"<13001ba0-35fb-f38d-5764-3c95fc3eb074@linux.intel.com>"}}]