From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Maciej Andrzejewski ICEYE <maciej.andrzejewski@m-works.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
chris.packham@alliedtelesis.co.nz, daniel@zonque.org,
andriy.shevchenko@linux.intel.com, stable@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] uio: uio_pdrv_genirq: restore UIO name without the unit address
Date: Thu, 20 Aug 2026 23:55:21 +0300 [thread overview]
Message-ID: <aodpuQzLJlB30UYf@kekkonen.localdomain> (raw)
In-Reply-To: <20260820140119.1546932-1-maciej.andrzejewski@m-works.net>
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@vger.kernel.org
> Signed-off-by: Maciej Andrzejewski ICEYE <maciej.andrzejewski@m-works.net>
The original patch indeed appears to intend no changes on existing users.
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
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
prev parent reply other threads:[~2026-08-20 20:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 14:01 Maciej Andrzejewski ICEYE
2026-08-20 20:55 ` Sakari Ailus [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=aodpuQzLJlB30UYf@kekkonen.localdomain \
--to=sakari.ailus@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=chris.packham@alliedtelesis.co.nz \
--cc=daniel@zonque.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.andrzejewski@m-works.net \
--cc=stable@vger.kernel.org \
/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
all inboxes | Powered by JetHome®