* [PATCH] media: nxp: imx8-isi: avoid duplicate media device on rebind
@ 2026-12-04 22:45 Ihor Matushchak
2026-12-06 3:16 ` Laurent Pinchart
0 siblings, 1 reply; 2+ messages in thread
From: Ihor Matushchak @ 2026-12-04 22:45 UTC (permalink / raw)
To: laurent.pinchart, mchehab, linux-media, imx, linux-arm-kernel
Cc: Frank.Li, s.hauer, kernel, festevam, Ihor Matushchak
The async notifier completes every time when a remote subdev is unbound and
bound back. Skip media device registration if it's already registered to
avoid creating an additional /dev/media* node on each rebind.
Signed-off-by: Ihor Matushchak <ihor.matushchak@foobox.net>
---
drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c
index 2005584a1215..7c22413b1be7 100644
--- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c
+++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c
@@ -90,6 +90,9 @@ static int mxc_isi_async_notifier_complete(struct v4l2_async_notifier *notifier)
return ret;
}
+ if (media_devnode_is_registered(isi->media_dev.devnode))
+ return 0;
+
return media_device_register(&isi->media_dev);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] media: nxp: imx8-isi: avoid duplicate media device on rebind
2026-12-04 22:45 [PATCH] media: nxp: imx8-isi: avoid duplicate media device on rebind Ihor Matushchak
@ 2026-12-06 3:16 ` Laurent Pinchart
0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2026-12-06 3:16 UTC (permalink / raw)
To: Ihor Matushchak
Cc: mchehab, linux-media, imx, linux-arm-kernel, Frank.Li, s.hauer,
kernel, festevam
On Fri, Dec 04, 2026 at 11:45:02PM +0100, Ihor Matushchak wrote:
> The async notifier completes every time when a remote subdev is unbound and
> bound back.
That's not something we support in the media subsystem at the moment.
There are plenty of object lifetime management issues, workarounds in
drivers is not the way to go.
> Skip media device registration if it's already registered to
> avoid creating an additional /dev/media* node on each rebind.
>
> Signed-off-by: Ihor Matushchak <ihor.matushchak@foobox.net>
> ---
> drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c
> index 2005584a1215..7c22413b1be7 100644
> --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c
> +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c
> @@ -90,6 +90,9 @@ static int mxc_isi_async_notifier_complete(struct v4l2_async_notifier *notifier)
> return ret;
> }
>
> + if (media_devnode_is_registered(isi->media_dev.devnode))
> + return 0;
> +
> return media_device_register(&isi->media_dev);
> }
>
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-06 3:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 22:45 [PATCH] media: nxp: imx8-isi: avoid duplicate media device on rebind Ihor Matushchak
2026-12-06 3:16 ` Laurent Pinchart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox