lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aBHgzJ64pv0z2QAX@kekkonen.localdomain>
Date: Wed, 30 Apr 2025 08:35:24 +0000
From: Sakari Ailus <sakari.ailus@...ux.intel.com>
To: Benjamin Mugnier <benjamin.mugnier@...s.st.com>
Cc: Sylvain Petinot <sylvain.petinot@...s.st.com>,
	Mauro Carvalho Chehab <mchehab@...nel.org>,
	Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>, linux-media@...r.kernel.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 2/2] media: i2c: Add driver for ST VD55G1 camera sensor

Hi Benjamin,

On Wed, Apr 30, 2025 at 10:23:22AM +0200, Benjamin Mugnier wrote:
> Hi Sakari,
> 
> On 4/29/25 14:01, Sakari Ailus wrote:
> > Hi Benjamin,
> > 
> > On Tue, Apr 29, 2025 at 01:29:39PM +0200, Benjamin Mugnier wrote:
> >>>> +static int vd55g1_check_csi_conf(struct vd55g1 *sensor,
> >>>> +				 struct fwnode_handle *endpoint)
> >>>> +{
> >>>> +	struct i2c_client *client = sensor->i2c_client;
> >>>> +	struct v4l2_fwnode_endpoint ep = { .bus_type = V4L2_MBUS_CSI2_DPHY };
> >>>> +	u8 n_lanes;
> >>>> +	int ret;
> >>>> +
> >>>> +	ret = v4l2_fwnode_endpoint_alloc_parse(endpoint, &ep);
> >>>> +	if (ret)
> >>>> +		return -EINVAL;
> >>>> +
> >>>> +	/* Check lanes number */
> >>>> +	n_lanes = ep.bus.mipi_csi2.num_data_lanes;
> >>>> +	if (n_lanes != 1) {
> >>>> +		dev_err(&client->dev, "Sensor only supports 1 lane, found %d\n",
> >>>> +			n_lanes);
> >>>> +		ret = -EINVAL;
> >>>> +		goto done;
> >>>> +	}
> >>>> +
> >>>> +	/* Clock lane must be first */
> >>>> +	if (ep.bus.mipi_csi2.clock_lane != 0) {
> >>>> +		dev_err(&client->dev, "Clock lane must be mapped to lane 0\n");
> >>>> +		ret = -EINVAL;
> >>>> +		goto done;
> >>>> +	}
> >>>> +
> >>>> +	/* Handle polarities in sensor configuration */
> >>>> +	sensor->oif_ctrl = (ep.bus.mipi_csi2.lane_polarities[0] << 3) |
> >>>> +			   (ep.bus.mipi_csi2.lane_polarities[1] << 6);
> >>>> +
> >>>> +	/* Check the link frequency set in device tree */
> >>>> +	if (!ep.nr_of_link_frequencies) {
> >>>> +		dev_err(&client->dev, "link-frequency property not found in DT\n");
> >>>> +		ret = -EINVAL;
> >>>> +		goto done;
> >>>> +	}
> >>>> +	if (ep.nr_of_link_frequencies != 1) {
> >>>> +		dev_err(&client->dev, "Multiple link frequencies not supported\n");
> >>>> +		ret = -EINVAL;
> >>>> +		goto done;
> >>>
> >>> Please check the link frequency matches with what the driver supports,
> >>> using e.g. v4l2_link_freq_to_bitmap().
> >>>
> >>
> >> Are you referring to checks performed in in vd55g1_prepare_clock_tree()
> >> ? Keep in mind it will change a bit with Laurent's comments though.
> >> The sensor supports a range of frequencies therefore I chose to check it
> >> manually instead of v4l2_link_freq_to_bitmap().
> > 
> > Ok, that's fine then. But please check this results to the frequency that
> > was requested, currently it may be off AFAIR.
> > 
> 
> As far as I understand it should be fine in v7, could you have a look
> once sent ?

There's still no check the PLL configuration produces the requested
frequency, is there? Or maybe I missed it?

-- 
Regards,

Sakari Ailus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ