Re: [PATCH v11 14/14] media: atomisp: Preserve the capture graph when a lens rebinds

From: Andy Shevchenko

Date: Mon Nov 23 2026 - 05:43:34 EST


On Sat, Nov 21, 2026 at 02:31:44PM +0100, Maurizio Casciano wrote:
> The root notifier completes again when the lens subdevice is rebound.
> Rebuilding the entire graph adds the original sensors a second time
> and attempts to register the capture video device again.
>
> If the capture node already exists and the sensors are unchanged,
> register only missing subdevice nodes. Reject a changed sensor graph until
> the driver is reinitialized. The preceding V4L2 rollback fix keeps
> existing sensor nodes if new node registration fails. The X91L rebind
> trial exposed the original issue. Codex drafted the notifier change.
>
> Link: https://linuxtv.org/mailman3/hyperkitty/list/media-ci@xxxxxxxxxxx/message/2PUHZIDBEIGQKGXTJJOUXXJS2EOEMJGD/

Don't put unreferred Link tags.

...

> static int atomisp_notifier_complete(struct v4l2_async_notifier *notifier)
> {
> struct atomisp_device *isp = notifier_to_atomisp(notifier);
> + unsigned int i;
>
> - return atomisp_register_device_nodes(isp);
> + if (!video_is_registered(&isp->asd.video_out.vdev))
> + return atomisp_register_device_nodes(isp);
> +
> + /*
> + * Completing the lens notifier again only needs a new lens node.
> + * The existing graph is valid as long as its sensors are unchanged.
> + */

> + for (i = 0; i < isp->input_cnt; i++) {

for (unsigned int i = 0; i < isp->input_cnt; i++) {

> + const struct atomisp_input_subdev *input = &isp->inputs[i];
> +
> + if (input->csi_remote_source != isp->sensor_subdevs[input->port])
> + return -EBUSY;
> + }
> +
> + return v4l2_device_register_subdev_nodes(&isp->v4l2_dev);
> }

--
With Best Regards,
Andy Shevchenko