[PATCH] uio: uio_pdrv_genirq: restore UIO name without the unit address
From: Maciej Andrzejewski ICEYE
Date: Thu Aug 20 2026 - 12:31:35 EST
Commit 90fa0280553a ("uio_pdrv_genirq: convert to use device_property
APIs") switched the driver to the device_property API so that a UIO
device can also be described through an ACPI overlay. As part of that
conversion the default name handed to userspace changed from "%pOFn" to
"%pfwP".
The two specifiers are not interchangeable. The printk format
documentation defines %pfwP as the node name including an address if
there is one, while %pOFn prints the device tree node name with the unit
address stripped. A node named "dma@a0000000" therefore appeared in
/sys/class/uio/uioN/name as "dma" up to v6.9 and as "dma@a0000000" from
v6.10 onwards.
That name is the only stable handle userspace has for a UIO device,
because the uioN index follows probe order. Applications that resolve a
device by name, for instance through the libuio uio_find_by_uio_name()
helper, stop finding it.
Nothing in the conversion suggests the rename was intended.
Documentation/driver-api/uio-howto.rst still states that the node's name
without the unit address is exposed as the name for the UIO device in
userspace, and uio_dmem_genirq still builds its name with %pOFn. The
"linux,uio-name" property added by commit b0297622a972 ("uio:
uio_pdrv_genirq: Make UIO name controllable via DT node property")
already lets a board distinguish several identically named nodes, so the
default does not need to carry the unit address.
fwnode has no equivalent of the %pOFn name-only modifier, which is
likely why the closest specifier was picked. Print device tree nodes
through %pOFn and leave every other firmware node type on %pfwP. This
driver could not be probed from ACPI before 90fa0280553a, so ACPI
naming is unaffected.
Should the unit address in the default name turn out to be wanted after
all, then uio-howto.rst is the file that needs the change instead, and I
am happy to send that patch rather than this one.
Fixes: 90fa0280553a ("uio_pdrv_genirq: convert to use device_property APIs")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Maciej Andrzejewski ICEYE <maciej.andrzejewski@xxxxxxxxxxx>
---
Notes:
Found on a Zynq UltraScale+ platform where FPGA blocks are exposed
through generic-uio nodes. Userspace uses libuio and resolves those
devices by name, so the applications stopped finding them after a move
from 4.19 to 6.12.
The single generic-uio node in tree is renamed the same way:
uio@d0000000 in arch/arc/boot/dts/vdk_axs10x_mb.dtsi reads back as "uio"
before v6.10 and as "uio@d0000000" after it.
Build tested on x86_64 with W=1 and CONFIG_UIO_PDRV_GENIRQ=m, once with
CONFIG_OF=y and once with CONFIG_OF=n. No warnings either way.
drivers/uio/uio_pdrv_genirq.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
index 0c8d73e7be52..27268c8d1b94 100644
--- a/drivers/uio/uio_pdrv_genirq.c
+++ b/drivers/uio/uio_pdrv_genirq.c
@@ -128,6 +128,9 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev)
if (!device_property_read_string(&pdev->dev, "linux,uio-name", &name))
uioinfo->name = devm_kstrdup(&pdev->dev, name, GFP_KERNEL);
+ else if (is_of_node(node))
+ uioinfo->name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
+ "%pOFn", to_of_node(node));
else
uioinfo->name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
"%pfwP", node);
--
2.50.1