All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Fabio Estevam <festevam@gmail.com>,
	rmfrfs@gmail.com, hansg@kernel.org, linux-media@vger.kernel.org,
	Fabio Estevam <festevam@denx.de>
Subject: Re: [PATCH 1/2] media: ov2680: Allow probing if link-frequencies is absent
Date: Thu, 28 Mar 2024 22:05:47 +0000	[thread overview]
Message-ID: <ZgXpu9JKn_tNIHwO@kekkonen.localdomain> (raw)
In-Reply-To: <20240328220403.GG11463@pendragon.ideasonboard.com>

On Fri, Mar 29, 2024 at 12:04:03AM +0200, Laurent Pinchart wrote:
> On Thu, Mar 28, 2024 at 09:57:46PM +0000, Sakari Ailus wrote:
> > On Thu, Mar 28, 2024 at 09:55:48PM +0000, Sakari Ailus wrote:
> > > On Thu, Mar 28, 2024 at 07:54:41AM +0000, Sakari Ailus wrote:
> > > > Hi Fabio,
> > > > 
> > > > On Thu, Mar 28, 2024 at 02:13:19AM -0300, Fabio Estevam wrote:
> > > > > From: Fabio Estevam <festevam@denx.de>
> > > > > 
> > > > > Since commit 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint
> > > > > property verification") the ov2680 no longer probes on a imx7s-warp7:
> > > > > 
> > > > > ov2680 1-0036: error -EINVAL: supported link freq 330000000 not found
> > > > > ov2680 1-0036: probe with driver ov2680 failed with error -2
> > > > > 
> > > > > As the 'link-frequencies' property is not mandatory, allow the probe
> > > > > to succeed by skipping the link-frequency verification when the
> > > > > property is absent.
> > > > > 
> > > > > Fixes: 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint property verification")
> > > > > Signed-off-by: Fabio Estevam <festevam@denx.de>
> > > > > ---
> > > > >  drivers/media/i2c/ov2680.c | 3 +++
> > > > >  1 file changed, 3 insertions(+)
> > > > > 
> > > > > diff --git a/drivers/media/i2c/ov2680.c b/drivers/media/i2c/ov2680.c
> > > > > index 39d321e2b7f9..f611ce3a749c 100644
> > > > > --- a/drivers/media/i2c/ov2680.c
> > > > > +++ b/drivers/media/i2c/ov2680.c
> > > > > @@ -1123,6 +1123,9 @@ static int ov2680_parse_dt(struct ov2680_dev *sensor)
> > > > >  		goto out_free_bus_cfg;
> > > > >  	}
> > > > >  
> > > > > +	if (!bus_cfg.nr_of_link_frequencies)
> > > > > +		return 0;
> > > > > +
> > > > 
> > > > Thanks for the patch.
> > > > 
> > > > I'd still rather try to avoid going to this direction as these frequencies
> > > > are hardware dependent. Add a new one to the driver and some boards may
> > > > stop working properly. For details see
> > > > <URL:https://hverkuil.home.xs4all.nl/spec/driver-api/camera-sensor.html#handling-clocks>.
> > > 
> > > While the above holds, on second thought, the driver has been around for
> > > quite some time and indeed the added validation does break certain boards
> > > (at least without adding the link frequencies there).
> > > 
> > > So I'm fine with the patch.
> > > 
> > > I think this should also be cc'd to stable.
> > 
> > And this applies to the newer version of the patch that fixes the memory
> > leak, of course.
> 
> Should we add least log a warning when link frequencies are not present
> in DT ?

Sounds reasonable.

> 
> > > > >  	for (i = 0; i < bus_cfg.nr_of_link_frequencies; i++)
> > > > >  		if (bus_cfg.link_frequencies[i] == sensor->link_freq[0])
> > > > >  			break;

-- 
Sakari Ailus

      reply	other threads:[~2024-03-28 22:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28  5:13 [PATCH 1/2] media: ov2680: Allow probing if link-frequencies is absent Fabio Estevam
2024-03-28  5:13 ` [PATCH 2/2] media: ov2680: Report success on link-frequency match Fabio Estevam
2024-03-28 11:27   ` Hans de Goede
2024-03-28 14:26     ` Fabio Estevam
2024-03-28  7:54 ` [PATCH 1/2] media: ov2680: Allow probing if link-frequencies is absent Sakari Ailus
2024-03-28 21:55   ` Sakari Ailus
2024-03-28 21:57     ` Sakari Ailus
2024-03-28 22:04       ` Laurent Pinchart
2024-03-28 22:05         ` Sakari Ailus [this message]

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=ZgXpu9JKn_tNIHwO@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=festevam@denx.de \
    --cc=festevam@gmail.com \
    --cc=hansg@kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=rmfrfs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.