From: Lukas Wunner <lukas@wunner.de>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Saurabh Sengar <ssengar@linux.microsoft.com>,
bhelgaas@google.com, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, alexander.stein@ew.tq-group.com,
decui@microsoft.com,
Krzysztof Wilczy??ski <kwilczynski@kernel.org>
Subject: Re: [PATCH] PCI/sysfs: Fix race in pci sysfs creation
Date: Sat, 2 Mar 2024 09:57:17 +0100 [thread overview]
Message-ID: <20240302085717.GA8140@wunner.de> (raw)
In-Reply-To: <20240206220715.GA884075@bhelgaas>
On Tue, Feb 06, 2024 at 04:07:15PM -0600, Bjorn Helgaas wrote:
> Krzysztof has done a ton of work to convert these files to static
> attributes, where the device model prevents most of these races:
>
> 506140f9c06b ("PCI/sysfs: Convert "index", "acpi_index", "label" to static attributes")
> d93f8399053d ("PCI/sysfs: Convert "vpd" to static attribute")
> f42c35ea3b13 ("PCI/sysfs: Convert "reset" to static attribute")
> 527139d738d7 ("PCI/sysfs: Convert "rom" to static attribute")
> e1d3f3268b0e ("PCI/sysfs: Convert "config" to static attribute")
>
> and he even posted a series to do the same for the resource files:
>
> https://lore.kernel.org/linux-pci/20210910202623.2293708-1-kw@linux.com/
>
> I can't remember why we didn't apply that at the time, and it no
> longer applies cleanly, but I think that's the direction we should go.
When I brought up resource sysfs files in October, Bjorn said:
I think the reason pci_sysfs_init() exists in the first place is
because those resources may be assigned after pci_device_add(), and
(my memory is hazy here) it seems like changing the size of binary
attributes is hard, which might fit with the
pci_remove_resource_files() and pci_create_resource_files() in the
resource##n##_resize_store() macro
https://lore.kernel.org/all/20231019200110.GA1410324@bhelgaas/
I'm wondering in how far Krzysztof's above-mentioned patches
address the issue of late-appearing resources?
In the meantime I've learned of the existence of sysfs_update_group().
It would seem to me that if resources such as the ROM appear late,
we should just call sysfs_update_group() to make them show up in sysfs
(or correct the size of their sysfs files).
But that requires that we identify the places where resources
are unhidden. Do we know where this happens?
Thanks,
Lukas
prev parent reply other threads:[~2024-03-02 8:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-09 3:46 [PATCH] PCI/sysfs: Fix race in pci sysfs creation Saurabh Sengar
2023-12-12 7:19 ` Alexander Stein
2023-12-12 8:21 ` Saurabh Singh Sengar
2023-12-12 8:28 ` Saurabh Singh Sengar
2024-01-04 5:38 ` Saurabh Singh Sengar
2024-01-20 6:41 ` Saurabh Singh Sengar
2024-02-02 7:17 ` Saurabh Singh Sengar
2024-02-06 22:07 ` Bjorn Helgaas
2024-02-07 16:30 ` Saurabh Singh Sengar
2024-02-27 17:14 ` Saurabh Singh Sengar
2024-02-28 15:22 ` Bjorn Helgaas
2024-02-28 17:22 ` Krzysztof Wilczyński
2024-02-28 18:16 ` Saurabh Singh Sengar
2024-04-15 18:15 ` [EXTERNAL] " Saurabh Singh Sengar
2024-03-02 8:57 ` Lukas Wunner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240302085717.GA8140@wunner.de \
--to=lukas@wunner.de \
--cc=alexander.stein@ew.tq-group.com \
--cc=bhelgaas@google.com \
--cc=decui@microsoft.com \
--cc=helgaas@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=ssengar@linux.microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox