From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7A37ACD5BB1 for ; Fri, 22 May 2026 12:03:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=npoaRceVSKcBIA7XnqArtD5X9kOzz4sAZEkny7h7tJ4=; b=j1IE9yQSXST0wzXTcOMTj02fkS RLzgRhtO9a6pvHnkw8Vmi7xkXkYK5wte90RsayLZO/0pZIn5poaM3S6Y/MTdw2USpSjlJfT19QQgC mvviYAXjZTiwwv+gOTVY1bYCV8XNGtabtXlVktVDafito1H4RQk+5fM+sB1r3m+ldP4wmgaK4sSrO j1Y5l1xVVrmWnlWQuwvMyFLJ9Frx1EHppCmi/uNXYCFC8Z3WJ4M0BQM1JAUIm3iMOf6cXNOlGEFAI LZPKhxacI8dD8XSVV7ObwBwwVxsJIFT6l/UGDivko7mgZmfjv1jCr+ceWvjCnmR4x0B1hX9AcXblp 05jufK+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wQOas-0000000AiJr-1QTD; Fri, 22 May 2026 12:03:10 +0000 Received: from www537.your-server.de ([188.40.3.216]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wQOap-0000000AiDe-43Th; Fri, 22 May 2026 12:03:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ew.tq-group.com; s=default2602; h=Content-Type:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=npoaRceVSKcBIA7XnqArtD5X9kOzz4sAZEkny7h7tJ4=; b=hQLcA1R414V+btOIJDOD+tGBES uDEs/ZrExwzWFrdgA2r4itlz8ocKj3qVx/Px03FRFevQRRMraNv3f7W2bvjBN5kFIOJGeb8k7IBXZ 6LsHV3nrbRV68SeA96efVg2L53IrdTQBf+ImquXkal8G8iu4FOBfNKYxhu7b5kXN5A4k6B/EG2y0j A2SlkcEx8m3sDfRMwjkN7Q/kmEW5OifhXxKxD9djBPHAr4PZ3yNKA/6oGESvfHi4Gm9OmH4ztnnRQ 29d2UdC5J1Q//bqZXoOXiBdQk8M5YpAoUZEm98OEJBD/d6E0QF0umpnWhFoj8xl6vPFKe6cX/3cY2 L34qoIfQ==; Received: from sslproxy08.your-server.de ([78.47.166.52]) by www537.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1wQOag-000FcQ-0J; Fri, 22 May 2026 14:02:58 +0200 Received: from localhost ([127.0.0.1]) by sslproxy08.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wQOae-000ErM-1x; Fri, 22 May 2026 14:02:57 +0200 From: Alexander Stein To: Michael Riesch , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Laurent Pinchart , Frank Li , Sakari Ailus , Bryan O'Donoghue , Mehdi Djait , Hans Verkuil , "G.N. Zhou (OSS)" , "G.N. Zhou (OSS)" , "G.N. Zhou (OSS)" Cc: "linux-media@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "imx@lists.linux.dev" , "linux-arm-kernel@lists.infradead.org" , "linux-rockchip@lists.infradead.org" , "G.N. Zhou (OSS)" Subject: Re: [PATCH v4 4/6] media: synopsys: Add PHY stopstate wait for i.MX93 Date: Fri, 22 May 2026 14:02:56 +0200 Message-ID: <118820958.nniJfEyVGO@steina-w> Organization: TQ-Systems GmbH In-Reply-To: References: <20260519-csi2_imx95-v4-0-84ea4bb78a88@oss.nxp.com> <3606153.44csPzL39Z@steina-w> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Virus-Scanned: Clear (ClamAV 1.4.3/28008/Fri May 22 08:24:46 2026) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260522_050308_237015_9F3918C3 X-CRM114-Status: GOOD ( 29.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, Am Freitag, 22. Mai 2026, 03:58:56 CEST schrieb G.N. Zhou (OSS): > > > Thanks for testing. Regarding the lane stop state error on i.MX93 with > > imx327: > > > > > > This error indicates the CSI-2 lanes are not in LP-11 (stop) state > > > when expected. Please check: > > > > > > 1) Verify the sensor PHY is in LP-11 state before returning from the = sensor's > > > s_stream(1) call. The CSI-2 receiver expects lanes to be in stop s= tate > > > initially. > >=20 > > Well, this might be tricky as I don't have D-PHY capable scopes. > > I can successfully use this sensor on a imx8mp, so I am expecting this = to be > > okay. > >=20 > > > 2) Check if the imx327 driver has a delay between starting the stream= and > > > returning from s_stream(). If the sensor transitions PHY out of LP= =2D11 > > > state during this delay, the CSI driver's lane state check will fa= il > > > when it runs later. The sensor should remain in LP-11 until the CSI > > > controller completes its initialization. > >=20 > > In imx290_set_stream() and subsequently imx290_start_streaming() setting > > IMX290_XMSTA starts the stream. I expect this is the point when the sen= sors > > switches from LP-11 to HS. But again, I can't verify. >=20 > As mentioned in #2, I reviewed drivers/media/i2c/imx290.c and identified = a 30ms > delay that appears to be the root cause of this issue. >=20 > The problem occurs because: >=20 > The sensor exits LP-11 state and transitions to HS mode after IMX290_XMST= A is written > The 30ms delay in s_stream() causes the function to return late > By the time the CSI controller performs its lane state check, the sensor = has already switched > from LP-11 to HS mode, causing the check to fail=E3=80=82 This sounds wrong, see below. >=20 > Proposed fix: >=20 > diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c > index 21cbc81cb2ed..519aa336249a 100644 > --- a/drivers/media/i2c/imx290.c > +++ b/drivers/media/i2c/imx290.c > @@ -1059,7 +1059,6 @@ static int imx290_start_streaming(struct imx290 *im= x290, > =20 > cci_write(imx290->regmap, IMX290_STANDBY, 0x00, &ret); > =20 > - msleep(30); > =20 > /* Start streaming */ > return cci_write(imx290->regmap, IMX290_XMSTA, 0x00, &ret); >=20 > Removing this delay allows s_stream() to return immediately, giving the C= SI controller > time to complete its initialization before the sensor transitions PHY sta= te. >=20 > Could you test this patch and confirm if it resolves the lane state check= failure? Removing these 30ms does not fix the problem. Actually the delay change is hardly measurable, as the i2c transfer take much more time. I added a messa= ge for start/exit of imx290_enable_streams(). Just the transfers take >600ms. =2D-8<-- [ 40.507273] plane 0: bytesperline=3D3840 sizeimage=3D4147200 [ 40.512628] mxc-isi 4ae40000.isi: validating link "crossbar":2 -> "mxc_i= si.0":0 [ 40.519945] mxc-isi 4ae40000.isi: validating stream "crossbar":2:0 -> "m= xc_isi.0":0:0 [ 40.527789] mxc-isi 4ae40000.isi: validating link "dw-mipi-csi2rx 4ae000= 00.mipi-csi":1 -> "crossbar":0 [ 40.537105] mxc-isi 4ae40000.isi: validating stream "dw-mipi-csi2rx 4ae0= 0000.mipi-csi":1:0 -> "crossbar":0:0 [ 40.546940] mxc-isi 4ae40000.isi: validating link "imx327 4-001a":0 -> "= dw-mipi-csi2rx 4ae00000.mipi-csi":0 [ 40.556680] mxc-isi 4ae40000.isi: validating stream "imx327 4-001a":0:0 = =2D> "dw-mipi-csi2rx 4ae00000.mipi-csi":0:0 [ 40.573332] mxc-isi 4ae40000.isi: enable streams "crossbar":2/0x1 [ 40.579446] mxc-isi 4ae40000.isi: collect_streams: "crossbar":2: found 0= x1 enabled 0x0 [ 40.587373] imx290 4-001a: Frame descriptor on pad 0, type CSI-2 [ 40.593390] imx290 4-001a: stream 0, code 0x300f, length 0, flags 0x00= 00, vc 0, dt 0x2b [ 40.601489] dw-mipi-csi2rx 4ae00000.mipi-csi: Frame descriptor on pad 1,= type CSI-2 [ 40.609147] dw-mipi-csi2rx 4ae00000.mipi-csi: stream 0, code 0x30= 0f, length 0, flags 0x0000, vc 0, dt 0x2b [ 40.618894] mxc-isi 4ae40000.isi: enable streams "dw-mipi-csi2rx 4ae0000= 0.mipi-csi":1/0x1 [ 40.627082] dw-mipi-csi2rx 4ae00000.mipi-csi: collect_streams: "dw-mipi-= csi2rx 4ae00000.mipi-csi":1: found 0x1 enabled 0x0 [ 40.638184] mxc-isi 4ae40000.isi: enable streams "imx327 4-001a":0/0x1 [ 40.644728] imx290 4-001a: collect_streams: sub-device "imx327 4-001a" d= oes not support streams [ 40.653431] imx290 4-001a: imx290_enable_streams start [ 41.294967] imx290 4-001a: imx290_enable_streams exit [ 41.301064] dw-mipi-csi2rx 4ae00000.mipi-csi: lanes are not in stop stat= e: 0x0, expected 0x10003 [ 41.309884] mxc-isi 4ae40000.isi: disable streams "imx327 4-001a":0/0x1 [ 41.316534] imx290 4-001a: collect_streams: sub-device "imx327 4-001a" d= oes not support streams [ 41.361401] mxc-isi 4ae40000.isi: enable streams 1:0x1 failed: -110 [ 41.367690] mxc-isi 4ae40000.isi: failed to enable streams 0x1 on 'dw-mi= pi-csi2rx 4ae00000.mipi-csi':1: -110 [ 41.379854] mxc-isi 4ae40000.isi: enable streams 2:0x1 failed: -110 [ 41.387325] mxc-isi 4ae40000.isi: Failed to enable pipe 0 [ 41.399231] video0: VIDIOC_STREAMON: error -110: type=3Dvid-cap-mplane [ 41.408340] videodev: v4l2_release: video0: release =2D-8<-- Given this I would ague the CSI host initialization order is wrong. The documentation for enable_streams states: > The struct v4l2_subdev_pad_ops->enable_streams() and struct > v4l2_subdev_pad_ops->disable_streams() callbacks are used by the receiver= driver > to control the transmitter driver's streaming state. So IMHO calling enable_streams it is expected the sensors switched to HS mode. Unfortunately even checking PHY stopstate before enabling the subd= ev streams does not fix this error message. There is still=20 > dw-mipi-csi2rx 4ae00000.mipi-csi: lanes are not in stop state: 0x0, expec= ted 0x10003 I also noticed that before the s_stream call (imx290_set_stream) call the device is powered down. That might explaing that reversing the order will not help. Best regards, Alexander =2D-=20 TQ-Systems GmbH | M=C3=BChlstra=C3=9Fe 2, Gut Delling | 82229 Seefeld, Germ= any Amtsgericht M=C3=BCnchen, HRB 105018 Gesch=C3=A4ftsf=C3=BChrer: Detlef Schneider, R=C3=BCdiger Stahl, Stefan Sch= neider http://www.tq-group.com/