Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp373330rdb; Thu, 22 Feb 2024 06:30:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXKfogekRskw1Ic0SW9zscrDbuUKdpj76WFyzdKA9ZfVl2rtVg+r5ZR9i+PLhp1DOmStm8bWaeme4r+9QyBS/qEiDJd0MfERPNDy9ihmA== X-Google-Smtp-Source: AGHT+IH/H+Le0O2IF0jdbV2IMDhmLFofSgUTrpqbdcuzBzyOUe0+IOFPg/IDGA1PZz+MjBM92M05 X-Received: by 2002:a17:90a:9f95:b0:299:5fed:bcae with SMTP id o21-20020a17090a9f9500b002995fedbcaemr13131633pjp.5.1708612244689; Thu, 22 Feb 2024 06:30:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708612244; cv=pass; d=google.com; s=arc-20160816; b=VpF+dYRQDrPHfADnEdZsfjdeLGMKLg9v5iqsvpzLJ2nkhzdym66H/GZAQdUNfTK3+s FD9p1zOXIQ1C6tzpf+pzraKkkzXa+nvPe3t4C5yNYKSDBQqptNgNFkWz+5G576u6EATo gpVOxfim9aa3fw62YHfJ3wJqWRkbK8l3lsz/kSnV3KfLMmUx+GeWkm2GJRHlJyu681u0 XuRcttqI1gsgj56owz2h7y2dSIMCsPV6aFayYvbjrNjsMQ9ahJaP5c85qgpnO9JH0cGe iz/Sd3hzFQvBEYnHE4PyrzbQ7jeEudHFAgilEakyOJtz7i2pkPvFlh8PisilGIM+sQ3B Ntbw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Ki/6dgjZAo3dxv14Jp2mDPM5UmEFwhpcoCIyyxmfLsA=; fh=v3pC54x47ZWDBa/RYLKvjWbXMKvD/zOwlpRuLjL20q0=; b=ux+puso01AAR3s/1q6UEq/IMq/GsuA22pXJZ6Ge/+Vxrn/Z6yxEQq0IRTpJGuf8PXA pP28eHoZ4VXk6R4/0RKRyMSNNDHWwMWss1W0Vk2DS/fgDIBPTFVXBcre1Jdoutob103R H+0awFVIcDaDJEGKju4BMmJ9/Rx+grx3WiURBNYXKLn+mpIrAXgP2LsTvIfSsA326sBB ZzP3EYlEAdm2qdznDvdYePZxKq61+ir3Os3otfj+VLdlfmLwf2F1Xlv9JIJgqNYpfiIy ui1Xlxrm/wAJAkE4VPCQ0Q31ylZcq5hXVRmfWxam42twhsu0POIYJTT0UB/0T26xhrC1 iKiw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=FICcqJjW; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-76701-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76701-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id sz4-20020a17090b2d4400b00298f6b0c4fdsi10280400pjb.74.2024.02.22.06.30.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 06:30:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76701-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=FICcqJjW; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-76701-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76701-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8B74528448F for ; Thu, 22 Feb 2024 14:30:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD3691487DD; Thu, 22 Feb 2024 14:30:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="FICcqJjW" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DEEDF1474D0; Thu, 22 Feb 2024 14:29:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708612202; cv=none; b=GylnuzZ5WPYTwLeblDwk+ijd2aTbWSiv+tXpZfFOMkTXTHvF81tM+IXeocXVrhzzgLmq14e8UmDJ24HDdrVX+bq+3YV5iTCv1kjhaVTf3sxD78198yrdQp6ZxKh2wYDIyyFF/SOZuhAwdzf+lppLWeF9OcRqey4BqR3+FuH6sJ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708612202; c=relaxed/simple; bh=eVT6NRXuFee0b5qT1stFSBw6MLt6eYJNdZ0wkAk4zvE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=FjLyxboF9fKusNECD6WgMR/KnsTA11OB/RB//3JfeUJTAoARIiaMSW3xsuih/GvPbd54SypPxhLwEuEEdOiA5zCT2dv2Z4WfWf8mdJ6sjDjkN2Bru1gx+Y2h2KTsPxbfx+VbLuOBTx8TQvKoHNvURVPlbVJulI9SsLuHmzy3DUY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=FICcqJjW; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1708612196; bh=eVT6NRXuFee0b5qT1stFSBw6MLt6eYJNdZ0wkAk4zvE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=FICcqJjWCoyNQyb/649yHJNbZ1FUOhDVyNw1DHCIRzS/ll5j+mw+39USh8Qo6zOf6 kGfy79xPRtuor6C54lXoJZvqYjle760NG8W8EM9fO/5e4eVbhyMfh117fn8Tp0WWwC ROsAK9uW2iHp7nJOSQOSLdG1fYMXVcqPf8nxlODTs+XR4FDiILqTfHMkzMjKm3hi2R RZywMTZHPltOSlRp8MpdDBYHEpnBHm6APrck0/xnBxjv+rbTgdE2vdgO0xzxqGQANF n3s1AvbUxMfYu8xly5Yl9VSEl9UxDRz9ywUgklHHjC/XOAlrZ6p1LETRHEL0xWDXKd nftCxXkVKHQHA== Received: from [100.74.67.65] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmassot) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 827A3378206B; Thu, 22 Feb 2024 14:29:55 +0000 (UTC) Message-ID: <766a4e5b-01fc-4fee-affa-9921ed7cd8f3@collabora.com> Date: Thu, 22 Feb 2024 15:29:54 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC 02/21] media: cadence: csi2rx: configure DPHY before starting source stream Content-Language: en-US To: Jai Luthra , Tomi Valkeinen , Mauro Carvalho Chehab , Sakari Ailus , Hans Verkuil , Vaishnav Achath , Maxime Ripard , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Vignesh Raghavendra , Aradhya Bhatia , Devarsh Thakkar , Changhuang Liang , Jack Zhu , Jayshri Pawar References: <20240222-multistream-v1-0-1837ed916eeb@ti.com> <20240222-multistream-v1-2-1837ed916eeb@ti.com> From: Julien Massot In-Reply-To: <20240222-multistream-v1-2-1837ed916eeb@ti.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Jai, On 2/22/24 12:31, Jai Luthra wrote: > From: Pratyush Yadav > > When the source device is operating above 1.5 Gbps per lane, it needs to > send the Skew Calibration Sequence before sending any HS data. If the > DPHY is initialized after the source stream is started, then it might > miss the sequence and not be able to receive data properly. Move the > start of source subdev to the end of the sequence to make sure > everything is ready to receive data before the source starts streaming. > > Signed-off-by: Pratyush Yadav > Signed-off-by: Jai Luthra Thanks for your patch! This patch is useful even at lower data rate than 1.5 Gbps. I'm having the issue at 800Mbps with max96714F deserializer. Should this patch deserve a Fixes tag? Fixes: 3295cf1241d3 ("media: cadence: Add support for external dphy") Reviewed-by: Julien Massot Tested-by: Julien Massot > --- > drivers/media/platform/cadence/cdns-csi2rx.c | 26 ++++++++++++++------------ > 1 file changed, 14 insertions(+), 12 deletions(-) > > diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c > index 70b7f8a9e4f2..75e602c1d762 100644 > --- a/drivers/media/platform/cadence/cdns-csi2rx.c > +++ b/drivers/media/platform/cadence/cdns-csi2rx.c > @@ -243,10 +243,6 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) > > writel(reg, csi2rx->base + CSI2RX_STATIC_CFG_REG); > > - ret = v4l2_subdev_call(csi2rx->source_subdev, video, s_stream, true); > - if (ret) > - goto err_disable_pclk; > - > /* Enable DPHY clk and data lanes. */ > if (csi2rx->dphy) { > reg = CSI2RX_DPHY_CL_EN | CSI2RX_DPHY_CL_RST; > @@ -256,6 +252,13 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) > } > > writel(reg, csi2rx->base + CSI2RX_DPHY_LANE_CTRL_REG); > + > + ret = csi2rx_configure_ext_dphy(csi2rx); > + if (ret) { > + dev_err(csi2rx->dev, > + "Failed to configure external DPHY: %d\n", ret); > + goto err_disable_pclk; > + } > } > > /* > @@ -295,14 +298,9 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) > > reset_control_deassert(csi2rx->sys_rst); > > - if (csi2rx->dphy) { > - ret = csi2rx_configure_ext_dphy(csi2rx); > - if (ret) { > - dev_err(csi2rx->dev, > - "Failed to configure external DPHY: %d\n", ret); > - goto err_disable_sysclk; > - } > - } > + ret = v4l2_subdev_call(csi2rx->source_subdev, video, s_stream, true); > + if (ret) > + goto err_disable_sysclk; > > clk_disable_unprepare(csi2rx->p_clk); > > @@ -316,6 +314,10 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) > clk_disable_unprepare(csi2rx->pixel_clk[i - 1]); > } > > + if (csi2rx->dphy) { > + writel(0, csi2rx->base + CSI2RX_DPHY_LANE_CTRL_REG); > + phy_power_off(csi2rx->dphy); > + } > err_disable_pclk: > clk_disable_unprepare(csi2rx->p_clk); > > -- Julien Massot Senior Software Engineer Collabora Ltd. Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK Registered in England & Wales, no. 5513718