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


Groups > linux.kernel > #1483283 > unrolled thread

[PATCH] i2c: i2c-mux-pca954x: retry updating the mux selection on failure

Started byPeter Rosin <peda@axentia.se>
First post2016-09-14 15:30 +0200
Last post2016-09-21 23:20 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] i2c: i2c-mux-pca954x: retry updating the mux selection on failure Peter Rosin <peda@axentia.se> - 2016-09-14 15:30 +0200
    Re: [PATCH] i2c: i2c-mux-pca954x: retry updating the mux selection  on failure Wolfram Sang <wsa@the-dreams.de> - 2016-09-15 22:00 +0200
    Re: [PATCH] i2c: i2c-mux-pca954x: retry updating the mux selection  on failure Wolfram Sang <wsa@the-dreams.de> - 2016-09-21 23:20 +0200

#1483283 — [PATCH] i2c: i2c-mux-pca954x: retry updating the mux selection on failure

FromPeter Rosin <peda@axentia.se>
Date2016-09-14 15:30 +0200
Subject[PATCH] i2c: i2c-mux-pca954x: retry updating the mux selection on failure
Message-ID<shiqe-1oQ-13@gated-at.bofh.it>
The cached value of the last selected channel prevents retries on the
next call, even on failure to update the selected channel. Fix that.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/muxes/i2c-mux-pca954x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
index 528e755c468f..3278ebf1cc5c 100644
--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
+++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
@@ -164,7 +164,7 @@ static int pca954x_select_chan(struct i2c_mux_core *muxc, u32 chan)
 	/* Only select the channel if its different from the last channel */
 	if (data->last_chan != regval) {
 		ret = pca954x_reg_write(muxc->parent, client, regval);
-		data->last_chan = regval;
+		data->last_chan = ret ? 0 : regval;
 	}
 
 	return ret;
-- 
2.1.4

[toc] | [next] | [standalone]


#1484512 — Re: [PATCH] i2c: i2c-mux-pca954x: retry updating the mux selection on failure

FromWolfram Sang <wsa@the-dreams.de>
Date2016-09-15 22:00 +0200
SubjectRe: [PATCH] i2c: i2c-mux-pca954x: retry updating the mux selection on failure
Message-ID<shKZb-2PE-9@gated-at.bofh.it>
In reply to#1483283

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

On Wed, Sep 14, 2016 at 03:24:12PM +0200, Peter Rosin wrote:
> The cached value of the last selected channel prevents retries on the
> next call, even on failure to update the selected channel. Fix that.
> 
> Signed-off-by: Peter Rosin <peda@axentia.se>

Looks good. Is this 4.8 material or rather 4.9?

[toc] | [prev] | [next] | [standalone]


#1488413 — Re: [PATCH] i2c: i2c-mux-pca954x: retry updating the mux selection on failure

FromWolfram Sang <wsa@the-dreams.de>
Date2016-09-21 23:20 +0200
SubjectRe: [PATCH] i2c: i2c-mux-pca954x: retry updating the mux selection on failure
Message-ID<sjX5T-5Jq-13@gated-at.bofh.it>
In reply to#1483283

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

On Wed, Sep 14, 2016 at 03:24:12PM +0200, Peter Rosin wrote:
> The cached value of the last selected channel prevents retries on the
> next call, even on failure to update the selected channel. Fix that.
> 
> Signed-off-by: Peter Rosin <peda@axentia.se>

Applied to for-current and added stable, thanks!

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web