diff options
| author | Krzysztof Wilczyński <kwilczynski@kernel.org> | 2026-08-14 07:05:21 +0000 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2026-10-07 16:13:25 -0500 |
| commit | 1832dc1579aa7cc7cd41843770767e7a3ffa8364 (patch) | |
| tree | f3252b415779be03ccc1a2191efa218385866b39 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 337bdf853101a0ee66eadf668f0fef21f8276b52 (diff) | |
PCI/sysfs: Handle a malformed _DSM result in acpi_attr_is_visible()
Currently, the "label" and "acpi_index" attributes are created whenever the
_DSM function 0 bitmap advertises the Device Name function, without
evaluating that function. The documented ABI states that each attribute is
created only if the firmware has given a name or an instance number to the
PCI device.
The bitmap says nothing about the object the function returns. Firmware
that advertises the function but returns an object that cannot be parsed
therefore produces attributes that exist and fail every read, as in the
report below.
Evaluate the Device Name _DSM when deciding attribute visibility and create
each attribute only when the element it exports has a type the read path
accepts, mirroring the checks performed at read time. The SMBIOS attribute
group already follows this pattern by performing the DMI lookup in its
is_visible() callback. The read side checks remain in place since the two
evaluations happen at different times.
This restores the behaviour from before commit 2fc59fe2ecdc ("PCI /
pci-label: treat PCI label with index 0 as valid label"), which switched
visibility from evaluating the function to checking only the function 0
bitmap. The check is now made for each attribute, not once for both.
Fixes: 2fc59fe2ecdc ("PCI / pci-label: treat PCI label with index 0 as valid label")
Closes: https://github.com/pciutils/pciutils/issues/175
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260814070522.2327975-4-kwilczynski@kernel.org
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
