diff mbox

[v4,2/5] i2c: i2c-cros-ec-tunnel: Set retries to 3

Message ID 1411053538-17237-3-git-send-email-javier.martinez@collabora.co.uk
State Awaiting Upstream
Headers show

Commit Message

Javier Martinez Canillas Sept. 18, 2014, 3:18 p.m. UTC
From: Derek Basehore <dbasehore@chromium.org>

Since the i2c bus can get wedged on the EC sometimes, set the number of retries
to 3. Since we un-wedge the bus immediately after the wedge happens, this is the
correct fix since only one transfer will fail.

Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
---
 drivers/i2c/busses/i2c-cros-ec-tunnel.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Lee Jones Sept. 29, 2014, 7:49 a.m. UTC | #1
On Thu, 18 Sep 2014, Javier Martinez Canillas wrote:

> From: Derek Basehore <dbasehore@chromium.org>
> 
> Since the i2c bus can get wedged on the EC sometimes, set the number of retries
> to 3. Since we un-wedge the bus immediately after the wedge happens, this is the
> correct fix since only one transfer will fail.
> 
> Signed-off-by: Derek Basehore <dbasehore@chromium.org>
> Reviewed-by: Doug Anderson <dianders@chromium.org>
> Acked-by: Wolfram Sang <wsa@the-dreams.de>
> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
> ---
>  drivers/i2c/busses/i2c-cros-ec-tunnel.c | 3 +++
>  1 file changed, 3 insertions(+)

Applied, thanks.

> diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> index 3c15dcc..97e6369 100644
> --- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> +++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> @@ -16,6 +16,8 @@
>  #include <linux/platform_device.h>
>  #include <linux/slab.h>
>  
> +#define I2C_MAX_RETRIES 3
> +
>  /**
>   * struct ec_i2c_device - Driver data for I2C tunnel
>   *
> @@ -290,6 +292,7 @@ static int ec_i2c_probe(struct platform_device *pdev)
>  	bus->adap.algo_data = bus;
>  	bus->adap.dev.parent = &pdev->dev;
>  	bus->adap.dev.of_node = np;
> +	bus->adap.retries = I2C_MAX_RETRIES;
>  
>  	err = i2c_add_adapter(&bus->adap);
>  	if (err) {
Lee Jones Sept. 29, 2014, 7:50 a.m. UTC | #2
On Mon, 29 Sep 2014, Lee Jones wrote:

> On Thu, 18 Sep 2014, Javier Martinez Canillas wrote:
> 
> > From: Derek Basehore <dbasehore@chromium.org>
> > 
> > Since the i2c bus can get wedged on the EC sometimes, set the number of retries
> > to 3. Since we un-wedge the bus immediately after the wedge happens, this is the
> > correct fix since only one transfer will fail.
> > 
> > Signed-off-by: Derek Basehore <dbasehore@chromium.org>
> > Reviewed-by: Doug Anderson <dianders@chromium.org>
> > Acked-by: Wolfram Sang <wsa@the-dreams.de>
> > Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
> > ---
> >  drivers/i2c/busses/i2c-cros-ec-tunnel.c | 3 +++
> >  1 file changed, 3 insertions(+)
> 
> Applied, thanks.

Wolfram,

Do you want a pull-request?

> > diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> > index 3c15dcc..97e6369 100644
> > --- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> > +++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> > @@ -16,6 +16,8 @@
> >  #include <linux/platform_device.h>
> >  #include <linux/slab.h>
> >  
> > +#define I2C_MAX_RETRIES 3
> > +
> >  /**
> >   * struct ec_i2c_device - Driver data for I2C tunnel
> >   *
> > @@ -290,6 +292,7 @@ static int ec_i2c_probe(struct platform_device *pdev)
> >  	bus->adap.algo_data = bus;
> >  	bus->adap.dev.parent = &pdev->dev;
> >  	bus->adap.dev.of_node = np;
> > +	bus->adap.retries = I2C_MAX_RETRIES;
> >  
> >  	err = i2c_add_adapter(&bus->adap);
> >  	if (err) {
>
Wolfram Sang Sept. 29, 2014, 9:19 a.m. UTC | #3
On Mon, Sep 29, 2014 at 08:50:14AM +0100, Lee Jones wrote:
> On Mon, 29 Sep 2014, Lee Jones wrote:
> 
> > On Thu, 18 Sep 2014, Javier Martinez Canillas wrote:
> > 
> > > From: Derek Basehore <dbasehore@chromium.org>
> > > 
> > > Since the i2c bus can get wedged on the EC sometimes, set the number of retries
> > > to 3. Since we un-wedge the bus immediately after the wedge happens, this is the
> > > correct fix since only one transfer will fail.
> > > 
> > > Signed-off-by: Derek Basehore <dbasehore@chromium.org>
> > > Reviewed-by: Doug Anderson <dianders@chromium.org>
> > > Acked-by: Wolfram Sang <wsa@the-dreams.de>
> > > Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
> > > ---
> > >  drivers/i2c/busses/i2c-cros-ec-tunnel.c | 3 +++
> > >  1 file changed, 3 insertions(+)
> > 
> > Applied, thanks.
> 
> Wolfram,
> 
> Do you want a pull-request?

Nope. All fine, there shouldn't be any conflict.
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
index 3c15dcc..97e6369 100644
--- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c
+++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
@@ -16,6 +16,8 @@ 
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 
+#define I2C_MAX_RETRIES 3
+
 /**
  * struct ec_i2c_device - Driver data for I2C tunnel
  *
@@ -290,6 +292,7 @@  static int ec_i2c_probe(struct platform_device *pdev)
 	bus->adap.algo_data = bus;
 	bus->adap.dev.parent = &pdev->dev;
 	bus->adap.dev.of_node = np;
+	bus->adap.retries = I2C_MAX_RETRIES;
 
 	err = i2c_add_adapter(&bus->adap);
 	if (err) {