Re: [PATCH v4 0/9] media: synopsys: hdmirx: support an HDMI bridge in front of the receiver
From: Sascha Hauer
Date: Thu Nov 26 2026 - 09:48:16 EST
Hi Hans,
On 2026-11-25 19:47, Hans Verkuil wrote:
> Hi Sascha,
>
> On 16/11/2026 16:19, Sascha Hauer wrote:
> > The Synopsys HDMI receiver driver assumes the HDMI connector belongs to
> > it: the connector's +5V line arrives on hpd-gpios, and there is nothing
> > between the source and the receiver. On the board this series comes from
> > that is not the case. An HDMI bridge owns the connector, the receiver
> > sits behind it, and the two are described by an OF graph endpoint.
> >
> > Three things follow from that, and the series is arranged in that order.
> >
> > Patches 1-2 give the driver a media device and register the video device
> > as an entity with a sink pad. On their own they add a graph with one node
> > in it; they exist so that there is somewhere for the bridge to appear.
> >
> > Patches 3-4 add the endpoint to the binding and bind the remote subdev
> > through a v4l2 async notifier, linking its source pad to the receiver's
> > sink pad. Such a board cannot provide hpd-gpios, so the binding requires
> > either hpd-gpios or the port. Without an endpoint in the device tree the
> > driver keeps working exactly as before, so boards wired straight to the
> > connector are unaffected.
> >
> > Patch 5 is fallout from the wait for signal lock, which was bounded by an
> > iteration count whose duration came from the 5V debounce it called
> > each time round. That debounce goes away on a board with no hpd-gpios
> > later in the series, so the wait gets a real timeout first.
> >
> > Patches 6-9 are the 5V state itself. Patch 6 stops probe requiring an
> > interrupt for hpd-gpios. Patch 7 makes v4l2_device_unregister_subdev()
> > wait for notifications already in flight. Nothing kept a subdev from
> > notifying a v4l2_device that was unbinding it; that is not new with this
> > series, as asynchronously bound subdevs sending V4L2_EVENT_SOURCE_CHANGE
> > race the same way today. Patch 8 adds V4L2_DEVICE_NOTIFY_RX_POWER_PRESENT,
> > and patch 9 has the receiver set v4l2_dev.notify and take the state from
> > whatever is bound in front of it. The notification is only an edge, as
> > the 5V interrupt is with hpd-gpios: the hotplug worker then asks the
> > subdev through g_input_status(), so nothing is cached that could go
> > stale against bind or unbind. Without a det_irq there is nothing to
> > disable across suspend and remove either, so patch 9 disables the
> > hotplug work items themselves instead of cancelling them. Patch 7 is
> > what lets the notify callback read sd->v4l2_dev while the subdev is
> > being unbound.
>
> So I would like to merge patches 1-6, but take more time reviewing 7-9.
>
> So those may or may not go in in time for the next rc1. Would that be
> OK with you? Or do you prefer that I just wait with that?
I am happy with patches 1-6 going upstream now. I'll then send a rework
for patches 7-9 only next time.
>
> I'm not really happy with patches 7 and 9, but I can't put my finger on the
> 'why' yet. Well, other than that it feels overly complicated. I think that
> AI did part of the work, since it definitely has that feel: long and somewhat
> rambling commit logs, use of rarely used APIs (scru), etc.
I'll shorten the commit messages, they are really too long and not to the point.
>
> Perhaps look into rewriting the commit logs for 7 and 9, and see if there
> is an easier-to-understand implementation for patch 7.
Patch 7 isn't grown on my own motivation, it goes down to a sashiko finding
here:
https://sashiko.dev/#/patchset/20260923-hdmirx-media-v1-0-ea3d77d4a5f3@xxxxxxxxxxxxxx?part=9
An alternative approach would be to forbid calling v4l2_subdev_notify()
from unregistered subdevices. struct v4l2_subdev_internal_ops has
(un)registered hooks which subdev drivers could use to stop sending
notifications. That would require fixing some drivers though. Would you
prefer that?
> It might also be better
> to move patch 7 to the end since it is really independent of the other changes.
Ok.
Regards,
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |