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: <ca3a96c2-e4d9-d935-cf1b-114f7a59872e@axentia.se>
Date: Wed, 29 May 2024 14:16:58 +0200
From: Peter Rosin <peda@...ntia.se>
To: Bastien Curutchet <bastien.curutchet@...tlin.com>,
 Andi Shyti <andi.shyti@...nel.org>, Rob Herring <robh@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
 <conor+dt@...nel.org>, Peter Korsgaard <peter.korsgaard@...co.com>,
 Wolfram Sang <wsa@...nel.org>
Cc: linux-i2c@...r.kernel.org, devicetree@...r.kernel.org,
 linux-kernel@...r.kernel.org, Thomas Petazzoni
 <thomas.petazzoni@...tlin.com>, Herve Codina <herve.codina@...tlin.com>,
 Christopher Cordahi <christophercordahi@...ometrics.ca>
Subject: Re: [PATCH v2 3/3] i2c: mux: gpio: Add support for the
 'transition-delay-us' property

Hi!

2024-05-29 at 11:17, Bastien Curutchet wrote:
> Some hardware need some time to switch from a bus to another. This can
> cause the first transfers following the selection of a bus to fail.
> There is no way to configure this kind of waiting time in the driver.
> 
> Add support for the 'transition-delay-us' device-tree property. When set,
> the i2c_mux_gpio_select() applies a delay before returning, leaving
> enough time to the hardware to switch to the new bus.
> 
> Signed-off-by: Bastien Curutchet <bastien.curutchet@...tlin.com>
> ---
>  drivers/i2c/muxes/i2c-mux-gpio.c           | 6 ++++++
>  include/linux/platform_data/i2c-mux-gpio.h | 2 ++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c
> index c61e9d9ea695..b9cfc80660e2 100644
> --- a/drivers/i2c/muxes/i2c-mux-gpio.c
> +++ b/drivers/i2c/muxes/i2c-mux-gpio.c
> @@ -6,6 +6,7 @@
>   */
>  
>  #include <linux/bits.h>
> +#include <linux/delay.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/gpio/driver.h>
>  #include <linux/i2c.h>
> @@ -37,6 +38,9 @@ static int i2c_mux_gpio_select(struct i2c_mux_core *muxc, u32 chan)
>  
>  	i2c_mux_gpio_set(mux, chan);
>  
> +	if (mux->data.transition_delay)
> +		udelay(mux->data.transition_delay);

fsleep() is appropriate here.

Cheers,
Peter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ