<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/i2c, branch v4.6</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.6</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-04-22T13:31:54Z</updated>
<entry>
<title>i2c: exynos5: Fix possible ABBA deadlock by keeping I2C clock prepared</title>
<updated>2016-04-22T13:31:54Z</updated>
<author>
<name>Javier Martinez Canillas</name>
<email>javier@osg.samsung.com</email>
</author>
<published>2016-04-17T01:14:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=10ff4c5239a137abfc896ec73ef3d15a0f86a16a'/>
<id>urn:sha1:10ff4c5239a137abfc896ec73ef3d15a0f86a16a</id>
<content type='text'>
The exynos5 I2C controller driver always prepares and enables a clock
before using it and then disables unprepares it when the clock is not
used anymore.

But this can cause a possible ABBA deadlock in some scenarios since a
driver that uses regmap to access its I2C registers, will first grab
the regmap lock and then the I2C xfer function will grab the prepare
lock when preparing the I2C clock. But since the clock driver also
uses regmap for I2C accesses, preparing a clock will first grab the
prepare lock and then the regmap lock when using the regmap API.

An example of this happens on the Exynos5422 Odroid XU4 board where a
s2mps11 PMIC is used and both the s2mps11 regulators and clk drivers
share the same I2C regmap.

The possible deadlock is reported by the kernel lockdep:

  Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(sec_core:428:(regmap)-&gt;lock);
                                lock(prepare_lock);
                                lock(sec_core:428:(regmap)-&gt;lock);
   lock(prepare_lock);

  *** DEADLOCK ***

Fix it by leaving the code prepared on probe and use {en,dis}able in
the I2C transfer function.

This patch is similar to commit 34e81ad5f0b6 ("i2c: s3c2410: fix ABBA
deadlock by keeping clock prepared") that fixes the same bug in other
driver for an I2C controller found in Samsung SoCs.

Reported-by: Anand Moon &lt;linux.amoon@gmail.com&gt;
Signed-off-by: Javier Martinez Canillas &lt;javier@osg.samsung.com&gt;
Reviewed-by: Anand Moon &lt;linux.amoon@gmail.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: stable@kernel.org
</content>
</entry>
<entry>
<title>i2c: cpm: Fix build break due to incompatible pointer types</title>
<updated>2016-04-22T13:25:53Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2016-04-13T03:59:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=609d5a1b2b35bb62b4b3750396e55453160c2a17'/>
<id>urn:sha1:609d5a1b2b35bb62b4b3750396e55453160c2a17</id>
<content type='text'>
Since commit ea8daa7b9784 ("kbuild: Add option to turn incompatible
pointer check into error"), assignments from an incompatible pointer
types have become a hard error, eg:

  drivers/i2c/busses/i2c-cpm.c:545:91: error: passing argument 3 of
  'dma_alloc_coherent' from incompatible pointer type

Fix the build break by converting txdma &amp; rxdma to dma_addr_t.

Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: stable@kernel.org
Fixes: ea8daa7b9784
</content>
</entry>
<entry>
<title>i2c: ismt: Add Intel DNV PCI ID</title>
<updated>2016-04-12T21:44:16Z</updated>
<author>
<name>Mika Westerberg</name>
<email>mika.westerberg@linux.intel.com</email>
</author>
<published>2016-04-08T12:41:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=abaa7b0c1286ca1610a6dfa079e1d2e27dca1f25'/>
<id>urn:sha1:abaa7b0c1286ca1610a6dfa079e1d2e27dca1f25</id>
<content type='text'>
Intel DNV has the same iSMT SMBus host controller than Intel Avoton. Add
DNV PCI ID to the list of supported devices.

Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Acked-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Acked-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: xlp9xx: add support for Broadcom Vulcan</title>
<updated>2016-04-12T21:40:11Z</updated>
<author>
<name>Tanmay Jagdale</name>
<email>tanmay.jagdale@broadcom.com</email>
</author>
<published>2016-04-11T12:31:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8574ad7800ad298dc7f184f12b454a67fa3dd839'/>
<id>urn:sha1:8574ad7800ad298dc7f184f12b454a67fa3dd839</id>
<content type='text'>
The Broadcom Vulcan ARM64 processor uses the same I2C controller
present on the Broadcom XLP9xx/5xx MIPS processor family.
Updated the Kconfig by adding ARCH_VULCAN option.

Signed-off-by: Tanmay Jagdale &lt;tanmay.jagdale@broadcom.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: rk3x: add support for rk3228</title>
<updated>2016-04-12T21:34:44Z</updated>
<author>
<name>Yakir Yang</name>
<email>ykk@rock-chips.com</email>
</author>
<published>2016-03-14T03:09:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b0b6d123f5df189d7d3a62d450e5f5c33ad614d8'/>
<id>urn:sha1:b0b6d123f5df189d7d3a62d450e5f5c33ad614d8</id>
<content type='text'>
Enable the I2C core for this SoC.

Signed-off-by: Yakir Yang &lt;ykk@rock-chips.com&gt;
Reviewed-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: jz4780: really prevent potential division by zero</title>
<updated>2016-04-09T06:36:44Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2016-04-03T21:32:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=caf280800aaf73f0796d1bb3fa0f6576c8222258'/>
<id>urn:sha1:caf280800aaf73f0796d1bb3fa0f6576c8222258</id>
<content type='text'>
Make sure we avoid a division-by-zero OOPS in case clock-frequency is
set too low in DT. Add missing '\n' while we are here.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Acked-by: Axel Lin &lt;axel.lin@ingics.com&gt;
</content>
</entry>
<entry>
<title>Revert "i2c: jz4780: prevent potential division by zero"</title>
<updated>2016-04-09T06:32:37Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2016-04-09T06:32:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4ececb7d173f17c60c00e704a0e4e51cdf788e04'/>
<id>urn:sha1:4ececb7d173f17c60c00e704a0e4e51cdf788e04</id>
<content type='text'>
This reverts commit 34cf2acdafaa31a13821e45de5ee896adcd307b1. 'ret' is
not set when bailing out. Also, there is a better place to check for 0.

Reported-by: Axel Lin &lt;axel.lin@ingics.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: jz4780: prevent potential division by zero</title>
<updated>2016-04-07T19:13:38Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2016-04-03T21:32:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=34cf2acdafaa31a13821e45de5ee896adcd307b1'/>
<id>urn:sha1:34cf2acdafaa31a13821e45de5ee896adcd307b1</id>
<content type='text'>
Make sure we don't OOPS in case clock-frequency is set to 0 in a DT. The
variable set here is later used as a divisor.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: mux: demux-pinctrl: Clean up sysfs attributes</title>
<updated>2016-04-01T11:00:07Z</updated>
<author>
<name>Ben Hutchings</name>
<email>ben.hutchings@codethink.co.uk</email>
</author>
<published>2016-03-31T15:40:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c0c508a418f9daeb49bf9c387c84d89381b28540'/>
<id>urn:sha1:c0c508a418f9daeb49bf9c387c84d89381b28540</id>
<content type='text'>
sysfs attributes should use the same format for reads and writes,
rather than pretty-printing on read.

* Make the "cur_master" attribute read back as just the name of the
  master
* Expose the list of all masters as a read-only "available_masters"
  attribute, using space separators as in similar attributes of other
  devices

Also, spell out "cur_master" in full as "current_master".

Fixes: 50a5ba876908 ("i2c: mux: demux-pinctrl: add driver")
Signed-off-by: Ben Hutchings &lt;ben.hutchings@codethink.co.uk&gt;
Tested-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: prevent endless uevent loop with CONFIG_I2C_DEBUG_CORE</title>
<updated>2016-03-30T12:20:33Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2016-03-23T19:47:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8dcf32175b4e1817ea037a051f10dd7823e52344'/>
<id>urn:sha1:8dcf32175b4e1817ea037a051f10dd7823e52344</id>
<content type='text'>
Jan reported this:

===
After enabling CONFIG_I2C_DEBUG_CORE my system was broken
(no network, console login not possible). System log was
flooded with the this message:

 ...
[  608.052077] rtc-ds1307 0-0068: uevent
[  608.052500] rtc-ds1307 0-0068: uevent
[  608.052925] rtc-ds1307 0-0068: uevent
 ...

The culprit is the dev_dbg printk in the i2c uevent handler.
If this is activated (for instance by CONFIG_I2C_DEBUG_CORE)
it results in an endless loop with systemd-journald.

This happens if user-space scans the system log and reads the uevent
file to get information about a newly created device, which seems fair
use to me. Unfortunately reading the "uevent" file uses the same
function that runs for creating the uevent for a new device,
generating the next syslog entry.

Ideally user-space would implement a recursion detection and
after reading the same device file for the 1000th time call it a
day, but nevertheless I think we should avoid this problem by
removing the debug print completely or using another print variant.

The same problem seems to be reported here:
https://bugs.freedesktop.org/show_bug.cgi?id=76886
===

His patch converted the message to pr_debug, but I think the debug can
simply go. We have other means to see code paths these days. This
enables us to clean up the function some more while we are here.

Reported-by: Jan Glauber &lt;jglauber@cavium.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Acked-by: Alexander Sverdlin &lt;alexander.sverdlin@nokia.com&gt;
Tested-by: Jan Glauber &lt;jglauber@cavium.com&gt;
</content>
</entry>
</feed>
