mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: tin.posavec04@gmail.com
Cc: Bingbu Cao <bingbu.cao@amd.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Dan Scally <dan.scally@ideasonboard.com>,
	Hans de Goede <hansg@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] media: i2c: ov9734: Return -EPROBE_DEFER if no endpoint is found
Date: Mon, 9 Nov 2026 13:58:55 +0200	[thread overview]
Message-ID: <avG1f6OUHUeHSgeA@kekkonen.localdomain> (raw)
In-Reply-To: <20261017-ov9734-ipu6-v1-1-86eab22ae258@gmail.com>

Hi Tin,

On Sat, Oct 17, 2026 at 10:31:57AM +0200, Tin Posavec via B4 Relay wrote:
> From: Tin Posavec <tin.posavec04@gmail.com>
> 
> With ipu-bridge, the fwnode graph endpoint of the sensor is only created
> when ipu-bridge is initialized, which may happen after the sensor driver
> has first probed. ov9734_check_hwcfg() then returns -ENXIO, so the probe
> fails and is not retried, and the sensor stays unbound.
> 
> Return -EPROBE_DEFER instead, as several other sensor drivers used with
> ipu-bridge do (e.g. ov2740 and hi556), and use dev_err_probe() to record
> the reason for the deferral.
> 
> Also log an error when parsing the endpoint fails, as the link
> frequency checks already do, and drop the generic error message from
> probe, which would otherwise be logged on every deferred probe attempt.
> 
> Assisted-by: LLM
> Signed-off-by: Tin Posavec <tin.posavec04@gmail.com>
> ---
>  drivers/media/i2c/ov9734.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/i2c/ov9734.c b/drivers/media/i2c/ov9734.c
> index 8f39609ad..f9280ef0e 100644
> --- a/drivers/media/i2c/ov9734.c
> +++ b/drivers/media/i2c/ov9734.c
> @@ -837,14 +837,19 @@ static int ov9734_check_hwcfg(struct device *dev)
>  	if (!fwnode)
>  		return -ENXIO;
>  
> +	/*
> +	 * Sometimes the fwnode graph is initialized by the bridge driver,
> +	 * wait for this.
> +	 */
>  	ep = fwnode_graph_get_next_endpoint(fwnode, NULL);
>  	if (!ep)
> -		return -ENXIO;
> +		return dev_err_probe(dev, -EPROBE_DEFER,
> +				     "waiting for fwnode graph endpoint\n");
>  

Omit this error check altogether: v4l2_fwnode_endpoint_alloc_parse()
already does it.

>  	ret = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg);
>  	fwnode_handle_put(ep);
>  	if (ret)
> -		return ret;
> +		return dev_err_probe(dev, ret, "failed to parse endpoint\n");
>  
>  	if (!bus_cfg.nr_of_link_frequencies) {
>  		dev_err(dev, "no link frequencies defined");
> @@ -893,11 +898,8 @@ static int ov9734_probe(struct i2c_client *client)
>  	int ret;
>  
>  	ret = ov9734_check_hwcfg(&client->dev);
> -	if (ret) {
> -		dev_err(&client->dev, "failed to check HW configuration: %d",
> -			ret);
> +	if (ret)
>  		return ret;
> -	}
>  
>  	ov9734 = devm_kzalloc(&client->dev, sizeof(*ov9734), GFP_KERNEL);
>  	if (!ov9734)
> 

-- 
Regards,

Sakari Ailus

  reply	other threads:[~2026-11-09 11:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-17  8:31 [PATCH 0/3] media: ov9734, ipu-bridge: Enable the camera on the Intel NUC M15 Tin Posavec via B4 Relay
2026-10-17  8:31 ` [PATCH 1/3] media: i2c: ov9734: Return -EPROBE_DEFER if no endpoint is found Tin Posavec via B4 Relay
2026-11-09 11:58   ` Sakari Ailus [this message]
2026-10-17  8:31 ` [PATCH 2/3] media: i2c: ov9734: Add power on/off sequencing support Tin Posavec via B4 Relay
2026-10-17  8:31 ` [PATCH 3/3] media: ipu-bridge: Add OV9734 sensor config Tin Posavec via B4 Relay
2026-11-06 21:33 ` [PATCH 0/3] media: ov9734, ipu-bridge: Enable the camera on the Intel NUC M15 Afonso Figuinha

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=avG1f6OUHUeHSgeA@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=bingbu.cao@amd.com \
    --cc=dan.scally@ideasonboard.com \
    --cc=hansg@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=tin.posavec04@gmail.com \
    /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®