[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m3fs2htn7g.fsf@t19.piap.pl>
Date: Wed, 11 Oct 2023 13:25:55 +0200
From: Krzysztof Hałasa <khalasa@...p.pl>
To: Stefan Lengfeld <contact@...fanchrist.eu>
Cc: linux-media <linux-media@...r.kernel.org>,
lkml <linux-kernel@...r.kernel.org>,
Dave Stevenson <dave.stevenson@...pberrypi.com>,
Oleksij Rempel <linux@...pel-privat.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>, linux-i2c@...r.kernel.org
Subject: Re: Sony IMX290/462 image sensors I2C xfer peculiarity
Stefan,
> I cannot answer whether the delay is needed for atomic transfer or not.
> But I can give a bit of context for I2C atomic transfers in general.
>
> These where only introduced for a very narrow and special uses shutting
> down the device/power with external PMICs in the kernel's shutdown
> handlers.
Well, I guess I'm abusing this code a bit.
The problem is I use Sony IMX290 and IMX462 image sensors, and they have
an apparently hard-coded timeout of about 2^18 their master clock cycles
(= ca. 7 ms with my setup). After the timeout they simply disconnect
from the I2C bus. Of course, this isn't mentioned in the docs.
Unfortunately, "normal" I2C accesses take frequently more than those
7 ms (mostly due to scheduling when all CPU cores are in use). So I
hacked the IMX I2C driver a bit and now all accesses to the sensor use
the atomic paths and local_irq_save() (inside the driver only).
> My understand is that an ordinary I2C device would just use normal (and
> sleepable) I2C transfers while the device is in use.
You are spot-on here :-) Now I use IMX 290 and 462.
OTOH I wonder if such issues are limited to those sensors only.
Thanks for your immediate response,
--
Krzysztof "Chris" Hałasa
Sieć Badawcza Łukasiewicz
Przemysłowy Instytut Automatyki i Pomiarów PIAP
Al. Jerozolimskie 202, 02-486 Warszawa
Powered by blists - more mailing lists