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]
Message-ID: <09aa8945c41cdc0c518bddedf8d3489c1e521661.camel@ew.tq-group.com>
Date: Tue, 07 Oct 2025 16:06:36 +0200
From: Matthias Schiffer <matthias.schiffer@...tq-group.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: Peter Korsgaard <peter@...sgaard.com>, Andi Shyti
 <andi.shyti@...nel.org>,  linux-i2c@...r.kernel.org,
 linux-kernel@...r.kernel.org, linux@...tq-group.com
Subject: Re: [PATCH 1/2] i2c: ocores: replace 1ms poll iteration timeout
 with total transfer timeout

On Tue, 2025-10-07 at 14:34 +0200, Andrew Lunn wrote:
> On Tue, Oct 07, 2025 at 02:09:24PM +0200, Matthias Schiffer wrote:
> > When a target makes use of clock stretching, a timeout of 1ms may not be
> > enough. One extreme example is the NXP PTN3460 eDP to LVDS bridge, which
> > takes ~320ms to send its ACK after a flash command has been
> > submitted.
> > 
> > Replace the per-iteration timeout of 1ms with limiting the total
> > transfer time to the timeout set in struct i2c_adapter (defaulting to
> > 1s, configurable through the I2C_TIMEOUT ioctl). While we're at it, also
> > add a cpu_relax() to the busy poll loop.
> 
> 1s is a long time to spin. Maybe it would be better to keep with the
> current spin for 1ms, and then use one of the helpers from iopoll.h to
> do a sleeping wait? Say with 10ms sleeps, up to the 1s maximum?
> 
> 	Andrew

Makes sense. I don't think I can use something from iopoll.h directly, as i2c-
ocores has its own ioreadX abstraction to deal with different register widths
and endianesses, but a combination of spin + sleep is probably the way to go.

Best,
Matthias



-- 
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
https://www.tq-group.com/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ