lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 11 Oct 2023 13:59:50 +0200
From:   Alexander Stein <alexander.stein@...tq-group.com>
To:     Stefan Lengfeld <contact@...fanchrist.eu>,
        Krzysztof Hałasa <khalasa@...p.pl>
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

Hi,

Am Mittwoch, 11. Oktober 2023, 13:25:55 CEST schrieb Krzysztof Hałasa:
> 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).

I assume that the master clock is running independently to I2C from the SoC 
the sensor is attached to. Your calculations indicate you are assuming ~400kHz 
I2C clock frequency.
But nothing is preventing that sensor from running on a 100kHz I2C bus. Even 
this "atomic" hack will not be sufficient in that case.

Best regards,
Alexander

> > 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,


-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ