Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2221722/?format=api
{ "id": 2221722, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2221722/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260410055040.39233-20-kwilczynski@kernel.org/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/1.2/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<20260410055040.39233-20-kwilczynski@kernel.org>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20260410055040.39233-20-kwilczynski@kernel.org/", "date": "2026-04-10T05:50:39", "name": "[19/20] PCI/sysfs: Convert legacy I/O and memory attributes to static definitions", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "5c1957cda52cfe59c8e5703279ea0a2eef1289c6", "submitter": { "id": 86709, "url": "http://patchwork.ozlabs.org/api/1.2/people/86709/?format=api", "name": "Krzysztof Wilczyński", "email": "kwilczynski@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260410055040.39233-20-kwilczynski@kernel.org/mbox/", "series": [ { "id": 499413, "url": "http://patchwork.ozlabs.org/api/1.2/series/499413/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=499413", "date": "2026-04-10T05:50:20", "name": "PCI: Convert all dynamic sysfs attributes to static", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/499413/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2221722/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2221722/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linuxppc-dev+bounces-19551-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=niYRvQtX;\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-19551-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)", "lists.ozlabs.org;\n arc=none smtp.remote-ip=172.105.4.254", "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=niYRvQtX;\n\tdkim-atps=neutral", "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org\n (client-ip=172.105.4.254; helo=tor.source.kernel.org;\n envelope-from=kwilczynski@kernel.org; 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 4fsSkx74Gyz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 17:15:53 +1000 (AEST)", "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4fsSkx63jXz2yrK;\n\tFri, 10 Apr 2026 17:15:53 +1000 (AEST)", "from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254])\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 lists.ozlabs.org (Postfix) with ESMTPS id 4fsQt515M5z2yRl\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 10 Apr 2026 15:51:57 +1000 (AEST)", "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby tor.source.kernel.org (Postfix) with ESMTP id F29796024D;\n\tFri, 10 Apr 2026 05:51:54 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id AB4B9C19421;\n\tFri, 10 Apr 2026 05:51:50 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1775800317;\n\tcv=none;\n b=JjmR+FUG1do920Kvf9jP+9hcp4Bk2tjFFEXMX07Wqp6bZ+fbOALbPeU4TWvQhHxi8rHG8SmnhEreVzz2ChLGgkPH7iQY1AUe5D+X/rZ3Si6M2ssGnySkk2iF9L+Xp8kVkgfwOrwGwaQC1r6zrSgpsekrSNknfUmnvtgfBdFYv2EpcUz2h7gklsDbNPIeoVFW6Iix7zK56qgBEtNvVlPbcte9g4Z1a86Rtv1evAzjouR1o3/4ej0NXmMHluAAHFLDyOoNMrzvh6n5waGCEGqZXljeE5XYwjjMGti5KUl6kJOfaI2LWUFVMxvef3fKd4HYlv2sE4w8dTCRCy60zNaGAw==", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1775800317; c=relaxed/relaxed;\n\tbh=lzj1y1zTD3pYZpmh+RvJjBiBMwazzNvsQEZ4rW4fR8g=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=VLfvYTuuO3hua+J7irm9ghh2/80NCdwLF5DXnnHnB9DqQobqRYDzhKXPR/nS89vw5ly/pFSgYrjx74eFYbuUIomh8bOE3c+7dL00Ai57RcM6NQRjVhEVGoSoRtLeyO0g6O8cVDO4FdQQYeWwvuOdH1ozVazM4/c0dDaZPq2ZBsm5q+GvPhWkWSS0Vf0f9yR/DASalacyS8lL2i7PFH+4nUmxyjAwWQc9JBLUzz6+1407H/A6B32UrfThuIV9YUu3LKDogx/hWTwezHuNOKQehhadhALZQbkln3Cb4x00EmAXAh2bA5KPnqNFlSZRWwJP+9pmyoCbErk1Px/lU0IjUw==", "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=niYRvQtX; dkim-atps=neutral;\n spf=pass (client-ip=172.105.4.254; helo=tor.source.kernel.org;\n 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=1775800314;\n\tbh=c8yWJVikSRczDJ1vgnuLNmEe+rC+ASyKq5Y3ITSl6hM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=niYRvQtXpcoEMNXzL9bJrBYa41+zSx7GnRpB8Dw26uZaDu2v773jfaqwpY86ks8Ws\n\t oLV7bqo/x2UeD6yCa4dmkDFnjmigcc6do2GPk/A470xdMbXi/sMNdUeFsTC1X3ZjMx\n\t h+2N7DO5mNikOP9m4RFRYcM216acxqAYIrgXV8LZA0tmhSHmZ7vH7KnTJPq2TY+NBx\n\t 5Oy/mJPpqeI8xyJLukhxCnt3P0K76SykkIHjjy1I9Ctl8x9/RqdyfsdqaHgGKy6WJx\n\t SbzBzPtR+YrECY9cMpmoaI6IDiGf8Reheybztl9rTDZvnhgKggQVtgHNtaarXyEMgM\n\t H5oO8Upfze92A==", "From": "=?utf-8?q?Krzysztof_Wilczy=C5=84ski?= <kwilczynski@kernel.org>", "To": "Bjorn Helgaas <bhelgaas@google.com>", "Cc": "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 =?utf-8?q?Krzysztof_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\t=?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>,\n linux-pci@vger.kernel.org, linux-alpha@vger.kernel.org,\n linuxppc-dev@lists.ozlabs.org", "Subject": "[PATCH 19/20] PCI/sysfs: Convert legacy I/O and memory attributes to\n static definitions", "Date": "Fri, 10 Apr 2026 05:50:39 +0000", "Message-ID": "<20260410055040.39233-20-kwilczynski@kernel.org>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260410055040.39233-1-kwilczynski@kernel.org>", "References": "<20260410055040.39233-1-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": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "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" }, "content": "Currently, legacy_io and legacy_mem are dynamically allocated and\ncreated by pci_create_legacy_files(), with pci_adjust_legacy_attr()\nupdating the attributes at runtime on Alpha to rename them and shift\nthe size for sparse addressing.\n\nConvert to four static const attributes (legacy_io, legacy_io_sparse,\nlegacy_mem, legacy_mem_sparse) with is_bin_visible() callbacks that\nuse pci_legacy_has_sparse() to select the appropriate variant per bus.\nThe sizes are compile-time constants and .size is set directly on\neach attribute.\n\nRegister the groups in pcibus_groups[] under a HAVE_PCI_LEGACY guard\nso the driver model handles creation and removal automatically.\n\nStub out pci_create_legacy_files() and pci_remove_legacy_files() as\nthe dynamic creation is no longer needed. Remove the __weak\npci_adjust_legacy_attr(), Alpha's override, and its declaration from\nboth Alpha and PowerPC asm/pci.h headers.\n\nSigned-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(-)", "diff": "diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h\nindex 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;\ndiff --git a/arch/alpha/kernel/pci-sysfs.c b/arch/alpha/kernel/pci-sysfs.c\nindex 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 {\ndiff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h\nindex 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);\ndiff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c\nindex 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+\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", "prefixes": [ "19/20" ] }