mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] i2c/pca954x: Initialize the mux to disconnected state
Date: Mon, 9 Sep 2019 10:48:30 +0200	[thread overview]
Message-ID: <20190909084830.5fxgs7oihsecquhm@pengutronix.de> (raw)
In-Reply-To: <20190908000314.27078-1-andrew.smirnov@gmail.com>

On Sat, Sep 07, 2019 at 05:03:14PM -0700, Andrey Smirnov wrote:
> Port of a Linux kernel commit cd823db8b1161ef0d756514d280715a576d65cc3
> 
>     pca954x power-on default is channel 0 connected. If multiple pca954x
>     muxes are connected to the same physical I2C bus, the parent bus will
>     see channel 0 devices behind both muxes by default. This is bad.
> 
>     Scenario:
>                 -- pca954x @ 0x70 -- ch 0 (I2C-bus-101) -- EEPROM @ 0x50
>                 |
>     I2C-bus-1 ---
>                 |
>                 -- pca954x @ 0x71 -- ch 0 (I2C-bus-111) -- EEPROM @ 0x50
> 
>     1. Load I2C bus driver: creates I2C-bus-1
>     2. Load pca954x driver: creates virtual I2C-bus-101 and I2C-bus-111
>     3. Load eeprom driver
>     4. Try to read EEPROM @ 0x50 on I2C-bus-101. The transaction will also bleed
>        onto I2C-bus-111 because pca954x @ 0x71 channel 0 is connected by default.
> 
>     Fix: Initialize pca954x to disconnected state in pca954x_probe()
> 
>     Signed-off-by: Petri Gynther <pgynther@google.com>
>     Signed-off-by: Jean Delvare <khali@linux-fr.org>
>     Cc: stable@kernel.org
> 
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> ---
>  drivers/i2c/muxes/i2c-mux-pca954x.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)

Applied with whitespace cleanup, thanks

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2019-09-09  8:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-08  0:03 Andrey Smirnov
2019-09-09  8:48 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190909084830.5fxgs7oihsecquhm@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox