Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1383762

Re: [PATCH v6 07/19] i2c: octeon: Use i2c recovery framework

From Wolfram Sang <wsa@the-dreams.de>
Newsgroups linux.kernel
Subject Re: [PATCH v6 07/19] i2c: octeon: Use i2c recovery framework
Date 2016-04-20 23:40 +0200
Message-ID <rq80P-6j3-17@gated-at.bofh.it> (permalink)
References <rmLWN-81T-3@gated-at.bofh.it> <rmM6v-87k-45@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Mon, Apr 11, 2016 at 05:28:38PM +0200, Jan Glauber wrote:
> Switch to the i2c bus recovery framework using generic SCL recovery.
> If this fails try to reset the hardware. The recovery is triggered
> during START on timeout of the interrupt or failure to reach
> the START / repeated-START condition.
> 
> The START function is moved to xfer and while at it:
> - removed xfer debug message (i2c core already provides debugging)
> - removed length is zero check
> 
> Signed-off-by: Jan Glauber <jglauber@cavium.com>
> ---
>  drivers/i2c/busses/i2c-octeon.c | 178 +++++++++++++++++++++++++---------------
>  1 file changed, 111 insertions(+), 67 deletions(-)

Interesting, it got larger...

> 
> +/**
> + * octeon_i2c_write_int - read the TWSI_INT register

read_int

> +	int ret, retries = 2;

I don't think 'retries' makes sense here. On failure, you return
-EAGAIN, so the core will retry 'adapter->retries' times anyhow.

> -	if (length < 1)
> -		return -EINVAL;

So, the adapter support 0-length messages now? Or why was it there? I
have the feeling this is a seperate patch.

> +static void octeon_i2c_prepare_recovery(struct i2c_adapter *adap)
> +{
> +	struct octeon_i2c *i2c = i2c_get_adapdata(adap);
> +
> +	/*
> +	 * The stop resets the state machine, does not _transmit_ STOP unless
> +	 * engine was active.
> +	 */
> +	octeon_i2c_stop(i2c);
> +
> +	octeon_i2c_write_int(i2c, 0);

Maybe a comment why the delay?

> +	udelay(5);
> +}

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v6 07/19] i2c: octeon: Use i2c recovery framework Wolfram Sang <wsa@the-dreams.de> - 2016-04-20 23:40 +0200
  Re: [PATCH v6 07/19] i2c: octeon: Use i2c recovery framework Wolfram Sang <wsa@the-dreams.de> - 2016-04-21 16:00 +0200
    Re: [PATCH v6 07/19] i2c: octeon: Use i2c recovery framework Jan Glauber <jan.glauber@caviumnetworks.com> - 2016-04-21 20:00 +0200
      Re: [PATCH v6 07/19] i2c: octeon: Use i2c recovery framework Wolfram Sang <wsa@the-dreams.de> - 2016-04-21 23:40 +0200

csiph-web