* [PATCH] media: i2c: cvs: Add sensor node in bound callback
@ 2026-09-03 10:07 Antti Laakso
2026-09-03 15:20 ` Mehdi Djait
0 siblings, 1 reply; 2+ messages in thread
From: Antti Laakso @ 2026-09-03 10:07 UTC (permalink / raw)
To: linux-media, sakari.ailus, miguel.vadillo; +Cc: stable
Sensor device nodes are created in the complete callback, which is only
called when all devices are successfully registered. If any device fails
to register, e.g. due to a missing driver, the complete callback is
never invoked and sensor nodes are not created.
Create sensor device nodes in the bound callback instead, ensuring they
are available as soon as sensor is bound regardless of other devices
registration status.
Fixes: 8e2b43d2c10b ("media: i2c: cvs: Add driver of Intel Computer Vision Sensing Controller(CVS)")
Cc: stable@vger.kernel.org
Signed-off-by: Antti Laakso <antti.laakso@linux.intel.com>
---
drivers/media/i2c/cvs/v4l2.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/media/i2c/cvs/v4l2.c b/drivers/media/i2c/cvs/v4l2.c
index 9fadca7a3bee..863112cde266 100644
--- a/drivers/media/i2c/cvs/v4l2.c
+++ b/drivers/media/i2c/cvs/v4l2.c
@@ -13,6 +13,7 @@
#include <media/v4l2-async.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ctrls.h>
+#include <media/v4l2-device.h>
#include <media/v4l2-event.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-mc.h>
@@ -400,7 +401,7 @@ static int cvs_csi_notify_bound(struct v4l2_async_notifier *notifier,
struct v4l2_async_connection *asc)
{
struct icvs *ctx = notifier_to_csi(notifier);
- int pad;
+ int pad, ret;
pad = media_entity_get_fwnode_pad(&sd->entity, asc->match.fwnode,
MEDIA_PAD_FL_SOURCE);
@@ -409,9 +410,13 @@ static int cvs_csi_notify_bound(struct v4l2_async_notifier *notifier,
ctx->remote = &sd->entity.pads[pad];
- return media_create_pad_link(&sd->entity, pad, &ctx->subdev.entity,
- ICVS_CSI_PAD_SINK, MEDIA_LNK_FL_ENABLED |
- MEDIA_LNK_FL_IMMUTABLE);
+ ret = media_create_pad_link(&sd->entity, pad, &ctx->subdev.entity,
+ ICVS_CSI_PAD_SINK, MEDIA_LNK_FL_ENABLED |
+ MEDIA_LNK_FL_IMMUTABLE);
+ if (ret)
+ return ret;
+
+ return v4l2_device_register_subdev_nodes(sd->v4l2_dev);
}
/**
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] media: i2c: cvs: Add sensor node in bound callback
2026-09-03 10:07 [PATCH] media: i2c: cvs: Add sensor node in bound callback Antti Laakso
@ 2026-09-03 15:20 ` Mehdi Djait
0 siblings, 0 replies; 2+ messages in thread
From: Mehdi Djait @ 2026-09-03 15:20 UTC (permalink / raw)
To: Antti Laakso; +Cc: linux-media, sakari.ailus, miguel.vadillo, stable
Hello Antti,
Thank you for the patch!
On Thu, Sep 03, 2026 at 01:07:53PM +0300, Antti Laakso wrote:
> Sensor device nodes are created in the complete callback, which is only
> called when all devices are successfully registered. If any device fails
> to register, e.g. due to a missing driver, the complete callback is
> never invoked and sensor nodes are not created.
>
> Create sensor device nodes in the bound callback instead, ensuring they
> are available as soon as sensor is bound regardless of other devices
> registration status.
>
This does actually fix the issue I had on my Dell laptop with two
camera sensors:
HIMX1092 OVTI02C1
But for the HIMX1092 a driver does not exist (yet) in upstream.
Tested-by: Mehdi Djait <mehdi.djait@linux.intel.com> # Dell XPS 13 9350 + IPU7
Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com>
> Fixes: 8e2b43d2c10b ("media: i2c: cvs: Add driver of Intel Computer Vision Sensing Controller(CVS)")
> Cc: stable@vger.kernel.org
> Signed-off-by: Antti Laakso <antti.laakso@linux.intel.com>
> ---
> drivers/media/i2c/cvs/v4l2.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/i2c/cvs/v4l2.c b/drivers/media/i2c/cvs/v4l2.c
> index 9fadca7a3bee..863112cde266 100644
> --- a/drivers/media/i2c/cvs/v4l2.c
> +++ b/drivers/media/i2c/cvs/v4l2.c
> @@ -13,6 +13,7 @@
> #include <media/v4l2-async.h>
> #include <media/v4l2-common.h>
> #include <media/v4l2-ctrls.h>
> +#include <media/v4l2-device.h>
> #include <media/v4l2-event.h>
> #include <media/v4l2-fwnode.h>
> #include <media/v4l2-mc.h>
> @@ -400,7 +401,7 @@ static int cvs_csi_notify_bound(struct v4l2_async_notifier *notifier,
> struct v4l2_async_connection *asc)
> {
> struct icvs *ctx = notifier_to_csi(notifier);
> - int pad;
> + int pad, ret;
>
> pad = media_entity_get_fwnode_pad(&sd->entity, asc->match.fwnode,
> MEDIA_PAD_FL_SOURCE);
> @@ -409,9 +410,13 @@ static int cvs_csi_notify_bound(struct v4l2_async_notifier *notifier,
>
> ctx->remote = &sd->entity.pads[pad];
>
> - return media_create_pad_link(&sd->entity, pad, &ctx->subdev.entity,
> - ICVS_CSI_PAD_SINK, MEDIA_LNK_FL_ENABLED |
> - MEDIA_LNK_FL_IMMUTABLE);
> + ret = media_create_pad_link(&sd->entity, pad, &ctx->subdev.entity,
> + ICVS_CSI_PAD_SINK, MEDIA_LNK_FL_ENABLED |
> + MEDIA_LNK_FL_IMMUTABLE);
> + if (ret)
> + return ret;
> +
> + return v4l2_device_register_subdev_nodes(sd->v4l2_dev);
> }
>
> /**
> --
> 2.55.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-03 15:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 10:07 [PATCH] media: i2c: cvs: Add sensor node in bound callback Antti Laakso
2026-09-03 15:20 ` Mehdi Djait
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox