Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp190994pxa; Fri, 31 Jul 2020 09:29:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHbdanTfVCjIYLSYgBeK0YOpB/bY0llDYutG8i+CJKNq3xR9sBNE3eoo/UY+S+CXH+hdEA X-Received: by 2002:a05:6402:1e2:: with SMTP id i2mr4523374edy.70.1596212991988; Fri, 31 Jul 2020 09:29:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596212991; cv=none; d=google.com; s=arc-20160816; b=St6DQjWrH8Ge/uVBysaeIixN9sxcKOtd8qXdA/VBNmpr9Rz0/GyAnuWVPyRP+914Xt /lGQZoqVXUUZ33sEw/JDjy3xmS24N8M5wkDAGoAnGEtm4DMbUuECAPuxaFjEdXaAumlJ tWq2DtNssGXRKMEQzdp+pMY4zctTJsxtUyERs1gXQHp5M33iyvNvxJbMuqNgT/WxG88j O/Bm0pRrw+3KMA9P0o0Q5U8XRmrgB9W9BIvUYQTO3rCuEbweQ43zltJDxgWGEJHGBvwJ xKr7ma1+OITRcJMUvTpSUEGAEuifcLKYTXgSdBVtwm1d8TLtY7JZSrfURl3ZqZVaIf0g 72+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=wiDX5nyN9UriQ2/ElU4lhyUh5w9DvvpArAoLEITpFZA=; b=vj5WgemvdDWHNj5M6ZESX31I8L5MilcgMlxJClmwdmjIivK6uVJJIGuDc/qXFBoJ3k 272FqbZvtqPRvzb4WYAISI5wcIOckUtU2xXgQIjnVph2UE6zTila/o+K7UxhKJRw677E 4VjrspYuwcAst2Uy6fB1WWU+xr4ftnnohDbJaLvQcEPLqIUQN4QjdZUL7zYLsYxczgZ8 WWlbuS7rkhuF+dkJ4SW1+Iw5ho6GiNVdx8NIgfZuDTkFyaKlomJmNIw7WFIPP5h6zfaH AT4sdjDgHIcA292xVjXGW3629CHci/vvlOcBpK9tuQjmNCXYBpsK8tmlpGyGewpewHwj XZRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=olRW+DlN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ly20si5377282ejb.607.2020.07.31.09.29.29; Fri, 31 Jul 2020 09:29:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=olRW+DlN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732538AbgGaQ3D (ORCPT + 99 others); Fri, 31 Jul 2020 12:29:03 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:6851 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726502AbgGaQ3D (ORCPT ); Fri, 31 Jul 2020 12:29:03 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 31 Jul 2020 09:28:49 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Fri, 31 Jul 2020 09:29:03 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Fri, 31 Jul 2020 09:29:03 -0700 Received: from [10.2.167.221] (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 31 Jul 2020 16:29:01 +0000 Subject: Re: [RFC PATCH v6 09/10] media: tegra-video: Add CSI MIPI pads calibration To: Dmitry Osipenko , , , , , , , CC: , , , , , , References: <1596186169-18729-1-git-send-email-skomatineni@nvidia.com> <1596186169-18729-10-git-send-email-skomatineni@nvidia.com> <3ac158c4-7df7-e3c1-f0e1-33e7ef017762@gmail.com> From: Sowjanya Komatineni Message-ID: Date: Fri, 31 Jul 2020 09:29:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1596212929; bh=wiDX5nyN9UriQ2/ElU4lhyUh5w9DvvpArAoLEITpFZA=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Transfer-Encoding: Content-Language; b=olRW+DlN71dB+r0ZNOxtRhP7eVN9oe0PQG99E0Tx3krlqvqifprFhHGovWplhQ6Za ZtLXRDCrT+oX9InUyqXSsnmSJ1juaEt6NcZ1KaeVuvdXUJzePjGgntwVppYeVtAlVD UtxaCG2z7ctP6VB/pw8bBoOICNuWi2he91T+snzeTjwkcj7aLkti5WLDW2k9xpPb5j X/I+vbrhuaMPjWQavXJwymx/jBRgSz91UI9VTP/X7r20ThmphbM9434TfRXlhPBpdA qF6AZCnnzvrYuy5hsp6d44DNzfvfArhqCrdRQ7N0cQmHBJbAxrXcSKFQ3UE7YL2hS3 M3sC78Kzai0OQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/31/20 9:14 AM, Dmitry Osipenko wrote: > 31.07.2020 18:46, Sowjanya Komatineni =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >> On 7/31/20 4:39 AM, Dmitry Osipenko wrote: >>> 31.07.2020 12:02, Sowjanya Komatineni =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>> ... >>>> @@ -249,13 +249,47 @@ static int tegra_csi_enable_stream(struct >>>> v4l2_subdev *subdev) >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return ret; >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>>> =C2=A0 +=C2=A0=C2=A0=C2=A0 if (csi_chan->mipi) { >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret =3D tegra_mipi_enable(= csi_chan->mipi); >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (ret < 0) { >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 de= v_err(csi->dev, >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 "failed to enable MIPI pads: %d\n", ret); >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 go= to rpm_put; >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>>> + >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * CSI MIPI pads PULL= UP, PULLDN and TERM impedances need to >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * be calibrated afte= r power on. >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * So, trigger the ca= libration start here and results will >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * be latched and app= lied to the pads when link is in LP11 >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * state during start= of sensor streaming. >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */ >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret =3D tegra_mipi_start_c= alibration(csi_chan->mipi); >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (ret < 0) { >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 de= v_err(csi->dev, >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 "failed to start MIPI calibration: %d\n", ret); >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 go= to disable_mipi; >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>> What would happen if CSI stream is enabled and then immediately disable= d >>> without enabling camera sensor? >> Nothing will happen as during stream enable csi receiver is kept ready. >> >> But actual capture will not happen during that point. > Could you please show how the full call chain looks like? It's not clear > to me what keeps CSI stream "ready". VI is the main video input (video device) and on streaming it starts=20 stream of CSI subdev prior to stream of Sensor. HW path, sensor stream (CSI TX) -> CSI stream (RX) During CSI stream on, CSI PHY receiver is enabled to start receiving the=20 data but internally capture assembled to active state will happen only=20 when Tegra VI single shot is issues where VI thru pixel parser gets=20 captures data into the memory