[{"id":3675844,"web_url":"http://patchwork.ozlabs.org/comment/3675844/","msgid":"<13001ba0-35fb-f38d-5764-3c95fc3eb074@linux.intel.com>","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 <linuxppc-dev+bounces-19566-incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linuxppc-dev@lists.ozlabs.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=aU3MSRX8;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:21b9:f100::1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-19566-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)","lists.ozlabs.org;\n arc=none smtp.remote-ip=192.198.163.14","lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=linux.intel.com","lists.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=aU3MSRX8;\n\tdkim-atps=neutral","lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=linux.intel.com\n (client-ip=192.198.163.14; helo=mgamail.intel.com;\n envelope-from=ilpo.jarvinen@linux.intel.com; receiver=lists.ozlabs.org)"],"Received":["from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:21b9:f100::1])\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 4fsZnx3kTwz1yGS\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 21:48:52 +1000 (AEST)","from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4fsZnv74DKz2yft;\n\tFri, 10 Apr 2026 21:48:51 +1000 (AEST)","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 lists.ozlabs.org (Postfix) with ESMTPS id 4fsZnr0GcNz2xLt\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 10 Apr 2026 21:48:46 +1000 (AEST)","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=lists.ozlabs.org; s=201707; t=1775821731;\n\tcv=none;\n b=d2rIRNKKvb6ffMXYxTVAMJdF5r7Fm2pUTkRrPjK14g67WEBWTJXDCsPLMXqiiycpMKY0Or43x3N8CcZMFHM9eBtUL5wUCMl91qhvVDVTEfp9fzn1YPyLEibFcgZESvjGm6+YyTdyVN3jVNoOlh3oe7pDaWWJ5Fzf2Cv1O4Bqfgl+Q6BEwFgPZLnuH2j5Aqb5UYVfPvef2K7GaH+PKGVUHXBaOX5fRR+kOeXDtqDMhXNOepZc1uO8ZGtHuXeeXYCC8LbVGWuzo9rQOIIbN6mG4A0vgDf/vunBQ7y7cLFgzOBvtcReZ3MVownyck6UuHWlKFDd5wXwDSyiBrJqit3MuQ==","ARC-Message-Signature":"i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1775821731; c=relaxed/relaxed;\n\tbh=yslpP4ruPzSzoFjAxDvMUygLvJxdYGuFousaUNGU2ug=;\n\th=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References:\n\t MIME-Version:Content-Type;\n b=PTN4CCf+VT6BgRlgzdO6vzMzzlWpRq+uEHINUpMyZ5HRTylqY6F0nryHp02tjhE+HIq4SsIoxJTRH/ObVZ2o7y4+wskC+sMHq+SWqGmIy2PWTTJraGNY6/YceFIH63ieznEQqfUbomJxhOVUqZGwpUJi36bWxJVsrER5oU6XJqRDApUwsnK/Fm4VUp0bGWG2/OQtWYPIvhthswxDTSZQy6nJoHqHWJ/o8f/Kg91mhvy+M90/A8dHdmar4AAmlcs2u2NIATBUSyUsvznEY10ZK6yQWV10v0ZUE6dnP3C2m1MoMVuhNtVlFrlmkPVCpI7Y4NWSfqsm/j9gQOdwfsRafQ==","ARC-Authentication-Results":"i=1; lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=linux.intel.com;\n dkim=pass (2048-bit key;\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=aU3MSRX8; dkim-atps=neutral;\n spf=pass (client-ip=192.198.163.14; helo=mgamail.intel.com;\n envelope-from=ilpo.jarvinen@linux.intel.com;\n receiver=lists.ozlabs.org) smtp.mailfrom=linux.intel.com","X-Greylist":"delayed 67 seconds by postgrey-1.37 at boromir;\n Fri, 10 Apr 2026 21:48:48 AEST","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n  t=1775821728; x=1807357728;\n  h=from:date:to:cc:subject:in-reply-to:message-id:\n   references:mime-version;\n  bh=0pWx6KeF8UUq1KmtaLtAIvWwx3IczipWJf0r+7YAW4Q=;\n  b=aU3MSRX8nTHjwSDkb3s1KXEDmqCTH8GCxv+rP3QBwttzZsdYElt2VbcQ\n   SmvfAlLegEwFq/MsaCk23RbpjVKSN3n7vX+7k8HOSDgmdJc8zkx1pW41D\n   CqSVwLzlvE+FZofaMpnONmkFdMdFVihSrd16zeVuZ+1qTctSlEg4sGh+e\n   VOHoQqNan6Bt5kWKrXkGMqsn1z8i90Dtp7PGOECVWFXHrMcQAMV+zwmNK\n   chLLc40Ydp18zEt5nkemI9y8PJhemOi64QFmdKqpn1XMlGCKpdngGdTN5\n   BYQn2usKoFXjk2mObL/fVM3qDKcQeWLrS4F9sVCRkB1V7MwJILQDUcvYH\n   w==;","X-CSE-ConnectionGUID":["21em1pIrQs+tRfOCd+4h2w==","WbZ76Js1RNy+Y+L6H9CAjw=="],"X-CSE-MsgGUID":["ksVAI6gdScm+kD/tyO3cow==","fKqyVJQ2Q+SRhjuV+qc1GA=="],"X-IronPort-AV":["E=McAfee;i=\"6800,10657,11754\"; a=\"76912799\"","E=Sophos;i=\"6.23,171,1770624000\";\n   d=\"scan'208\";a=\"76912799\"","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>","X-Mailing-List":"linuxppc-dev@lists.ozlabs.org","List-Id":"<linuxppc-dev.lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev+help@lists.ozlabs.org>","List-Owner":"<mailto:linuxppc-dev+owner@lists.ozlabs.org>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Archive":"<https://lore.kernel.org/linuxppc-dev/>,\n  <https://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Subscribe":"<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>","List-Unsubscribe":"<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>","Precedence":"list","MIME-Version":"1.0","Content-Type":"multipart/mixed; boundary=\"8323328-1569654593-1775821642=:1195\"","X-Spam-Status":"No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,\n\tDKIM_VALID,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=disabled\n\tversion=4.0.1 OzLabs 8","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org"}},{"id":3675859,"web_url":"http://patchwork.ozlabs.org/comment/3675859/","msgid":"<20260410120458.GA1775649@rocinante>","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 <linuxppc-dev+bounces-19569-incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linuxppc-dev@lists.ozlabs.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=lists.ozlabs.org\n (client-ip=112.213.38.117; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-19569-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)","lists.ozlabs.org;\n arc=none smtp.remote-ip=\"2600:3c04:e001:324:0:1991:8:25\"","lists.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org","lists.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","lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org\n (client-ip=2600:3c04:e001:324:0:1991:8:25; helo=tor.source.kernel.org;\n envelope-from=kwilczynski@kernel.org; receiver=lists.ozlabs.org)"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1 raw public key)\n server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fsb8f3j8Nz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 22:05:05 +1000 (AEST)","from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4fsb8c1VHbz2yft;\n\tFri, 10 Apr 2026 22:05:04 +1000 (AEST)","from tor.source.kernel.org (tor.source.kernel.org\n [IPv6:2600:3c04:e001:324:0:1991:8:25])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4fsb8Z71kpz2xLt\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 10 Apr 2026 22:05:02 +1000 (AEST)","from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby tor.source.kernel.org (Postfix) with ESMTP id 54BB16091C;\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=lists.ozlabs.org; s=201707; t=1775822704;\n\tcv=none;\n b=NW5pngip3fkMnZailJMn1kAT6jvGnPaGa1BbtrFPpqfJzFrddd7O3ZxUCUZ5FSlVYn8sGFrGo3Z5R7sbevDiAhZ9Q/0XKYwfKll037VlTnv9QGU1AEQ4fxpotgvkWtcOCpsit7deny0Ei4sFujWYitzh2U6604rJP5hBlFhwls5NgMJ7g/vhN8gA7sesSq91f9Rv/brypUKeuVAorlvRiDQH15wSoXwED+Yoa4NPrREU92c3o8GNLvlXKAHc2uOURTEw1TBwxwMMuboMltZED9g5Sw/ifnh7u/FEgsFUbtC1ORSozU0O9+UVEs4TI0968YdOre1D5PjuoOBxltbaVw==","ARC-Message-Signature":"i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1775822704; c=relaxed/relaxed;\n\tbh=BtDZ2ui0rJ/DbeJGW+P3llJnQoPAEuVzN99p6Oq9AwM=;\n\th=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:\n\t Content-Type:Content-Disposition:In-Reply-To;\n b=AZmg7BCeaBu0UlErF8BgNHb/hw0a6m2HWjtnboH6wPy4M4vbgQ/dpGkp5AlPxHqKIwc5ar6ynUCdwmvzgBiGk6Ht1bktZ3vbeLNlBmyxPKroZZ56cpj3WX6Zeh7ihoIPLbCqAQgtD+0TmAKhPbqnGfEHYkQeWR24ByLa52KS0uTIXU7V53KFtIooFLnkIcqMwkZlAyGQPZUMsR2xx9qYMBrIPlz3exLp//xDJNnhAwI/4EINs9Zekt6kaaFIhoGJNGbx4g8tC+DOYH06ej5PovOFZEgLZGVFcV3252fJRAy9ZDHcKrjXuXGi7cqXigCuT3Dm6cA/SHmA0Z4LQUYrhQ==","ARC-Authentication-Results":"i=1; lists.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org;\n dkim=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; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c04:e001:324:0:1991:8:25;\n helo=tor.source.kernel.org; envelope-from=kwilczynski@kernel.org;\n receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org","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>","X-Mailing-List":"linuxppc-dev@lists.ozlabs.org","List-Id":"<linuxppc-dev.lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev+help@lists.ozlabs.org>","List-Owner":"<mailto:linuxppc-dev+owner@lists.ozlabs.org>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Archive":"<https://lore.kernel.org/linuxppc-dev/>,\n  <https://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Subscribe":"<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>","List-Unsubscribe":"<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>","Precedence":"list","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>","X-Spam-Status":"No, score=-0.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,\n\tDKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS\n\tautolearn=disabled version=4.0.1 OzLabs 8","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org"}}]