From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.70.43.20 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796145477; b=DXjeo8Ct8Gk7s1DTOHZQkgP06zlFnu2Bb5PL+MfqvBSdkZgn5RQ+soscj6QU0BdXHNZP dpUJce5IVAOxQ98l8mqYxNEgtgEoIsnqMHsItYWwMquWnwMaanp186atTT7SHK0gMpWPy FzRSNkv/7qF9iZnwyOcn7FOS2GGAQZkcM2LEr0CuU0yeiqaJ32G3EQ8ljg0lG8fNYhP4f Hgf5Gs9K9GAlVNebgb6OYEQSfJMx9dLzhwAHjlGA64CSsqS3cjssLeJ/BnceVoKnSmBim KTLLjjboB6EC3cT9bCGWt0z7EtN1033I5jl5VFnFnPfLVicv8cNs4EOD0o4OLq+Y14Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796145477; h=DMARC-Filter:Date:To:From:Cc:Subject:Message-ID:In-Reply-To: References:Feedback-ID:X-Pm-Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=Zw/axa8mNdks/C+OUPo52lQDSMw0w0NNJV8uvfb2HCw=; b=5AFvGD2FKVNt3jz/QAvNLGGjLa3eiLUS+nuVUTv1iJOSEfpdHAra9z8uj/XSNzFOPsyr EvK8nQ+QpwdTg79jmeIksMuamKNp3JpJjp7WNpZ2Qx44UBL8ZRXTGel19HjqjeX1n6+uB czNTrkq0u1xzIxXK2UjqH2T/P4FllJ1KXpwLyN2dML655rFGkxyaz+nhemC1s4Jgdb8e3 XEuT3jeFdHt2VPr4OCZ/XCW9adw265zz+HC1PSc5gb9L+JqwVeNsvoW20/sEMUI2tP63m WTkN9d8G8XcSuwsI+xHXj1o8yZaolh1V6TiPL+PxgfuWUfV5PypwCRVFUHdCyGnlgsQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=loafecho.com; spf=pass smtp.mailfrom=loafecho.com; arc=none smtp.remote-ip=185.70.43.20 Received: from mail-4320.protonmail.ch (mail-4320.protonmail.ch [185.70.43.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70253606A320 for ; Tue, 1 Dec 2026 17:17:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 70253606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=loafecho.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=loafecho.com Date: Tue, 01 Dec 2026 17:17:49 +0000 To: Marco Ziliani From: Tony Garcia Cc: Daniel Scally , Sakari Ailus , Mauro Carvalho Chehab , linux-media@vger.kernel.org, Chris Simpson , Simon Kruse , "D. Manresa" , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 0/4] media: i2c: ov5693: Fix mode changes, flips and autosuspend Message-ID: In-Reply-To: <20261128-ov5693-fixes-v3-0-bcdd169958b6@gmail.com> References: <20261128-ov5693-fixes-v3-0-bcdd169958b6@gmail.com> Feedback-ID: 118140192:user:proton X-Pm-Message-ID: eb75619feca5b7e38adea92d1ad5dd7a761071a0 X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Marco, Tested v3 on a Surface Pro 7 (Ice Lake). Its front OV5693 sits behind an IPU4P, which I run with ruslanbay's IPU4P-on-IPU6 RFC series on linux-surface 7.3.0-rc7. The four patches were applied to the 7.3 ov5693.c. One hunk of patch 2 needed a context-only fix, because set_fmt() has no client_info argument on 7.3; the added ov5693_mode_update() is unchanged and the diff is still 106+/25-. Raw capture from the ISYS video node with v4l2-ctl, frames saved and checked buffer by buffer, no libcamera. Each of the tests below was also run on the unpatched 7.3 driver as a control. Patch 2, format changes on a powered sensor: with the sensor held powered (power/control=3Don), 8 changes from 2592x1944 to a centred 1920x1080 crop and 8 back. OUTPUT_SIZE_X/Y (0x3808/0x380a) read over I2C during each stream matched 16 of 16 times and all 16 streams delivered frames. Unpatched: 0x3808 stayed at 2592 after each of 3 changes to the crop and none of those streams produced a frame. Patch 2, during the autosuspend delay: with autosuspend_delay_ms set to 3000, I set the other format on the sensor pad right after a stream stopped and read 0x3808/0x380a about 50 ms later, with no stream running. 6 of 6 showed the new size, the sensor active before and after. Unpatched, same test: 0 of 6, the registers kept the old size. Patch 2, -EBUSY: 1 s into a 90-frame stream, VIDIOC_SUBDEV_S_FMT (1296x972) and VIDIOC_SUBDEV_S_SELECTION (the 1920x1080 crop) on the active state both failed with EBUSY, 3 of 3 runs. The active format and crop were unchanged and the streams carried on normally. Unpatched, both calls returned 0 and the stream broke up (CSI-2 FIFO overflow and frame sync errors). Patch 3, flips: 2592x1944 at all four hflip/vflip settings. The sensor reported SBGGR10 and the 2x2 sub-plane test found the green pair on the BGGR/RGGB diagonal in all four. Unpatched it moved to the GBRG/GRBG diagonal at both single-flip settings. Image profiles against hflip=3D0/vflip=3D0 confirmed the three flipped settings really mirrored the image. One caveat: the room was dark, so I raised exposure and gain for this, and I couldn't check the blue/red order this time as I did on v1. Patch 4, autosuspend at stream stop: after a 60-frame stream the sensor was suspended at the 1.1 s sample in one run and the 1.3 s sample in two (100 ms sampling, default 1 s delay). Unpatched it was already suspended at the first sample, 3 of 3. Patch 1 has no test of its own, but everything above ran with it applied. The first buffer of a stream was often partly empty, with and without the series, so that's not from these patches. One more thing I ran into, which is not caused by this series: VIDIOC_SUBDEV_S_FMT with which=3DTRY oopses with a divide error in ov5693_set_fmt(), e.g. "v4l2-ctl -d /dev/v4l-subdevN --try-subdev-fmt pad=3D0,width=3D1296,height=3D972". I hit it with this series and also with the 7.3 driver I normally run, which doesn't have patch 2. I didn't run it on the pure stock build, but the code there is the same. The driver has no init_state, so I think the TRY crop is 0x0, width gets clamped to 0 and DIV_ROUND_CLOSEST(crop->width, width) divides by it. It matters a bit more with patch 2 though: set_fmt() now holds the lock through guard(mutex) when the oops hits, so afterwards stream stop and get_selection hang and the module can't be unloaded until a reboot. With my usual driver the camera kept working after the oops. Since you're in this function anyway, an init_state that sets the default crop and format might fit in v4. Happy to test it. The tests were scripted and run on my Surface Pro 7 by an AI coding assistant (Claude) at my direction, and it drafted this summary. For the series, on the Surface Pro 7 (IPU4P): Tested-by: Tony Garcia