Re: [PATCH] uio: uio_pdrv_genirq: restore UIO name without the unit address
From: Sakari Ailus
Date: Thu Aug 20 2026 - 16:55:28 EST
Hi Maciej,
On Thu, Aug 20, 2026 at 04:01:23PM +0200, Maciej Andrzejewski ICEYE wrote:
> 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>
The original patch indeed appears to intend no changes on existing users.
Reviewed-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
Ideally we would have an 'n' specifier for printing a less full name of a
node, i.e. %pfwn. I wouldn't try to backport that so this patch makes sense
as-is.
The '@' character doesn't have such significance on ACPI as it does have on
DT so I think 'n' would probably be best behaving as 'f' on ACPI. This
would probably mean a new fwnode op.
> ---
>
> 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);
--
Kind regards,
Sakari Ailus