]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: Re-instate body of i2c_parent_is_i2c_adapter()
authorStephen Warren <swarren@nvidia.com>
Mon, 13 Jan 2014 21:29:04 +0000 (14:29 -0700)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 14 Jan 2014 16:11:13 +0000 (17:11 +0100)
commit78d7f5f04acfb6bfbe6c5dc16e26cff4ac218204
treebad64f1e4054ebb2e6f8ad2d5ab66369ffedd2fa
parentf1f6da94d81a8d49f4fd56ccfa5cee67e895df9f
i2c: Re-instate body of i2c_parent_is_i2c_adapter()

The body of i2c_parent_is_i2c_adapter() is currently guarded by
I2C_MUX. It should be CONFIG_I2C_MUX instead.

Among potentially other problems, this resulted in i2c_lock_adapter()
only locking I2C mux child adapters, and not the parent adapter. In
turn, this could allow inter-mingling of mux child selection and I2C
transactions, which could result in I2C transactions being directed to
the wrong I2C bus, and possibly even switching between busses in the
middle of a transaction.

One concrete issue caused by this bug was corrupted HDMI EDID reads
during boot on the NVIDIA Tegra Seaboard system, although this only
became apparent in recent linux-next, when the boot timing was changed
just enough to trigger the race condition.

Fixes: f4e279024ff3 ("i2c: reduce parent checking to a NOOP in non-I2C_MUX case")
Cc: Phil Carmody <phil.carmody@partner.samsung.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
include/linux/i2c.h