]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: i2c: imx283: Fix hang when going from large to small resolution
authorJai Luthra <jai.luthra@ideasonboard.com>
Sat, 14 Feb 2026 13:05:22 +0000 (18:35 +0530)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 11 Mar 2026 00:05:35 +0000 (01:05 +0100)
commit9206359b2c396ff594adf39bc7daaadab0fcb367
treed574789801e20b9535381dfd12d04968565d10b0
parentbce1349dbf6348ddee47308e2ed08878356de317
media: i2c: imx283: Fix hang when going from large to small resolution

When switching between modes (e.g. full resolution to binned),
standby_cancel() previously cleared XMSTA (starting master mode data
output) before the new mode's MDSEL, crop, and timing registers were
programmed in start_streaming(). This caused the sensor to briefly
output MIPI data using the previous mode's configuration.

On receivers like imx-mipi-csis, this leads to FIFO overflow errors
when switching from a higher to a lower resolution, as the receiver is
configured for the new smaller frame size but receives stale
full-resolution data.

Fix this by moving the XMSTA and SYNCDRV register writes from
standby_cancel() to the end of start_streaming(), after all mode,
crop, and timing registers have been configured. Also explicitly stop
master mode (XMSTA=1) when stopping the stream, matching the pattern
used by other Sony sensor drivers (imx290, imx415).

Use named macros IMX283_XMSTA_START/STOP instead of raw 0/BIT(0) for
readability.

Cc: stable@vger.kernel.org
Fixes: ccb4eb4496fa ("media: i2c: Add imx283 camera sensor driver")
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/imx283.c