]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: s390: Expose the UID as an arch specific PCI slot attribute
authorNiklas Schnelle <schnelle@linux.ibm.com>
Tue, 7 Apr 2026 13:24:46 +0000 (15:24 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Sat, 11 Apr 2026 09:18:15 +0000 (11:18 +0200)
commite4f9ab031dc86c9987c3619e97c5c7d8ad7afda2
tree141e5ca9c28f24bd1e8336e7ec98a4bd8f661ece
parent737c4f4a241ca85c597ca2ef1a6f8446bf681ab5
PCI: s390: Expose the UID as an arch specific PCI slot attribute

On s390, an individual PCI function can generally be identified by two
identifiers, the FID and the UID. Which identifier is used depends on
the scope and the platform configuration.

The first identifier, the FID, is always available and identifies a PCI
device uniquely within a machine. The FID may be virtualized by
hypervisors, but on the LPAR level, the machine scope makes it
impossible to create the same configuration based on FIDs on two
different LPARs of the same machine, and difficult to reuse across
machines.

Such matching LPAR configurations are useful, though, allowing
standardized setups and booting a Linux installation on different LPARs.
To this end the UID, or user-defined identifier, was introduced. While
it is only guaranteed to be unique within an LPAR and only if indicated
by firmware, it allows users to replicate PCI device setups.

On s390, which uses a machine hypervisor, a per PCI function hotplug
model is used. The shortcoming with the UID then is, that it is not
visible to the user without first attaching the PCI function and
accessing the "uid" device attribute. The FID, on the other hand, is
used as the slot name and is thus known even with the PCI function in
standby.

Remedy this shortcoming by providing the UID as an attribute on the slot
allowing the user to identify a PCI function based on the UID without
having to first attach it. Do this via a macro mechanism analogous to
what was introduced by commit 265baca69a07 ("s390/pci: Stop usurping
pdev->dev.groups") for the PCI device attributes.

Reviewed-by: Gerd Bayer <gbayer@linux.ibm.com>
Reviewed-by: Julian Ruess <julianr@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com> # drivers/pci/slot.c
Link: https://lore.kernel.org/r/20260407-uid_slot-v8-2-15ae4409d2ce@linux.ibm.com
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Documentation/arch/s390/pci.rst
arch/s390/include/asm/pci.h
arch/s390/pci/pci_sysfs.c
drivers/pci/slot.c