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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sun, 31 Oct 2021 00:31:39 +0200
From:   Peter Rosin <peda@...ntia.se>
To:     Horatiu Vultur <horatiu.vultur@...rochip.com>, robh+dt@...nel.org,
        linux-i2c@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     Lars Povlsen <lars.povlsen@...rochip.com>
Subject: Re: [PATCH v2 2/2] i2c-mux-gpmux: Support settle-time-us property

On 2021-10-28 14:53, Horatiu Vultur wrote:
> Add support for settle-time-us property. If this is defined in device
> tree then add this delay to mux APIs.
> 
> Signed-off-by: Lars Povlsen <lars.povlsen@...rochip.com>
> Signed-off-by: Horatiu Vultur <horatiu.vultur@...rochip.com>
> ---
>  drivers/i2c/muxes/i2c-mux-gpmux.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/muxes/i2c-mux-gpmux.c b/drivers/i2c/muxes/i2c-mux-gpmux.c
> index d3acd8d66c32..569de1d8fdc1 100644
> --- a/drivers/i2c/muxes/i2c-mux-gpmux.c
> +++ b/drivers/i2c/muxes/i2c-mux-gpmux.c
> @@ -16,6 +16,7 @@
>  
>  struct mux {
>  	struct mux_control *control;
> +	u32 delay_us;
>  
>  	bool do_not_deselect;
>  };
> @@ -25,7 +26,7 @@ static int i2c_mux_select(struct i2c_mux_core *muxc, u32 chan)
>  	struct mux *mux = i2c_mux_priv(muxc);
>  	int ret;
>  
> -	ret = mux_control_select(mux->control, chan);
> +	ret = mux_control_select_delay(mux->control, chan, mux->delay_us);
>  	mux->do_not_deselect = ret < 0;
>  
>  	return ret;
> @@ -89,6 +90,9 @@ static int i2c_mux_probe(struct platform_device *pdev)
>  		return dev_err_probe(dev, PTR_ERR(mux->control),
>  				     "failed to get control-mux\n");
>  
> +	mux->delay_us = 0;
> +	of_property_read_u32(np, "settle-time-us", &mux->delay_us);

Some nitpicks, zeroing out the variable is not needed (the memory has
been cleared already) and I would like this a bit further down next
to digging out the mux-locked property.

Cheers,
Peter

> +
>  	parent = mux_parent_adapter(dev);
>  	if (IS_ERR(parent))
>  		return dev_err_probe(dev, PTR_ERR(parent),
> 

Powered by blists - more mailing lists