<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/i2c, branch v3.17-rc4</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>Revert "i2c: rcar: remove spinlock"</title>
<updated>2014-09-04T17:59:42+00:00</updated>
<author>
<name>Sergei Shtylyov</name>
<email>sergei.shtylyov@cogentembedded.com</email>
</author>
<published>2014-08-23T20:44:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=91bfe2989af02e709ca01ccf518c4fbda3efc70f'/>
<id>91bfe2989af02e709ca01ccf518c4fbda3efc70f</id>
<content type='text'>
This reverts commit 150b8be3cda54412ad7b54f5392b513b25c0aaa7.

The I2C core's per-adapter locks can't protect from IRQs, so the driver still
needs a spinlock to protect the register accesses.

Signed-off-by: Sergei Shtylyov &lt;sergei.shtylyov@cogentembedded.com&gt;
Cc: stable@vger.kernel.org # 3.16+
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 150b8be3cda54412ad7b54f5392b513b25c0aaa7.

The I2C core's per-adapter locks can't protect from IRQs, so the driver still
needs a spinlock to protect the register accesses.

Signed-off-by: Sergei Shtylyov &lt;sergei.shtylyov@cogentembedded.com&gt;
Cc: stable@vger.kernel.org # 3.16+
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: at91: add bound checking on SMBus block length bytes</title>
<updated>2014-09-02T12:29:33+00:00</updated>
<author>
<name>Marek Roszko</name>
<email>mark.roszko@gmail.com</email>
</author>
<published>2014-08-21T01:39:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=75b81f339c6af43f6f4a1b3eabe0603321dade65'/>
<id>75b81f339c6af43f6f4a1b3eabe0603321dade65</id>
<content type='text'>
The driver was not bound checking the received length byte to ensure it was within the
the buffer size that is allocated for SMBus blocks. This resulted in buffer overflows
whenever an invalid length byte was received.
It also failed to ensure the length byte was not zero. If it received zero, it would end up
in an infinite loop as the at91_twi_read_next_byte function returned immediately without
allowing RHR to be read to clear the RXRDY interrupt.

Tested agaisnt a SMBus compliant battery.

Signed-off-by: Marek Roszko &lt;mark.roszko@gmail.com&gt;
Acked-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: stable@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The driver was not bound checking the received length byte to ensure it was within the
the buffer size that is allocated for SMBus blocks. This resulted in buffer overflows
whenever an invalid length byte was received.
It also failed to ensure the length byte was not zero. If it received zero, it would end up
in an infinite loop as the at91_twi_read_next_byte function returned immediately without
allowing RHR to be read to clear the RXRDY interrupt.

Tested agaisnt a SMBus compliant battery.

Signed-off-by: Marek Roszko &lt;mark.roszko@gmail.com&gt;
Acked-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: stable@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: rk3x: fix bug that cause transfer fails in master receive mode</title>
<updated>2014-09-02T12:29:28+00:00</updated>
<author>
<name>addy ke</name>
<email>addy.ke@rock-chips.com</email>
</author>
<published>2014-08-22T18:00:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5da4309f9e1b4de9c2b69e917912fbb84006d44e'/>
<id>5da4309f9e1b4de9c2b69e917912fbb84006d44e</id>
<content type='text'>
In rk3x SOC, the I2C controller can receive/transmit up to 32 bytes data
in one chunk, so the size of data to be write/read to/from TXDATAx/RXDATAx
must be less than or equal 32 bytes at a time.

Tested on rk3288-pinky board, elan receive 158 bytes data.

Signed-off-by: Addy Ke &lt;addy.ke@rock-chips.com&gt;
Acked-by: Max Schwarz &lt;max.schwarz@online.de&gt;
Reviewed-by: Doug Anderson &lt;dianders@chromium.org&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: stable@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In rk3x SOC, the I2C controller can receive/transmit up to 32 bytes data
in one chunk, so the size of data to be write/read to/from TXDATAx/RXDATAx
must be less than or equal 32 bytes at a time.

Tested on rk3288-pinky board, elan receive 158 bytes data.

Signed-off-by: Addy Ke &lt;addy.ke@rock-chips.com&gt;
Acked-by: Max Schwarz &lt;max.schwarz@online.de&gt;
Reviewed-by: Doug Anderson &lt;dianders@chromium.org&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: stable@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: at91: Fix a race condition during signal handling in at91_do_twi_xfer.</title>
<updated>2014-09-02T12:29:20+00:00</updated>
<author>
<name>Simon Lindgren</name>
<email>simon@aqwary.com</email>
</author>
<published>2014-08-26T19:13:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6721f28a26efd6368497abbdef5dcfc59608d899'/>
<id>6721f28a26efd6368497abbdef5dcfc59608d899</id>
<content type='text'>
There is a race condition in at91_do_twi_xfer when signals arrive.
If a signal is recieved while waiting for a transfer to complete
wait_for_completion_interruptible_timeout() will return -ERESTARTSYS.
This is not handled correctly resulting in interrupts still being
enabled and a transfer being in flight when we return.

Symptoms include a range of oopses and bus lockups. Oopses can happen
when the transfer completes because the interrupt handler will corrupt
the stack. If a new transfer is started before the interrupt fires
the controller will start a new transfer in the middle of the old one,
resulting in confused slaves and a locked bus.

To avoid this, use wait_for_completion_io_timeout instead so that we
don't have to deal with gracefully shutting down the transfer and
disabling the interrupts.

Signed-off-by: Simon Lindgren &lt;simon@aqwary.com&gt;
Acked-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: stable@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is a race condition in at91_do_twi_xfer when signals arrive.
If a signal is recieved while waiting for a transfer to complete
wait_for_completion_interruptible_timeout() will return -ERESTARTSYS.
This is not handled correctly resulting in interrupts still being
enabled and a transfer being in flight when we return.

Symptoms include a range of oopses and bus lockups. Oopses can happen
when the transfer completes because the interrupt handler will corrupt
the stack. If a new transfer is started before the interrupt fires
the controller will start a new transfer in the middle of the old one,
resulting in confused slaves and a locked bus.

To avoid this, use wait_for_completion_io_timeout instead so that we
don't have to deal with gracefully shutting down the transfer and
disabling the interrupts.

Signed-off-by: Simon Lindgren &lt;simon@aqwary.com&gt;
Acked-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: stable@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: mv64xxx: continue probe when clock-frequency is missing</title>
<updated>2014-09-02T10:34:08+00:00</updated>
<author>
<name>Chen-Yu Tsai</name>
<email>wens@csie.org</email>
</author>
<published>2014-09-01T14:28:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0ce4bc1dbdd911ae1763e2d4ff36bd1b214a59f7'/>
<id>0ce4bc1dbdd911ae1763e2d4ff36bd1b214a59f7</id>
<content type='text'>
The "clock-frequency" DT property is listed as optional, However,
the current code stores the return value of of_property_read_u32 in
the return code of mv64xxx_of_config, but then forgets to clear it
after setting the default value of "clock-frequency". It is then
passed out to the main probe function, resulting in a probe failure
when "clock-frequency" is missing.

This patch checks and then throws away the return value of
of_property_read_u32, instead of storing it and having to clear it
afterwards.

This issue was discovered after the property was removed from all
sunxi DTs.

Fixes: 4c730a06c19bb ("i2c: mv64xxx: Set bus frequency to 100kHz if clock-frequency is not provided")
Signed-off-by: Chen-Yu Tsai &lt;wens@csie.org&gt;
Cc: stable@vger.kernel.org
Acked-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Acked-by: Maxime Ripard &lt;maxime.ripard@free-electrons.com&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>
The "clock-frequency" DT property is listed as optional, However,
the current code stores the return value of of_property_read_u32 in
the return code of mv64xxx_of_config, but then forgets to clear it
after setting the default value of "clock-frequency". It is then
passed out to the main probe function, resulting in a probe failure
when "clock-frequency" is missing.

This patch checks and then throws away the return value of
of_property_read_u32, instead of storing it and having to clear it
afterwards.

This issue was discovered after the property was removed from all
sunxi DTs.

Fixes: 4c730a06c19bb ("i2c: mv64xxx: Set bus frequency to 100kHz if clock-frequency is not provided")
Signed-off-by: Chen-Yu Tsai &lt;wens@csie.org&gt;
Cc: stable@vger.kernel.org
Acked-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Acked-by: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: rcar: fix MNR interrupt handling</title>
<updated>2014-09-02T10:28:15+00:00</updated>
<author>
<name>Sergei Shtylyov</name>
<email>sergei.shtylyov@cogentembedded.com</email>
</author>
<published>2014-09-01T21:15:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=dd318b0df27c582ac0d72a346fd6e693700be23c'/>
<id>dd318b0df27c582ac0d72a346fd6e693700be23c</id>
<content type='text'>
Sometimes the MNR and MST interrupts happen simultaneously  (stop  automatically
follows NACK, according to the manuals) and in such case the ID_NACK flag  isn't
set since the MST interrupt handling precedes MNR and all interrupts are cleared
and disabled then, so that MNR interrupt is never noticed -- this causes NACK'ed
transfers to be falsely reported as successful. Exchanging MNR and  MST handlers
fixes this issue, however the MNR bit  somehow  gets set again even after  being
explicitly cleared, so I decided to completely suppress handling of all disabled
interrupts (which is a good thing anyway)...

Signed-off-by: Sergei Shtylyov &lt;sergei.shtylyov@cogentembedded.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sometimes the MNR and MST interrupts happen simultaneously  (stop  automatically
follows NACK, according to the manuals) and in such case the ID_NACK flag  isn't
set since the MST interrupt handling precedes MNR and all interrupts are cleared
and disabled then, so that MNR interrupt is never noticed -- this causes NACK'ed
transfers to be falsely reported as successful. Exchanging MNR and  MST handlers
fixes this issue, however the MNR bit  somehow  gets set again even after  being
explicitly cleared, so I decided to completely suppress handling of all disabled
interrupts (which is a good thing anyway)...

Signed-off-by: Sergei Shtylyov &lt;sergei.shtylyov@cogentembedded.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: i801: Add PCI ID for Intel Braswell</title>
<updated>2014-08-19T15:19:47+00:00</updated>
<author>
<name>Alan Cox</name>
<email>alan@linux.intel.com</email>
</author>
<published>2014-08-19T14:37:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=39e8e30ee544a62c148033d64a979028b958ca05'/>
<id>39e8e30ee544a62c148033d64a979028b958ca05</id>
<content type='text'>
The SMBus host controller is the same as used in Baytrail so add the new
PCI ID to the driver's list of supported IDs.

Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&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>
The SMBus host controller is the same as used in Baytrail so add the new
PCI ID to the driver's list of supported IDs.

Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: rework kernel config I2C_ACPI</title>
<updated>2014-08-19T15:19:39+00:00</updated>
<author>
<name>Lan Tianyu</name>
<email>tianyu.lan@intel.com</email>
</author>
<published>2014-08-15T05:38:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=366047515c6eab2ff886bc28d1c2b0ad041d040a'/>
<id>366047515c6eab2ff886bc28d1c2b0ad041d040a</id>
<content type='text'>
Commit da3c6647(I2C/ACPI: Clean up I2C ACPI code and Add CONFIG_I2C_ACPI
config) adds a new kernel config I2C_ACPI and make I2C core built in
when the config is selected. This is wrong because distributions
etc generally compile I2C as a module and the commit broken that.
This patch is to rename I2C_ACPI to ACPI_I2C_OPREGION. New config
only controls ACPI I2C operation region code and depends on I2C=y.

Signed-off-by: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Reviewed-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
[wsa: removed unrelated change for Kconfig]
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit da3c6647(I2C/ACPI: Clean up I2C ACPI code and Add CONFIG_I2C_ACPI
config) adds a new kernel config I2C_ACPI and make I2C core built in
when the config is selected. This is wrong because distributions
etc generally compile I2C as a module and the commit broken that.
This patch is to rename I2C_ACPI to ACPI_I2C_OPREGION. New config
only controls ACPI I2C operation region code and depends on I2C=y.

Signed-off-by: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Reviewed-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
[wsa: removed unrelated change for Kconfig]
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'i2c/for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux</title>
<updated>2014-08-09T16:15:07+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-08-09T16:15:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f7dbaef50558c08917a18f390c2609f253dc6659'/>
<id>f7dbaef50558c08917a18f390c2609f253dc6659</id>
<content type='text'>
Pull i2c updates from Wolfram Sang:
 "Highlights:

   - class based instantiation finally dropped for most embedded drivers
     bringing boot up performance gains
   - removed two drivers (one outdated, one a duplicate)
   - ACPI has now operation region support (thanks to Lan Tianyu)
   - the i2c-stub driver got overhauled and gained new features to
     become more useful when writing i2c client drivers (thanks to
     Guenter Roeck and Jean Delvare)

  The rest is driver bugfixes, added bindings/ids, cleanups..."

* 'i2c/for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (43 commits)
  i2c: mpc: delete unneeded test before of_node_put
  i2c: rk3x: fix interrupt handling issue
  i2c: imx: Fix format warning for dev_dbg
  i2c: qup: disable clks and return instead of just returning error
  i2c: exynos5: always enable HSI2C
  i2c: designware: add new bindings
  i2c: gpio: Drop dead code in i2c_gpio_remove
  i2c: pca954x: put the mux to disconnected state after resume
  i2c: st: Update i2c timings
  drivers/i2c/busses: use correct type for dma_map/unmap
  i2c: i2c-st: Use %pa to print 'resource_size_t' type
  i2c: s3c2410: resume the I2C controller earlier
  i2c: stub: Avoid an array overrun on I2C block transfers
  i2c: i801: Add device ID for Intel Wildcat Point PCH
  i2c: i801: Fix the alignment of the device table
  i2c: stub: Add support for banked register ranges
  i2c: stub: Remember the number of emulated chips
  i2c: stub: Add support for SMBus block commands
  i2c: efm32: correct namespacing of location property
  i2c: exynos5: remove extra line and fix an assignment
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull i2c updates from Wolfram Sang:
 "Highlights:

   - class based instantiation finally dropped for most embedded drivers
     bringing boot up performance gains
   - removed two drivers (one outdated, one a duplicate)
   - ACPI has now operation region support (thanks to Lan Tianyu)
   - the i2c-stub driver got overhauled and gained new features to
     become more useful when writing i2c client drivers (thanks to
     Guenter Roeck and Jean Delvare)

  The rest is driver bugfixes, added bindings/ids, cleanups..."

* 'i2c/for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (43 commits)
  i2c: mpc: delete unneeded test before of_node_put
  i2c: rk3x: fix interrupt handling issue
  i2c: imx: Fix format warning for dev_dbg
  i2c: qup: disable clks and return instead of just returning error
  i2c: exynos5: always enable HSI2C
  i2c: designware: add new bindings
  i2c: gpio: Drop dead code in i2c_gpio_remove
  i2c: pca954x: put the mux to disconnected state after resume
  i2c: st: Update i2c timings
  drivers/i2c/busses: use correct type for dma_map/unmap
  i2c: i2c-st: Use %pa to print 'resource_size_t' type
  i2c: s3c2410: resume the I2C controller earlier
  i2c: stub: Avoid an array overrun on I2C block transfers
  i2c: i801: Add device ID for Intel Wildcat Point PCH
  i2c: i801: Fix the alignment of the device table
  i2c: stub: Add support for banked register ranges
  i2c: stub: Remember the number of emulated chips
  i2c: stub: Add support for SMBus block commands
  i2c: efm32: correct namespacing of location property
  i2c: exynos5: remove extra line and fix an assignment
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: mpc: delete unneeded test before of_node_put</title>
<updated>2014-08-08T16:45:30+00:00</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@lip6.fr</email>
</author>
<published>2014-08-08T10:07:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ebba48b702ab11bbb76e357a7246bc2f19ad02bc'/>
<id>ebba48b702ab11bbb76e357a7246bc2f19ad02bc</id>
<content type='text'>
Of_node_put supports NULL as its argument, so the initial test is not
necessary.

Suggested by Uwe Kleine-König.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// &lt;smpl&gt;
@@
expression e;
@@

-if (e)
   of_node_put(e);
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&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>
Of_node_put supports NULL as its argument, so the initial test is not
necessary.

Suggested by Uwe Kleine-König.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// &lt;smpl&gt;
@@
expression e;
@@

-if (e)
   of_node_put(e);
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
