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: <9254009.EvYhyI6sBW@senjougahara>
Date: Tue, 02 Sep 2025 15:35:20 +0900
From: Mikko Perttunen <mperttunen@...dia.com>
To: Svyatoslav Ryhel <clamor95@...il.com>
Cc: Thierry Reding <thierry.reding@...il.com>,
 Thierry Reding <treding@...dia.com>, Jonathan Hunter <jonathanh@...dia.com>,
 Sowjanya Komatineni <skomatineni@...dia.com>,
 Luca Ceresoli <luca.ceresoli@...tlin.com>, David Airlie <airlied@...il.com>,
 Simona Vetter <simona@...ll.ch>,
 Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
 Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
 Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
 Conor Dooley <conor+dt@...nel.org>,
 Peter De Schrijver <pdeschrijver@...dia.com>,
 Prashant Gaikwad <pgaikwad@...dia.com>,
 Michael Turquette <mturquette@...libre.com>, Stephen Boyd <sboyd@...nel.org>,
 Mauro Carvalho Chehab <mchehab@...nel.org>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 Dmitry Osipenko <digetx@...il.com>,
 Charan Pedumuru <charan.pedumuru@...il.com>, linux-media@...r.kernel.org,
 linux-tegra@...r.kernel.org, dri-devel@...ts.freedesktop.org,
 devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-clk@...r.kernel.org, linux-staging@...ts.linux.dev
Subject:
 Re: [PATCH v1 07/19] staging: media: tegra-video: csi: parametrize MIPI
 calibration device presence

On Tuesday, September 2, 2025 2:05 PM Svyatoslav Ryhel wrote:
> вт, 2 вер. 2025 р. о 03:47 Mikko Perttunen <mperttunen@...dia.com> пише:
> >
> > On Tuesday, August 19, 2025 9:16 PM Svyatoslav Ryhel wrote:
> > > Dedicated MIPI calibration block appears only in Tegra114, before Tegra114
> > > all MIPI calibration pads were part of VI block.
> > >
> > > Signed-off-by: Svyatoslav Ryhel <clamor95@...il.com>
> > > ---
> > >  drivers/staging/media/tegra-video/csi.c      | 12 +++++++-----
> > >  drivers/staging/media/tegra-video/csi.h      |  1 +
> > >  drivers/staging/media/tegra-video/tegra210.c |  1 +
> > >  3 files changed, 9 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/drivers/staging/media/tegra-video/csi.c
> > > b/drivers/staging/media/tegra-video/csi.c index 74c92db1032f..2f9907a20db1
> > > 100644
> > > --- a/drivers/staging/media/tegra-video/csi.c
> > > +++ b/drivers/staging/media/tegra-video/csi.c
> > > @@ -485,11 +485,13 @@ static int tegra_csi_channel_alloc(struct tegra_csi
> > > *csi, if (IS_ENABLED(CONFIG_VIDEO_TEGRA_TPG))
> > >               return 0;
> > >
> > > -     chan->mipi = tegra_mipi_request(csi->dev, node);
> > > -     if (IS_ERR(chan->mipi)) {
> > > -             ret = PTR_ERR(chan->mipi);
> > > -             chan->mipi = NULL;
> > > -             dev_err(csi->dev, "failed to get mipi device: %d\n", ret);
> > > +     if (csi->soc->has_mipi_calibration) {
> > > +             chan->mipi = tegra_mipi_request(csi->dev, node);
> >
> > The way I would read 'soc->has_mipi_calibration' is that this device (CSI)
> > contains the MIPI calibration hardware. I.e. the opposite of here. I would
> > invert the logic and optionally call it e.g. 'internal_mipi_calib'.
> >
> > A cleaner way to do this might be to always call tegra_mipi_request et al. --
> > on pre-Tegra114 SoCs this would just call back to the VI/CSI driver using the
> > callbacks registered in the MIPI driver as we discussed before. That way the
> > CSI driver won't need separate code paths for SoCs with internal MIPI
> > calibration and SoCs with the external MIPI calibration device.
> >
> 
> So basically MIPI calibration device for Tegra20/Tegra30 has to be
> created within CSI and when MIPI calibration is requested, CSI phandle
> is used. Question: may I use a dedicated node for MIPI calibration
> within CSI or it has to use CSI node itself? With dedicated node
> configuration should be much simpler and can help avoiding probe of
> entire.

I think it'd better to use the CSI node itself. The calibration registers are somewhat scattered in the address space so it's hard to argue for the MIPI calibration to be a subdevice of CSI.

If it's problematic, we can also just call the calibration logic internally within the driver. But in that case also I'd place both the DSI and CSI calibration logic together in one place since AIUI they can interact with each other.

> 
> > Cheers,
> > Mikko
> >
> > > +             if (IS_ERR(chan->mipi)) {
> > > +                     ret = PTR_ERR(chan->mipi);
> > > +                     chan->mipi = NULL;
> > > +                     dev_err(csi->dev, "failed to get mipi device:
> > %d\n", ret);
> > > +             }
> > >       }
> > >
> > >       return ret;
> > > diff --git a/drivers/staging/media/tegra-video/csi.h
> > > b/drivers/staging/media/tegra-video/csi.h index 3ed2dbc73ce9..400b913bb1cb
> > > 100644
> > > --- a/drivers/staging/media/tegra-video/csi.h
> > > +++ b/drivers/staging/media/tegra-video/csi.h
> > > @@ -128,6 +128,7 @@ struct tegra_csi_soc {
> > >       unsigned int num_clks;
> > >       const struct tpg_framerate *tpg_frmrate_table;
> > >       unsigned int tpg_frmrate_table_size;
> > > +     bool has_mipi_calibration;
> > >  };
> > >
> > >  /**
> > > diff --git a/drivers/staging/media/tegra-video/tegra210.c
> > > b/drivers/staging/media/tegra-video/tegra210.c index
> > > da99f19a39e7..305472e94af4 100644
> > > --- a/drivers/staging/media/tegra-video/tegra210.c
> > > +++ b/drivers/staging/media/tegra-video/tegra210.c
> > > @@ -1218,4 +1218,5 @@ const struct tegra_csi_soc tegra210_csi_soc = {
> > >       .num_clks = ARRAY_SIZE(tegra210_csi_cil_clks),
> > >       .tpg_frmrate_table = tegra210_tpg_frmrate_table,
> > >       .tpg_frmrate_table_size = ARRAY_SIZE(tegra210_tpg_frmrate_table),
> > > +     .has_mipi_calibration = true,
> > >  };
> >
> >
> >
> >





Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ