Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2224067/?format=api
{ "id": 2224067, "url": "http://patchwork.ozlabs.org/api/patches/2224067/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260416180107.777065-10-kwilczynski@kernel.org/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/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": "<20260416180107.777065-10-kwilczynski@kernel.org>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20260416180107.777065-10-kwilczynski@kernel.org/", "date": "2026-04-16T18:00:53", "name": "[v5,09/23] PCI/sysfs: Add stubs for pci_{create,remove}_sysfs_dev_files()", "commit_ref": null, "pull_url": null, "state": "handled-elsewhere", "archived": false, "hash": "ecd807f5d0b463004540edcad5d31171345378e5", "submitter": { "id": 86709, "url": "http://patchwork.ozlabs.org/api/people/86709/?format=api", "name": "Krzysztof Wilczyński", "email": "kwilczynski@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260416180107.777065-10-kwilczynski@kernel.org/mbox/", "series": [ { "id": 500194, "url": "http://patchwork.ozlabs.org/api/series/500194/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=500194", "date": "2026-04-16T18:00:44", "name": "PCI: Convert all dynamic sysfs attributes to static", "version": 5, "mbox": "http://patchwork.ozlabs.org/series/500194/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2224067/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2224067/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linuxppc-dev+bounces-19800-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=H+wZ7Ghj;\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-19800-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)", "lists.ozlabs.org;\n arc=none smtp.remote-ip=\"2600:3c0a:e001:78e: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=H+wZ7Ghj;\n\tdkim-atps=neutral", "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org\n (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.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 4fxQp96K27z1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 04:02:25 +1000 (AEST)", "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4fxQnQ4Bw5z3bNw;\n\tFri, 17 Apr 2026 04:01:46 +1000 (AEST)", "from sea.source.kernel.org (sea.source.kernel.org\n [IPv6:2600:3c0a:e001:78e:0:1991:8:25])\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 4fxQnP53Sbz2xmX\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 17 Apr 2026 04:01:45 +1000 (AEST)", "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby sea.source.kernel.org (Postfix) with ESMTP id E26F340AF7;\n\tThu, 16 Apr 2026 18:01:43 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id 95391C2BCAF;\n\tThu, 16 Apr 2026 18:01:40 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1776362506;\n\tcv=none;\n b=DkYAMiyOCS9hcYwKgOB5NU/jNu10TInNmPx6rVyXUNG377hisN5JGtV8s0mWACZ+3fDmTVRAksWLrR9kIR4TzdJiVgMNPUdjTDKVQH23sR1RTdyB3+DNqNPyIJsOmCmhLvRbzyGvXv6IZR8ketNPSS0S20Iu34kgIlpybmCct9kQMfhsyF7u14k5yq8rx/yA/xgOKdZjFnq2cqukM4S5Dq/hROMAPrMTOhMnIMeKCXRnh6+xQutrIo2gIlPpTxx2zyh/GQDADLztcSeC8UjWzFt6FkEGBE42vVJSi5z9s6z3nDZGzwg2zZcYb/EzsIdUwbA9IB4YQnZoX2vMLrwDHQ==", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1776362506; c=relaxed/relaxed;\n\tbh=lzWRqyJIbRjEAzysxaC48fx9aNpMRJ4BGNuWLuDK3Ok=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=Rcg+gTQccX8oBc+TAtqS7SOd9SFTv81dczhDQDthA5MDy6d4aG8hfyjgU81H/yky6Fab7/+Nm9/wYPpKEKeZ7UNK9YTfnfmQArJTT6GTDIpLpjUCmfgA3TWh0f84Lop89dmIIHhZ+yGX8nDHvhgrTIY56CP7FhRUq7xnRWasFnN1Krc9Ze7kJxtLyN62pv1QIn5f8zG4dfDRIkp/ZDW+6KSwDKZnPKy2G1+NIoLg/gfoboGUNvG6ui9FFzReYl4DDdOIVD42h6xo/dY20sONwAHjMCox+PLXqeO/k5XSv2DPIZMaJgzvtiqC3gVB0mMQkSHMKo047plSPB9GIrHcVQ==", "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=H+wZ7Ghj; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c0a:e001:78e:0:1991:8:25;\n helo=sea.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=1776362503;\n\tbh=9a670pxaN5vTIVp/eoWyGpfgnbFQKJPHCQ1Ff885QlM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=H+wZ7GhjAYwIWcQXdYb/i/udmewYM7nKQOYyJvHo66UNO91HI0blFJyyiuhCvFKDL\n\t depSkOpomcT4cgaEezk2QrabpAlmHmVL6zqvbUpWvKVugdtzFUXwF2d6Gw5gc37OQ5\n\t P7sSQrgvL1jPy7dGVq9vUpjmUdqdbF4KeYnZPnkOLZpfZek+tfeYlh+6g1at6VOeOw\n\t B3S6T9NzbE7WcwDwvv7/9LLhZIurWUWZN0sUgOzOX1A+FP4jUojsdmX8p89MRVzKrG\n\t 1olj+02hAuA/5b2AdMBsqykIe2fTrcSIcfNkCa99ppHKtuU2AAdlieUpcr7Q3rHrjn\n\t uj/JnGIt57ncw==", "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 v5 09/23] PCI/sysfs: Add stubs for\n pci_{create,remove}_sysfs_dev_files()", "Date": "Thu, 16 Apr 2026 18:00:53 +0000", "Message-ID": "<20260416180107.777065-10-kwilczynski@kernel.org>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260416180107.777065-1-kwilczynski@kernel.org>", "References": "<20260416180107.777065-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": "On platforms with HAVE_PCI_MMAP or ARCH_GENERIC_PCI_MMAP_RESOURCE,\nresource files are now handled by static attribute groups registered\nvia pci_dev_groups[].\n\nThus, the pci_create_sysfs_dev_files() and pci_remove_sysfs_dev_files()\ncan now be stubbed out, as the dynamic resource file creation is no\nlonger needed.\n\nAlso, simplify pci_sysfs_init() on these platforms to only iterate\nbuses for legacy attributes creation, skipping the per-device loop.\n\nMove the __weak stubs for pci_create_resource_files() and\npci_remove_resource_files() into the #else branch since only platforms\nwithout HAVE_PCI_MMAP (such as Alpha architecture) still need them.\nGuard the res_attr[] and res_attr_wc[] fields in struct pci_dev the\nsame way.\n\nSigned-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>\n---\n drivers/pci/pci-sysfs.c | 15 ++++++++++++---\n include/linux/pci.h | 4 ++++\n 2 files changed, 16 insertions(+), 3 deletions(-)", "diff": "diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c\nindex c0925bdc9ecd..517efb6d71cc 100644\n--- a/drivers/pci/pci-sysfs.c\n+++ b/drivers/pci/pci-sysfs.c\n@@ -1394,10 +1394,9 @@ static const struct attribute_group *pci_dev_resource_attr_groups[] = {\n };\n #else\n #define pci_dev_resource_attr_groups NULL\n-#endif\n-\n int __weak pci_create_resource_files(struct pci_dev *dev) { return 0; }\n void __weak pci_remove_resource_files(struct pci_dev *dev) { }\n+#endif\n \n /**\n * pci_write_rom - used to enable access to the PCI ROM display\n@@ -1766,6 +1765,10 @@ static const struct attribute_group pci_dev_resource_resize_attr_group = {\n \t.is_visible = resource_resize_attr_is_visible,\n };\n \n+#if defined(HAVE_PCI_MMAP) || defined(ARCH_GENERIC_PCI_MMAP_RESOURCE)\n+int pci_create_sysfs_dev_files(struct pci_dev *pdev) { return 0; }\n+void pci_remove_sysfs_dev_files(struct pci_dev *pdev) { }\n+#else\n int __must_check pci_create_sysfs_dev_files(struct pci_dev *pdev)\n {\n \tif (!sysfs_initialized)\n@@ -1787,9 +1790,15 @@ void pci_remove_sysfs_dev_files(struct pci_dev *pdev)\n \n \tpci_remove_resource_files(pdev);\n }\n+#endif\n \n static int __init pci_sysfs_init(void)\n {\n+#if defined(HAVE_PCI_MMAP) || defined(ARCH_GENERIC_PCI_MMAP_RESOURCE)\n+\tstruct pci_bus *pbus = NULL;\n+\n+\tsysfs_initialized = 1;\n+#else\n \tstruct pci_dev *pdev = NULL;\n \tstruct pci_bus *pbus = NULL;\n \tint retval;\n@@ -1802,7 +1811,7 @@ static int __init pci_sysfs_init(void)\n \t\t\treturn retval;\n \t\t}\n \t}\n-\n+#endif\n \twhile ((pbus = pci_find_next_bus(pbus)))\n \t\tpci_create_legacy_files(pbus);\n \ndiff --git a/include/linux/pci.h b/include/linux/pci.h\nindex 9c0782899ef9..30aeb8e02b7b 100644\n--- a/include/linux/pci.h\n+++ b/include/linux/pci.h\n@@ -507,8 +507,10 @@ struct pci_dev {\n \tspinlock_t\tpcie_cap_lock;\t\t/* Protects RMW ops in capability accessors */\n \tu32\t\tsaved_config_space[16]; /* Config space saved at suspend time */\n \tstruct hlist_head saved_cap_space;\n+#if !defined(HAVE_PCI_MMAP) && !defined(ARCH_GENERIC_PCI_MMAP_RESOURCE)\n \tstruct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */\n \tstruct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */\n+#endif\n \n #ifdef CONFIG_HOTPLUG_PCI_PCIE\n \tunsigned int\tbroken_cmd_compl:1;\t/* No compl for some cmds */\n@@ -2526,8 +2528,10 @@ int pcibios_alloc_irq(struct pci_dev *dev);\n void pcibios_free_irq(struct pci_dev *dev);\n resource_size_t pcibios_default_alignment(void);\n \n+#if !defined(HAVE_PCI_MMAP) && !defined(ARCH_GENERIC_PCI_MMAP_RESOURCE)\n extern int pci_create_resource_files(struct pci_dev *dev);\n extern void pci_remove_resource_files(struct pci_dev *dev);\n+#endif\n \n #if defined(CONFIG_PCI_MMCONFIG) || defined(CONFIG_ACPI_MCFG)\n void __init pci_mmcfg_early_init(void);\n", "prefixes": [ "v5", "09/23" ] }