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] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZBjV2slZlmvB7C8I@kekkonen.localdomain>
Date:   Mon, 20 Mar 2023 23:53:30 +0200
From:   Sakari Ailus <sakari.ailus@...ux.intel.com>
To:     Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc:     Philipp Zabel <p.zabel@...gutronix.de>,
        Jacopo Mondi <jacopo.mondi@...asonboard.com>,
        Francesco Dolcini <francesco@...cini.it>,
        Marcel Ziswiler <marcel@...wiler.com>,
        linux-media@...r.kernel.org, kernel@...gutronix.de,
        Francesco Dolcini <francesco.dolcini@...adex.com>,
        Aishwarya Kothari <aishwarya.kothari@...adex.com>,
        Marcel Ziswiler <marcel.ziswiler@...adex.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Steve Longerbeam <slongerbeam@...il.com>,
        linux-kernel@...r.kernel.org,
        Marco Felsch <m.felsch@...gutronix.de>
Subject: Re: [PATCH v2] media: i2c: ov5640: Implement get_mbus_config

Hi Laurent,

On Mon, Mar 20, 2023 at 04:00:12PM +0200, Laurent Pinchart wrote:
> On Mon, Mar 20, 2023 at 02:32:25PM +0100, Philipp Zabel wrote:
> > On Mo, 2023-03-20 at 12:15 +0200, Sakari Ailus wrote:
> > > On Mon, Mar 20, 2023 at 11:55:14AM +0200, Laurent Pinchart wrote:
> > > > On Mon, Mar 20, 2023 at 11:37:33AM +0200, Sakari Ailus wrote:
> > > > > On Mon, Mar 20, 2023 at 11:26:02AM +0200, Laurent Pinchart wrote:
> > > > > > In a (simplified) nutshell,
> > > > > > 
> > > > > > ---------+     +----------+     +---------+     +-----+     +-----+
> > > > > > > Camera | --> | CSI-2 RX | --> | CSI2IPU | --> | Mux | --> | IPU |
> > > > > > > Sensor |     |          |     | Gasket  |     |     |     |     |
> > > > > > ---------+     +----------+     +---------+     +-----+     +-----+
> > > > > 
> > > > > Thank you, this is helpful.
> > > > > 
> > > > > I suppose the mux here at least won't actively do anything to the data. So
> > > > > presumably its endpoint won't contain the active configuration, but its
> > > > > superset.
> > > > > 
> > > > > > 
> > > > > > All those blocks, except for the gasket, have a node in DT.
> > > > > > 
> > > > > > The IPU driver needs to know the number of CSI-2 data lanes, which is
> > > > > > encoded in the data-lanes DT property present in both the sensor output
> > > > > > endpoint and the CSI-2 RX input endpoint, but not the other endpoints in
> > > > > > the pipeline.
> > > > > 
> > > > > This doesn't yet explain why the sensor would need to implement
> > > > > get_mbus_config if its bus configuration remains constant.
> > > > 
> > > > If I recall correctly, the IPU driver calls .g_mbus_config() on the
> > > > camera sensor to get the number of lanes, as it can't get it from its
> > > > own endpoint. That's a hack, and as Jacopo proposed, calling
> > > > .g_mbus_config() on the CSI-2 RX would be better, as the CSI-2 RX driver
> > > > can then get the value from its own endpoint, without requiring all
> > > > sensor drivers to implement .g_mbus_config().
> > > 
> > > The g_mbus_config op could be implemented by the CSI2IPU and mux, by simply
> > > requesting the information from the upstream sub-device. No hacks would be
> > > needed.
> > 
> > I think implementing get_mbus_config on the mux might be enough. The
> > IPU driver already recognizes the CSI-2 RX by its grp_id and could
> > infer that it has to use MIPI CSI-2 mode from that.
> > 
> > The video-mux would have to forward get_mbus_config to its active
> > upstream port and if the upstream sensor does not implement it read bus
> > width from the active upstream endpoint.
> 
> I'm fine with implementing it in the mux as well, but I think we can
> take a shortcut here and call it on the CSI-2 RX from the IPU driver, as
> the IPU driver knows about the architecture of the whole pipeline.

If that's the case then I guess that's fine. But can these drivers be used
elsewhere than with IMX6?

It'd be safest to implement g_mbus_config for the all the way to CSI-2 RX.

But if the answer to the question is "no", then making that shortcut should
be fine (and this can be always reworked if need be).

-- 
Kind regards,

Sakari Ailus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ