<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/i2c, branch v3.10.31</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>i2c: i801: SMBus patch for Intel Coleto Creek DeviceIDs</title>
<updated>2014-02-13T21:48:03+00:00</updated>
<author>
<name>Seth Heasley</name>
<email>seth.heasley@intel.com</email>
</author>
<published>2013-06-19T23:59:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1505c0baa0a8e3dc311a90b25eb24cc46b0894ea'/>
<id>1505c0baa0a8e3dc311a90b25eb24cc46b0894ea</id>
<content type='text'>
commit f39901c1befa556bc91902516a3e2e460000b4a8 upstream.

This patch adds the i801 SMBus Controller DeviceIDs for the Intel Coleto Creek PCH.

Signed-off-by: Seth Heasley &lt;seth.heasley@intel.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: "Chan, Wei Sern" &lt;wei.sern.chan@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit f39901c1befa556bc91902516a3e2e460000b4a8 upstream.

This patch adds the i801 SMBus Controller DeviceIDs for the Intel Coleto Creek PCH.

Signed-off-by: Seth Heasley &lt;seth.heasley@intel.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: "Chan, Wei Sern" &lt;wei.sern.chan@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: mux: gpio: use gpio_set_value_cansleep()</title>
<updated>2013-12-04T18:55:50+00:00</updated>
<author>
<name>Ionut Nicu</name>
<email>ioan.nicu.ext@nsn.com</email>
</author>
<published>2013-10-11T12:17:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d9d317655d19d5cb583333e5643b0ada4ef5b48e'/>
<id>d9d317655d19d5cb583333e5643b0ada4ef5b48e</id>
<content type='text'>
commit 250ad590d6f12d93f4d85be305b0a598d609232e upstream.

Some gpio chips may have get/set operations that
can sleep. gpio_set_value() only works for chips
which do not sleep, for the others we will get a
kernel warning. Using gpio_set_value_cansleep()
will work for both chips that do sleep and those
who don't.

Signed-off-by: Ionut Nicu &lt;ioan.nicu.ext@nsn.com&gt;
Acked-by: Peter Korsgaard &lt;peter.korsgaard@barco.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 250ad590d6f12d93f4d85be305b0a598d609232e upstream.

Some gpio chips may have get/set operations that
can sleep. gpio_set_value() only works for chips
which do not sleep, for the others we will get a
kernel warning. Using gpio_set_value_cansleep()
will work for both chips that do sleep and those
who don't.

Signed-off-by: Ionut Nicu &lt;ioan.nicu.ext@nsn.com&gt;
Acked-by: Peter Korsgaard &lt;peter.korsgaard@barco.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: mux: gpio: use reg value for i2c_add_mux_adapter</title>
<updated>2013-12-04T18:55:50+00:00</updated>
<author>
<name>Ionut Nicu</name>
<email>ioan.nicu.ext@nsn.com</email>
</author>
<published>2013-10-11T10:09:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=12ea4499abf3cabc3dcea7efed13d15b99930405'/>
<id>12ea4499abf3cabc3dcea7efed13d15b99930405</id>
<content type='text'>
commit 8c0ec2500eeb89749341884a972860d7f9e56f9c upstream.

The i2c-mux driver requires that the chan_id parameter
passed to the i2c_add_mux_adapter() function is equal
to the reg value for that adapter:

for_each_child_of_node(mux_dev-&gt;of_node, child) {
	ret = of_property_read_u32(child, "reg", &amp;reg);
	if (ret)
		continue;
	if (chan_id == reg) {
		priv-&gt;adap.dev.of_node = child;
		break;
	}
}

The i2c-mux-gpio driver uses an internal logical index
for chan_id when calling i2c_add_mux_adapter() instead
of using the reg value.

Because of this, there will problems in selecting the
right adapter when the i2c-mux-gpio's index into
mux-&gt;data.values doesn't match the reg value.

An example of such a case:

mux-&gt;data.values = { 1, 0 }

For chan_id = 0, i2c-mux will bind the adapter to the
of_node with reg = &lt;0&gt;, but when it will call the
select() callback with chan_id set to 0, the i2c-mux-gpio
will use it as an index into mux-&gt;data.values and it will
actually select the bus with reg = &lt;1&gt;.

Signed-off-by: Ionut Nicu &lt;ioan.nicu.ext@nsn.com&gt;
Acked-by: Alexander Sverdlin &lt;alexander.sverdlin@nsn.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 8c0ec2500eeb89749341884a972860d7f9e56f9c upstream.

The i2c-mux driver requires that the chan_id parameter
passed to the i2c_add_mux_adapter() function is equal
to the reg value for that adapter:

for_each_child_of_node(mux_dev-&gt;of_node, child) {
	ret = of_property_read_u32(child, "reg", &amp;reg);
	if (ret)
		continue;
	if (chan_id == reg) {
		priv-&gt;adap.dev.of_node = child;
		break;
	}
}

The i2c-mux-gpio driver uses an internal logical index
for chan_id when calling i2c_add_mux_adapter() instead
of using the reg value.

Because of this, there will problems in selecting the
right adapter when the i2c-mux-gpio's index into
mux-&gt;data.values doesn't match the reg value.

An example of such a case:

mux-&gt;data.values = { 1, 0 }

For chan_id = 0, i2c-mux will bind the adapter to the
of_node with reg = &lt;0&gt;, but when it will call the
select() callback with chan_id set to 0, the i2c-mux-gpio
will use it as an index into mux-&gt;data.values and it will
actually select the bus with reg = &lt;1&gt;.

Signed-off-by: Ionut Nicu &lt;ioan.nicu.ext@nsn.com&gt;
Acked-by: Alexander Sverdlin &lt;alexander.sverdlin@nsn.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: ismt: initialize DMA buffer</title>
<updated>2013-11-04T12:31:06+00:00</updated>
<author>
<name>James Ralston</name>
<email>james.d.ralston@intel.com</email>
</author>
<published>2013-09-24T23:47:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fe0051d83cb951fbeab6712633ca2e31de22ee11'/>
<id>fe0051d83cb951fbeab6712633ca2e31de22ee11</id>
<content type='text'>
commit bf4169100c909667ede6af67668b3ecce6928343 upstream.

This patch adds code to initialize the DMA buffer to compensate for
possible hardware data corruption.

Signed-off-by: James Ralston &lt;james.d.ralston@intel.com&gt;
[wsa: changed to use 'sizeof']
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: Jean Delvare &lt;jdelvare@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit bf4169100c909667ede6af67668b3ecce6928343 upstream.

This patch adds code to initialize the DMA buffer to compensate for
possible hardware data corruption.

Signed-off-by: James Ralston &lt;james.d.ralston@intel.com&gt;
[wsa: changed to use 'sizeof']
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: Jean Delvare &lt;jdelvare@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: omap: Clear ARDY bit twice</title>
<updated>2013-10-18T14:45:44+00:00</updated>
<author>
<name>Taras Kondratiuk</name>
<email>taras.kondratiuk@linaro.org</email>
</author>
<published>2013-10-07T10:41:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fafd39123416e56bf782e323031e6fdd18b61d60'/>
<id>fafd39123416e56bf782e323031e6fdd18b61d60</id>
<content type='text'>
commit 4cdbf7d346e7461c3b93a26707c852e2c9db3753 upstream.

Initially commit cb527ede1bf6ff2008a025606f25344b8ed7b4ac
"i2c-omap: Double clear of ARDY status in IRQ handler"
added a workaround for undocumented errata ProDB0017052.
But then commit 1d7afc95946487945cc7f5019b41255b72224b70
"i2c: omap: ack IRQ in parts" refactored code and missed
one of ARDY clearings. So current code violates errata.
It causes often i2c bus timeouts on my Pandaboard.

This patch adds a second clearing in place.

Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Signed-off-by: Taras Kondratiuk &lt;taras.kondratiuk@linaro.org&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 4cdbf7d346e7461c3b93a26707c852e2c9db3753 upstream.

Initially commit cb527ede1bf6ff2008a025606f25344b8ed7b4ac
"i2c-omap: Double clear of ARDY status in IRQ handler"
added a workaround for undocumented errata ProDB0017052.
But then commit 1d7afc95946487945cc7f5019b41255b72224b70
"i2c: omap: ack IRQ in parts" refactored code and missed
one of ARDY clearings. So current code violates errata.
It causes often i2c bus timeouts on my Pandaboard.

This patch adds a second clearing in place.

Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Signed-off-by: Taras Kondratiuk &lt;taras.kondratiuk@linaro.org&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: i2c-mxs: Use DMA mode even for small transfers</title>
<updated>2013-08-15T05:59:06+00:00</updated>
<author>
<name>Fabio Estevam</name>
<email>fabio.estevam@freescale.com</email>
</author>
<published>2013-07-01T21:14:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=060a7c36d7ba82d7f520d7f328db5d38e99c20a4'/>
<id>060a7c36d7ba82d7f520d7f328db5d38e99c20a4</id>
<content type='text'>
commit d6e102f498cbcc8dd2e36721a01213f036397112 upstream.

Recently we have been seing some reports about PIO mode not working properly.

- http://www.spinics.net/lists/linux-i2c/msg11985.html
- http://marc.info/?l=linux-i2c&amp;m=137235593101385&amp;w=2
- https://lkml.org/lkml/2013/6/24/430

Let's use DMA mode even for small transfers.

Without this patch, i2c reads the incorrect sgtl5000 version on a mx28evk when
touchscreen is enabled:

[    5.856270] sgtl5000 0-000a: Device with ID register 0 is not a sgtl5000
[    9.877307] sgtl5000 0-000a: ASoC: failed to probe CODEC -19
[    9.883528] mxs-sgtl5000 sound.12: ASoC: failed to instantiate card -19
[    9.892955] mxs-sgtl5000 sound.12: snd_soc_register_card failed (-19)

[wsa: we have a proper solution for -next, so this non intrusive
solution is OK for now]

Signed-off-by: Fabio Estevam &lt;fabio.estevam@freescale.com&gt;
Acked-by: Shawn Guo &lt;shawn.guo@linaro.org&gt;
Acked-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Acked-by: Marek Vasut &lt;marex@denx.de&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit d6e102f498cbcc8dd2e36721a01213f036397112 upstream.

Recently we have been seing some reports about PIO mode not working properly.

- http://www.spinics.net/lists/linux-i2c/msg11985.html
- http://marc.info/?l=linux-i2c&amp;m=137235593101385&amp;w=2
- https://lkml.org/lkml/2013/6/24/430

Let's use DMA mode even for small transfers.

Without this patch, i2c reads the incorrect sgtl5000 version on a mx28evk when
touchscreen is enabled:

[    5.856270] sgtl5000 0-000a: Device with ID register 0 is not a sgtl5000
[    9.877307] sgtl5000 0-000a: ASoC: failed to probe CODEC -19
[    9.883528] mxs-sgtl5000 sound.12: ASoC: failed to instantiate card -19
[    9.892955] mxs-sgtl5000 sound.12: snd_soc_register_card failed (-19)

[wsa: we have a proper solution for -next, so this non intrusive
solution is OK for now]

Signed-off-by: Fabio Estevam &lt;fabio.estevam@freescale.com&gt;
Acked-by: Shawn Guo &lt;shawn.guo@linaro.org&gt;
Acked-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Acked-by: Marek Vasut &lt;marex@denx.de&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>i2c-piix4: Add AMD CZ SMBus device ID</title>
<updated>2013-07-25T21:07:28+00:00</updated>
<author>
<name>Shane Huang</name>
<email>shane.huang@amd.com</email>
</author>
<published>2013-06-03T10:24:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5ebc73095cf30bca82ef2983a46756ff26b1a810'/>
<id>5ebc73095cf30bca82ef2983a46756ff26b1a810</id>
<content type='text'>
commit b996ac90f595dda271cbd858b136b45557fc1a57 upstream.

To add AMD CZ SMBus controller device ID.

[bhelgaas: drop pci_ids.h update]
Signed-off-by: Shane Huang &lt;shane.huang@amd.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: Jean Delvare &lt;khali@linux-fr.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit b996ac90f595dda271cbd858b136b45557fc1a57 upstream.

To add AMD CZ SMBus controller device ID.

[bhelgaas: drop pci_ids.h update]
Signed-off-by: Shane Huang &lt;shane.huang@amd.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: Jean Delvare &lt;khali@linux-fr.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux</title>
<updated>2013-05-21T18:11:45+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-05-21T18:11:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e748a38596932af8632448f35e8b2bba714ae03d'/>
<id>e748a38596932af8632448f35e8b2bba714ae03d</id>
<content type='text'>
Pull i2c bugfixes from Wolfram Sang:
 "These should have been in rc2 but I missed it due to working on devm
  longer than expected.

  There is one ID addition, since we are touching the driver anyhow.
  And the feature bit documentation is one outcome of a debug session
  and will make it easier for users to work around problems.  The rest
  is typical driver bugfixes."

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: suppress lockdep warning on delete_device
  i2c: mv64xxx: work around signals causing I2C transactions to be aborted
  i2c: i801: Document feature bits in modinfo
  i2c: designware: add Intel BayTrail ACPI ID
  i2c: designware: always clear interrupts before enabling them
  i2c: designware: fix RX FIFO overrun
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull i2c bugfixes from Wolfram Sang:
 "These should have been in rc2 but I missed it due to working on devm
  longer than expected.

  There is one ID addition, since we are touching the driver anyhow.
  And the feature bit documentation is one outcome of a debug session
  and will make it easier for users to work around problems.  The rest
  is typical driver bugfixes."

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: suppress lockdep warning on delete_device
  i2c: mv64xxx: work around signals causing I2C transactions to be aborted
  i2c: i801: Document feature bits in modinfo
  i2c: designware: add Intel BayTrail ACPI ID
  i2c: designware: always clear interrupts before enabling them
  i2c: designware: fix RX FIFO overrun
</pre>
</div>
</content>
</entry>
<entry>
<title>drivers/i2c/busses: don't check resource with devm_ioremap_resource</title>
<updated>2013-05-18T09:55:32+00:00</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2013-05-12T13:19:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=00d083f928a37199e0fac984845bfd8b3587238e'/>
<id>00d083f928a37199e0fac984845bfd8b3587238e</id>
<content type='text'>
devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Acked-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Barry Song &lt;Baohua.Song@csr.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Acked-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Acked-by: Barry Song &lt;Baohua.Song@csr.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: suppress lockdep warning on delete_device</title>
<updated>2013-05-17T20:49:45+00:00</updated>
<author>
<name>Alexander Sverdlin</name>
<email>alexander.sverdlin@nsn.com</email>
</author>
<published>2013-05-17T12:56:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e9b526fe704812364bca07edd15eadeba163ebfb'/>
<id>e9b526fe704812364bca07edd15eadeba163ebfb</id>
<content type='text'>
i2c: suppress lockdep warning on delete_device

Since commit 846f99749ab68bbc7f75c74fec305de675b1a1bf the following lockdep
warning is thrown in case i2c device is removed (via delete_device sysfs
attribute) which contains subdevices (e.g. i2c multiplexer):

=============================================
[ INFO: possible recursive locking detected ]
3.8.7-0-sampleversion-fct #8 Tainted: G           O
---------------------------------------------
bash/3743 is trying to acquire lock:
  (s_active#110){++++.+}, at: [&lt;ffffffff802b3048&gt;] sysfs_hash_and_remove+0x58/0xc8

but task is already holding lock:
  (s_active#110){++++.+}, at: [&lt;ffffffff802b3cb8&gt;] sysfs_write_file+0xc8/0x208

other info that might help us debug this:
  Possible unsafe locking scenario:

        CPU0
        ----
   lock(s_active#110);
   lock(s_active#110);

  *** DEADLOCK ***

  May be due to missing lock nesting notation

4 locks held by bash/3743:
  #0:  (&amp;buffer-&gt;mutex){+.+.+.}, at: [&lt;ffffffff802b3c3c&gt;] sysfs_write_file+0x4c/0x208
  #1:  (s_active#110){++++.+}, at: [&lt;ffffffff802b3cb8&gt;] sysfs_write_file+0xc8/0x208
  #2:  (&amp;adap-&gt;userspace_clients_lock/1){+.+.+.}, at: [&lt;ffffffff80454a18&gt;] i2c_sysfs_delete_device+0x90/0x238
  #3:  (&amp;__lockdep_no_validate__){......}, at: [&lt;ffffffff803dcc24&gt;] device_release_driver+0x24/0x48

stack backtrace:
Call Trace:
[&lt;ffffffff80575cc8&gt;] dump_stack+0x8/0x34
[&lt;ffffffff801b50fc&gt;] __lock_acquire+0x161c/0x2110
[&lt;ffffffff801b5c3c&gt;] lock_acquire+0x4c/0x70
[&lt;ffffffff802b60cc&gt;] sysfs_addrm_finish+0x19c/0x1e0
[&lt;ffffffff802b3048&gt;] sysfs_hash_and_remove+0x58/0xc8
[&lt;ffffffff802b7d8c&gt;] sysfs_remove_group+0x64/0x148
[&lt;ffffffff803d990c&gt;] device_remove_attrs+0x9c/0x1a8
[&lt;ffffffff803d9b1c&gt;] device_del+0x104/0x1d8
[&lt;ffffffff803d9c18&gt;] device_unregister+0x28/0x70
[&lt;ffffffff8045505c&gt;] i2c_del_adapter+0x1cc/0x328
[&lt;ffffffff8045802c&gt;] i2c_del_mux_adapter+0x14/0x38
[&lt;ffffffffc025c108&gt;] pca954x_remove+0x90/0xe0 [pca954x]
[&lt;ffffffff804542f8&gt;] i2c_device_remove+0x80/0xe8
[&lt;ffffffff803dca9c&gt;] __device_release_driver+0x74/0xf8
[&lt;ffffffff803dcc2c&gt;] device_release_driver+0x2c/0x48
[&lt;ffffffff803dbc14&gt;] bus_remove_device+0x13c/0x1d8
[&lt;ffffffff803d9b24&gt;] device_del+0x10c/0x1d8
[&lt;ffffffff803d9c18&gt;] device_unregister+0x28/0x70
[&lt;ffffffff80454b08&gt;] i2c_sysfs_delete_device+0x180/0x238
[&lt;ffffffff802b3cd4&gt;] sysfs_write_file+0xe4/0x208
[&lt;ffffffff8023ddc4&gt;] vfs_write+0xbc/0x160
[&lt;ffffffff8023df6c&gt;] SyS_write+0x54/0xd8
[&lt;ffffffff8013d424&gt;] handle_sys64+0x44/0x64

The problem is already known for USB and PCI subsystems. The reason is that
delete_device attribute is defined statically in i2c-core.c and used for all
devices in i2c subsystem.

Discussion of original USB problem:
http://lkml.indiana.edu/hypermail/linux/kernel/1204.3/01160.html

Commit 356c05d58af05d582e634b54b40050c73609617b introduced new macro to suppress
lockdep warnings for this special case and included workaround for USB code.

LKML discussion of the workaround:
http://lkml.indiana.edu/hypermail/linux/kernel/1205.1/03634.html

As i2c case is in principle the same, the same workaround could be used here.

Signed-off-by: Alexander Sverdlin &lt;alexander.sverdlin@nsn.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
i2c: suppress lockdep warning on delete_device

Since commit 846f99749ab68bbc7f75c74fec305de675b1a1bf the following lockdep
warning is thrown in case i2c device is removed (via delete_device sysfs
attribute) which contains subdevices (e.g. i2c multiplexer):

=============================================
[ INFO: possible recursive locking detected ]
3.8.7-0-sampleversion-fct #8 Tainted: G           O
---------------------------------------------
bash/3743 is trying to acquire lock:
  (s_active#110){++++.+}, at: [&lt;ffffffff802b3048&gt;] sysfs_hash_and_remove+0x58/0xc8

but task is already holding lock:
  (s_active#110){++++.+}, at: [&lt;ffffffff802b3cb8&gt;] sysfs_write_file+0xc8/0x208

other info that might help us debug this:
  Possible unsafe locking scenario:

        CPU0
        ----
   lock(s_active#110);
   lock(s_active#110);

  *** DEADLOCK ***

  May be due to missing lock nesting notation

4 locks held by bash/3743:
  #0:  (&amp;buffer-&gt;mutex){+.+.+.}, at: [&lt;ffffffff802b3c3c&gt;] sysfs_write_file+0x4c/0x208
  #1:  (s_active#110){++++.+}, at: [&lt;ffffffff802b3cb8&gt;] sysfs_write_file+0xc8/0x208
  #2:  (&amp;adap-&gt;userspace_clients_lock/1){+.+.+.}, at: [&lt;ffffffff80454a18&gt;] i2c_sysfs_delete_device+0x90/0x238
  #3:  (&amp;__lockdep_no_validate__){......}, at: [&lt;ffffffff803dcc24&gt;] device_release_driver+0x24/0x48

stack backtrace:
Call Trace:
[&lt;ffffffff80575cc8&gt;] dump_stack+0x8/0x34
[&lt;ffffffff801b50fc&gt;] __lock_acquire+0x161c/0x2110
[&lt;ffffffff801b5c3c&gt;] lock_acquire+0x4c/0x70
[&lt;ffffffff802b60cc&gt;] sysfs_addrm_finish+0x19c/0x1e0
[&lt;ffffffff802b3048&gt;] sysfs_hash_and_remove+0x58/0xc8
[&lt;ffffffff802b7d8c&gt;] sysfs_remove_group+0x64/0x148
[&lt;ffffffff803d990c&gt;] device_remove_attrs+0x9c/0x1a8
[&lt;ffffffff803d9b1c&gt;] device_del+0x104/0x1d8
[&lt;ffffffff803d9c18&gt;] device_unregister+0x28/0x70
[&lt;ffffffff8045505c&gt;] i2c_del_adapter+0x1cc/0x328
[&lt;ffffffff8045802c&gt;] i2c_del_mux_adapter+0x14/0x38
[&lt;ffffffffc025c108&gt;] pca954x_remove+0x90/0xe0 [pca954x]
[&lt;ffffffff804542f8&gt;] i2c_device_remove+0x80/0xe8
[&lt;ffffffff803dca9c&gt;] __device_release_driver+0x74/0xf8
[&lt;ffffffff803dcc2c&gt;] device_release_driver+0x2c/0x48
[&lt;ffffffff803dbc14&gt;] bus_remove_device+0x13c/0x1d8
[&lt;ffffffff803d9b24&gt;] device_del+0x10c/0x1d8
[&lt;ffffffff803d9c18&gt;] device_unregister+0x28/0x70
[&lt;ffffffff80454b08&gt;] i2c_sysfs_delete_device+0x180/0x238
[&lt;ffffffff802b3cd4&gt;] sysfs_write_file+0xe4/0x208
[&lt;ffffffff8023ddc4&gt;] vfs_write+0xbc/0x160
[&lt;ffffffff8023df6c&gt;] SyS_write+0x54/0xd8
[&lt;ffffffff8013d424&gt;] handle_sys64+0x44/0x64

The problem is already known for USB and PCI subsystems. The reason is that
delete_device attribute is defined statically in i2c-core.c and used for all
devices in i2c subsystem.

Discussion of original USB problem:
http://lkml.indiana.edu/hypermail/linux/kernel/1204.3/01160.html

Commit 356c05d58af05d582e634b54b40050c73609617b introduced new macro to suppress
lockdep warnings for this special case and included workaround for USB code.

LKML discussion of the workaround:
http://lkml.indiana.edu/hypermail/linux/kernel/1205.1/03634.html

As i2c case is in principle the same, the same workaround could be used here.

Signed-off-by: Alexander Sverdlin &lt;alexander.sverdlin@nsn.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
