Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2221711/?format=api
{ "id": 2221711, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2221711/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260410055040.39233-8-kwilczynski@kernel.org/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/1.1/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/" }, "msgid": "<20260410055040.39233-8-kwilczynski@kernel.org>", "date": "2026-04-10T05:50:27", "name": "[07/20] PCI/sysfs: Convert __resource_resize_store() to use static attributes", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "63b1e81de2c6e431aeddf4991d652aba4eb248ee", "submitter": { "id": 86709, "url": "http://patchwork.ozlabs.org/api/1.1/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-8-kwilczynski@kernel.org/mbox/", "series": [ { "id": 499413, "url": "http://patchwork.ozlabs.org/api/1.1/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/2221711/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2221711/checks/", "tags": {}, "headers": { "Return-Path": "\n <linuxppc-dev+bounces-19540-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=OcvCvu1F;\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-19540-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=OcvCvu1F;\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 4fsSjJ1bXpz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 17:14:28 +1000 (AEST)", "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4fsSjJ0Rlbz2ynP;\n\tFri, 10 Apr 2026 17:14:28 +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 4fsQsD1xDxz2yRl\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 10 Apr 2026 15:51:12 +1000 (AEST)", "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby tor.source.kernel.org (Postfix) with ESMTP id 667AD6013F;\n\tFri, 10 Apr 2026 05:51:10 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id E09FCC19421;\n\tFri, 10 Apr 2026 05:51:06 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1775800273;\n\tcv=none;\n b=dfw/ZLNYgu9Rp7VZJ6VVIkQQAVuiEbIAGOyP/pkrmGlNCXGX0tpG+QE1dmtwW82wWtpEy7MZmPvA8JxdoWTLX7f1pLKLhL53iaHJbdnfOtR7JMN2a7RAtXYke0c9r6IOlTaq/9r8cWyidW6UhLoKybIksDLNkx9m7wW+PikxOYZYXitwd3TmSQfvsWiLau5nE2FneEosDDXZ1rD6g2BS/C+huyNi9vz3F8tYq+9fmesMHmKsUvnudWQOQye+NSp/dWBWu/WTXr/ql5xI0qLumQc6ilUSNWEWaQ7fH+hZWV4nD/iPzsA9CdH4tnhnJN/Hx48LyGYkPR5t01i11uZk8g==", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1775800273; c=relaxed/relaxed;\n\tbh=d2zGmrYTPkxrrM6eq9nj4B3qdcGy2+6kMRJhiABDag4=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=gzKsd3H7rgkofFCq62gTlL0C9ptgK+FQtbUlbwPSIhw8YJfLopBETemnEg+FVq0bN4W9F1v0M0CuSraI1HkCZr9n2opUcyR2MOH6KLjEuaiKr6XPOkNDvuftcOAj9x7LSgwlLK9vsm9CEa/IYphh+ad126Fo2kxkoOReQZDuOWEA9G8tqYi2uz6WIP8MfQiNcBIpR/+GxzDsEAA3mNjTeC+KiqV4oGZub1m8YoOu8VIaUStTszJflVaG1skD9XpdH/pG6CEJcCl5hIui7oa8gFXESrAITZJhNsUnUQU2wDkZEnuz9qERrGZSg6/m6+HTYjfq6sNuAe27mbHNenWvYg==", "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=OcvCvu1F; 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=1775800270;\n\tbh=SlA86Vk8baRXQR0BnWNH5kTBhDDsrbQCeLelGiUcIhU=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=OcvCvu1F0ELy21z3VhUeHZ6QkMm2uK3tzS3tjPDvgLq3IkQCv59Ks34yFtdIYtfkb\n\t OwNykDB4t4X9XeTkfS80bpawZL8lajMVhR9KZOrBDO06iXISXejvRIVcDf1qKzGvqE\n\t 6S/keGfXeBHWPi/f8NZ83MhatTuZl7IBNXeJYgV//BBAit3YnfmNs9dB78yjSHz3/H\n\t AQoDsbJKLzVa2jN/WM9xgfeNm89ixMJqurWfa9wiWiKtlKj4Us9R/pY80LaVx03kqK\n\t NShhU1170i4ZwjUivcMBfjuEKYVCuyjG34uQgRLuc2KJEvxedHfkEOfcP++w+2m7AW\n\t nTkyouxx4lTZw==", "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 07/20] PCI/sysfs: Convert __resource_resize_store() to use\n static attributes", "Date": "Fri, 10 Apr 2026 05:50:27 +0000", "Message-ID": "<20260410055040.39233-8-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, __resource_resize_store() calls pci_remove_resource_files()\nand pci_create_resource_files() to tear down and recreate resource\nfiles after a BAR resize.\n\nReplace this with sysfs_update_groups(), which re-evaluates visibility\nand also runs the .bin_size callback for the static resource attribute\ngroups after a BAR resize.\n\nAt the moment, the resize code references the static resource group\nsymbols, so wrap it and the resize group registration in pci_dev_groups[]\nunder the same \"HAVE_PCI_MMAP || ARCH_GENERIC_PCI_MMAP_RESOURCE\" guard.\n\nWhile at it, add a warning if pci_resize_resource() fails to\nexpose potential failures, and rename resource_resize_is_visible()\nto resource_resize_attr_is_visible() and the corresponding group\nvariable to align with the naming convention used by the resource\nattribute groups.\n\nSigned-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>\n---\n drivers/pci/pci-sysfs.c | 25 +++++++++++++++++--------\n 1 file changed, 17 insertions(+), 8 deletions(-)", "diff": "diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c\nindex e56fddbe7914..1fabd0baeb56 100644\n--- a/drivers/pci/pci-sysfs.c\n+++ b/drivers/pci/pci-sysfs.c\n@@ -1386,6 +1386,12 @@ static const struct attribute_group pci_dev_resource_wc_attr_group = {\n \t.bin_size = pci_dev_resource_bin_size,\n };\n \n+static const struct attribute_group *pci_dev_resource_attr_groups[] = {\n+\t&pci_dev_resource_io_attr_group,\n+\t&pci_dev_resource_uc_attr_group,\n+\t&pci_dev_resource_wc_attr_group,\n+\tNULL,\n+};\n #endif\n \n int __weak pci_create_resource_files(struct pci_dev *dev) { return 0; }\n@@ -1643,6 +1649,7 @@ static const struct attribute_group pci_dev_reset_method_attr_group = {\n \t.is_visible = pci_dev_reset_attr_is_visible,\n };\n \n+#if defined(HAVE_PCI_MMAP) || defined(ARCH_GENERIC_PCI_MMAP_RESOURCE)\n static ssize_t __resource_resize_show(struct device *dev, int n, char *buf)\n {\n \tstruct pci_dev *pdev = to_pci_dev(dev);\n@@ -1692,14 +1699,15 @@ static ssize_t __resource_resize_store(struct device *dev, int n,\n \tpci_write_config_word(pdev, PCI_COMMAND,\n \t\t\t cmd & ~PCI_COMMAND_MEMORY);\n \n-\tpci_remove_resource_files(pdev);\n-\n \tret = pci_resize_resource(pdev, n, size, 0);\n+\tif (ret)\n+\t\tpci_warn(pdev, \"Failed to resize BAR %d: %pe\\n\",\n+\t\t\t n, ERR_PTR(ret));\n \n \tpci_assign_unassigned_bus_resources(bus);\n \n-\tif (pci_create_resource_files(pdev))\n-\t\tpci_warn(pdev, \"Failed to recreate resource files after BAR resizing\\n\");\n+\tif (sysfs_update_groups(&pdev->dev.kobj, pci_dev_resource_attr_groups))\n+\t\tpci_warn(pdev, \"Failed to update resource groups after BAR resizing\\n\");\n \n \tpci_write_config_word(pdev, PCI_COMMAND, cmd);\n pm_put:\n@@ -1742,7 +1750,7 @@ static struct attribute *resource_resize_attrs[] = {\n \tNULL,\n };\n \n-static umode_t resource_resize_is_visible(struct kobject *kobj,\n+static umode_t resource_resize_attr_is_visible(struct kobject *kobj,\n \t\t\t\t\t struct attribute *a, int n)\n {\n \tstruct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj));\n@@ -1750,10 +1758,11 @@ static umode_t resource_resize_is_visible(struct kobject *kobj,\n \treturn pci_rebar_get_current_size(pdev, n) < 0 ? 0 : a->mode;\n }\n \n-static const struct attribute_group pci_dev_resource_resize_group = {\n+static const struct attribute_group pci_dev_resource_resize_attr_group = {\n \t.attrs = resource_resize_attrs,\n-\t.is_visible = resource_resize_is_visible,\n+\t.is_visible = resource_resize_attr_is_visible,\n };\n+#endif\n \n int __must_check pci_create_sysfs_dev_files(struct pci_dev *pdev)\n {\n@@ -1872,6 +1881,7 @@ const struct attribute_group *pci_dev_groups[] = {\n \t&pci_dev_resource_io_attr_group,\n \t&pci_dev_resource_uc_attr_group,\n \t&pci_dev_resource_wc_attr_group,\n+\t&pci_dev_resource_resize_attr_group,\n #endif\n \t&pci_dev_config_attr_group,\n \t&pci_dev_rom_attr_group,\n@@ -1884,7 +1894,6 @@ const struct attribute_group *pci_dev_groups[] = {\n #ifdef CONFIG_ACPI\n \t&pci_dev_acpi_attr_group,\n #endif\n-\t&pci_dev_resource_resize_group,\n \tARCH_PCI_DEV_GROUPS\n \tNULL,\n };\n", "prefixes": [ "07/20" ] }