<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/i2c, branch v5.2.19</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>i2c: riic: Clear NACK in tend isr</title>
<updated>2019-10-05T11:14:16+00:00</updated>
<author>
<name>Chris Brandt</name>
<email>chris.brandt@renesas.com</email>
</author>
<published>2019-09-26T12:19:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=bc3a3e7c695c56d1cbdc18fcf3d1d775e1ba1d60'/>
<id>bc3a3e7c695c56d1cbdc18fcf3d1d775e1ba1d60</id>
<content type='text'>
commit a71e2ac1f32097fbb2beab098687a7a95c84543e upstream.

The NACKF flag should be cleared in INTRIICNAKI interrupt processing as
description in HW manual.

This issue shows up quickly when PREEMPT_RT is applied and a device is
probed that is not plugged in (like a touchscreen controller). The result
is endless interrupts that halt system boot.

Fixes: 310c18a41450 ("i2c: riic: add driver")
Cc: stable@vger.kernel.org
Reported-by: Chien Nguyen &lt;chien.nguyen.eb@rvc.renesas.com&gt;
Signed-off-by: Chris Brandt &lt;chris.brandt@renesas.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 a71e2ac1f32097fbb2beab098687a7a95c84543e upstream.

The NACKF flag should be cleared in INTRIICNAKI interrupt processing as
description in HW manual.

This issue shows up quickly when PREEMPT_RT is applied and a device is
probed that is not plugged in (like a touchscreen controller). The result
is endless interrupts that halt system boot.

Fixes: 310c18a41450 ("i2c: riic: add driver")
Cc: stable@vger.kernel.org
Reported-by: Chien Nguyen &lt;chien.nguyen.eb@rvc.renesas.com&gt;
Signed-off-by: Chris Brandt &lt;chris.brandt@renesas.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: mediatek: disable zero-length transfers for mt8183</title>
<updated>2019-09-21T05:18:41+00:00</updated>
<author>
<name>Hsin-Yi Wang</name>
<email>hsinyi@chromium.org</email>
</author>
<published>2019-08-22T09:45:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8b7bf7b1b2dd51db61da06e5fa5823df7557d45a'/>
<id>8b7bf7b1b2dd51db61da06e5fa5823df7557d45a</id>
<content type='text'>
[ Upstream commit abf4923e97c3abbbd1e59f0e13c7c214c93c6aaa ]

Quoting from mt8183 datasheet, the number of transfers to be
transferred in one transaction should be set to bigger than 1,
so we should forbid zero-length transfer and update functionality.

Reported-by: Alexandru M Stan &lt;amstan@chromium.org&gt;
Signed-off-by: Hsin-Yi Wang &lt;hsinyi@chromium.org&gt;
Reviewed-by: Qii Wang &lt;qii.wang@mediatek.com&gt;
[wsa: shortened commit message a little]
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit abf4923e97c3abbbd1e59f0e13c7c214c93c6aaa ]

Quoting from mt8183 datasheet, the number of transfers to be
transferred in one transaction should be set to bigger than 1,
so we should forbid zero-length transfer and update functionality.

Reported-by: Alexandru M Stan &lt;amstan@chromium.org&gt;
Signed-off-by: Hsin-Yi Wang &lt;hsinyi@chromium.org&gt;
Reviewed-by: Qii Wang &lt;qii.wang@mediatek.com&gt;
[wsa: shortened commit message a little]
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: iproc: Stop advertising support of SMBUS quick cmd</title>
<updated>2019-09-21T05:18:41+00:00</updated>
<author>
<name>Lori Hikichi</name>
<email>lori.hikichi@broadcom.com</email>
</author>
<published>2019-08-08T03:37:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=316c15048f405002af720d7764c434d95d6cfca5'/>
<id>316c15048f405002af720d7764c434d95d6cfca5</id>
<content type='text'>
[ Upstream commit b3d604d405166edfd4e1e6053409b85008f4f56d ]

The driver does not support the SMBUS Quick command so remove the
flag that indicates that level of support.
By default the i2c_detect tool uses the quick command to try and
detect devices at some bus addresses.  If the quick command is used
then we will not detect the device, even though it is present.

Fixes: e6e5dd3566e0 (i2c: iproc: Add Broadcom iProc I2C Driver)
Signed-off-by: Lori Hikichi &lt;lori.hikichi@broadcom.com&gt;
Signed-off-by: Rayagonda Kokatanur &lt;rayagonda.kokatanur@broadcom.com&gt;
Reviewed-by: Ray Jui &lt;ray.jui@broadcom.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit b3d604d405166edfd4e1e6053409b85008f4f56d ]

The driver does not support the SMBUS Quick command so remove the
flag that indicates that level of support.
By default the i2c_detect tool uses the quick command to try and
detect devices at some bus addresses.  If the quick command is used
then we will not detect the device, even though it is present.

Fixes: e6e5dd3566e0 (i2c: iproc: Add Broadcom iProc I2C Driver)
Signed-off-by: Lori Hikichi &lt;lori.hikichi@broadcom.com&gt;
Signed-off-by: Rayagonda Kokatanur &lt;rayagonda.kokatanur@broadcom.com&gt;
Reviewed-by: Ray Jui &lt;ray.jui@broadcom.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: designware: Synchronize IRQs when unregistering slave client</title>
<updated>2019-09-21T05:18:40+00:00</updated>
<author>
<name>Jarkko Nikula</name>
<email>jarkko.nikula@linux.intel.com</email>
</author>
<published>2019-08-15T13:52:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1ffda54f0546c7931891b9e44a6dcf000bf0831d'/>
<id>1ffda54f0546c7931891b9e44a6dcf000bf0831d</id>
<content type='text'>
[ Upstream commit c486dcd2f1bbdd524a1e0149734b79e4ae329650 ]

Make sure interrupt handler i2c_dw_irq_handler_slave() has finished
before clearing the the dev-&gt;slave pointer in i2c_dw_unreg_slave().

There is possibility for a race if i2c_dw_irq_handler_slave() is running
on another CPU while clearing the dev-&gt;slave pointer.

Reported-by: Krzysztof Adamski &lt;krzysztof.adamski@nokia.com&gt;
Reported-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Jarkko Nikula &lt;jarkko.nikula@linux.intel.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit c486dcd2f1bbdd524a1e0149734b79e4ae329650 ]

Make sure interrupt handler i2c_dw_irq_handler_slave() has finished
before clearing the the dev-&gt;slave pointer in i2c_dw_unreg_slave().

There is possibility for a race if i2c_dw_irq_handler_slave() is running
on another CPU while clearing the dev-&gt;slave pointer.

Reported-by: Krzysztof Adamski &lt;krzysztof.adamski@nokia.com&gt;
Reported-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Jarkko Nikula &lt;jarkko.nikula@linux.intel.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: piix4: Fix port selection for AMD Family 16h Model 30h</title>
<updated>2019-09-06T08:23:46+00:00</updated>
<author>
<name>Andrew Cooks</name>
<email>andrew.cooks@opengear.com</email>
</author>
<published>2019-08-02T12:52:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3e3bf9dfdaf4e3c5c00faa77bf5feac64ca4a860'/>
<id>3e3bf9dfdaf4e3c5c00faa77bf5feac64ca4a860</id>
<content type='text'>
commit c7c06a1532f3fe106687ac82a13492c6a619ff1c upstream.

Family 16h Model 30h SMBus controller needs the same port selection fix
as described and fixed in commit 0fe16195f891 ("i2c: piix4: Fix SMBus port
selection for AMD Family 17h chips")

commit 6befa3fde65f ("i2c: piix4: Support alternative port selection
register") also fixed the port selection for Hudson2, but unfortunately
this is not the exact same device and the AMD naming and PCI Device IDs
aren't particularly helpful here.

The SMBus port selection register is common to the following Families
and models, as documented in AMD's publicly available BIOS and Kernel
Developer Guides:

 50742 - Family 15h Model 60h-6Fh (PCI_DEVICE_ID_AMD_KERNCZ_SMBUS)
 55072 - Family 15h Model 70h-7Fh (PCI_DEVICE_ID_AMD_KERNCZ_SMBUS)
 52740 - Family 16h Model 30h-3Fh (PCI_DEVICE_ID_AMD_HUDSON2_SMBUS)

The Hudson2 PCI Device ID (PCI_DEVICE_ID_AMD_HUDSON2_SMBUS) is shared
between Bolton FCH and Family 16h Model 30h, but the location of the
SmBus0Sel port selection bits are different:

 51192 - Bolton Register Reference Guide

We distinguish between Bolton and Family 16h Model 30h using the PCI
Revision ID:

  Bolton is device 0x780b, revision 0x15
  Family 16h Model 30h is device 0x780b, revision 0x1F
  Family 15h Model 60h and 70h are both device 0x790b, revision 0x4A.

The following additional public AMD BKDG documents were checked and do
not share the same port selection register:

 42301 - Family 15h Model 00h-0Fh doesn't mention any
 42300 - Family 15h Model 10h-1Fh doesn't mention any
 49125 - Family 15h Model 30h-3Fh doesn't mention any

 48751 - Family 16h Model 00h-0Fh uses the previously supported
         index register SB800_PIIX4_PORT_IDX_ALT at 0x2e

Signed-off-by: Andrew Cooks &lt;andrew.cooks@opengear.com&gt;
Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Cc: stable@vger.kernel.org [v4.6+]
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 c7c06a1532f3fe106687ac82a13492c6a619ff1c upstream.

Family 16h Model 30h SMBus controller needs the same port selection fix
as described and fixed in commit 0fe16195f891 ("i2c: piix4: Fix SMBus port
selection for AMD Family 17h chips")

commit 6befa3fde65f ("i2c: piix4: Support alternative port selection
register") also fixed the port selection for Hudson2, but unfortunately
this is not the exact same device and the AMD naming and PCI Device IDs
aren't particularly helpful here.

The SMBus port selection register is common to the following Families
and models, as documented in AMD's publicly available BIOS and Kernel
Developer Guides:

 50742 - Family 15h Model 60h-6Fh (PCI_DEVICE_ID_AMD_KERNCZ_SMBUS)
 55072 - Family 15h Model 70h-7Fh (PCI_DEVICE_ID_AMD_KERNCZ_SMBUS)
 52740 - Family 16h Model 30h-3Fh (PCI_DEVICE_ID_AMD_HUDSON2_SMBUS)

The Hudson2 PCI Device ID (PCI_DEVICE_ID_AMD_HUDSON2_SMBUS) is shared
between Bolton FCH and Family 16h Model 30h, but the location of the
SmBus0Sel port selection bits are different:

 51192 - Bolton Register Reference Guide

We distinguish between Bolton and Family 16h Model 30h using the PCI
Revision ID:

  Bolton is device 0x780b, revision 0x15
  Family 16h Model 30h is device 0x780b, revision 0x1F
  Family 15h Model 60h and 70h are both device 0x790b, revision 0x4A.

The following additional public AMD BKDG documents were checked and do
not share the same port selection register:

 42301 - Family 15h Model 00h-0Fh doesn't mention any
 42300 - Family 15h Model 10h-1Fh doesn't mention any
 49125 - Family 15h Model 30h-3Fh doesn't mention any

 48751 - Family 16h Model 00h-0Fh uses the previously supported
         index register SB800_PIIX4_PORT_IDX_ALT at 0x2e

Signed-off-by: Andrew Cooks &lt;andrew.cooks@opengear.com&gt;
Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Cc: stable@vger.kernel.org [v4.6+]
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: emev2: avoid race when unregistering slave client</title>
<updated>2019-09-06T08:23:25+00:00</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa+renesas@sang-engineering.com</email>
</author>
<published>2019-08-08T19:54:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=7046212603e0689f9155f70923a5b9e6608eaaeb'/>
<id>7046212603e0689f9155f70923a5b9e6608eaaeb</id>
<content type='text'>
[ Upstream commit d7437fc0d8291181debe032671a289b6bd93f46f ]

After we disabled interrupts, there might still be an active one
running. Sync before clearing the pointer to the slave device.

Fixes: c31d0a00021d ("i2c: emev2: add slave support")
Reported-by: Krzysztof Adamski &lt;krzysztof.adamski@nokia.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Reviewed-by: Krzysztof Adamski &lt;krzysztof.adamski@nokia.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit d7437fc0d8291181debe032671a289b6bd93f46f ]

After we disabled interrupts, there might still be an active one
running. Sync before clearing the pointer to the slave device.

Fixes: c31d0a00021d ("i2c: emev2: add slave support")
Reported-by: Krzysztof Adamski &lt;krzysztof.adamski@nokia.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Reviewed-by: Krzysztof Adamski &lt;krzysztof.adamski@nokia.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: rcar: avoid race when unregistering slave client</title>
<updated>2019-09-06T08:23:24+00:00</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa+renesas@sang-engineering.com</email>
</author>
<published>2019-08-08T19:39:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=38869e74c3ac8bcc0300c02b39d4fdc4277353ca'/>
<id>38869e74c3ac8bcc0300c02b39d4fdc4277353ca</id>
<content type='text'>
[ Upstream commit 7b814d852af6944657c2961039f404c4490771c0 ]

After we disabled interrupts, there might still be an active one
running. Sync before clearing the pointer to the slave device.

Fixes: de20d1857dd6 ("i2c: rcar: add slave support")
Reported-by: Krzysztof Adamski &lt;krzysztof.adamski@nokia.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Reviewed-by: Krzysztof Adamski &lt;krzysztof.adamski@nokia.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 7b814d852af6944657c2961039f404c4490771c0 ]

After we disabled interrupts, there might still be an active one
running. Sync before clearing the pointer to the slave device.

Fixes: de20d1857dd6 ("i2c: rcar: add slave support")
Reported-by: Krzysztof Adamski &lt;krzysztof.adamski@nokia.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Reviewed-by: Krzysztof Adamski &lt;krzysztof.adamski@nokia.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "i2c: imx: improve the error handling in i2c_imx_dma_request()"</title>
<updated>2019-08-25T14:10:24+00:00</updated>
<author>
<name>Fabio Estevam</name>
<email>festevam@gmail.com</email>
</author>
<published>2019-08-08T21:01:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2298d80121532d73b6216161c05cb4264ba854c1'/>
<id>2298d80121532d73b6216161c05cb4264ba854c1</id>
<content type='text'>
commit e8c220fac415d9f4a994b0c2871b835feac1eb4e upstream.

Since commit e1ab9a468e3b ("i2c: imx: improve the error handling in
i2c_imx_dma_request()") when booting with the DMA driver as module (such
as CONFIG_FSL_EDMA=m) the following endless clk warnings are seen:

[  153.077831] ------------[ cut here ]------------
[  153.082528] WARNING: CPU: 0 PID: 15 at drivers/clk/clk.c:924 clk_core_disable_lock+0x18/0x24
[  153.093077] i2c0 already disabled
[  153.096416] Modules linked in:
[  153.099521] CPU: 0 PID: 15 Comm: kworker/0:1 Tainted: G        W         5.2.0+ #321
[  153.107290] Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
[  153.113772] Workqueue: events deferred_probe_work_func
[  153.118979] [&lt;c0019560&gt;] (unwind_backtrace) from [&lt;c0014734&gt;] (show_stack+0x10/0x14)
[  153.126778] [&lt;c0014734&gt;] (show_stack) from [&lt;c083f8dc&gt;] (dump_stack+0x9c/0xd4)
[  153.134051] [&lt;c083f8dc&gt;] (dump_stack) from [&lt;c0031154&gt;] (__warn+0xf8/0x124)
[  153.141056] [&lt;c0031154&gt;] (__warn) from [&lt;c0031248&gt;] (warn_slowpath_fmt+0x38/0x48)
[  153.148580] [&lt;c0031248&gt;] (warn_slowpath_fmt) from [&lt;c040fde0&gt;] (clk_core_disable_lock+0x18/0x24)
[  153.157413] [&lt;c040fde0&gt;] (clk_core_disable_lock) from [&lt;c058f520&gt;] (i2c_imx_probe+0x554/0x6ec)
[  153.166076] [&lt;c058f520&gt;] (i2c_imx_probe) from [&lt;c04b9178&gt;] (platform_drv_probe+0x48/0x98)
[  153.174297] [&lt;c04b9178&gt;] (platform_drv_probe) from [&lt;c04b7298&gt;] (really_probe+0x1d8/0x2c0)
[  153.182605] [&lt;c04b7298&gt;] (really_probe) from [&lt;c04b7554&gt;] (driver_probe_device+0x5c/0x174)
[  153.190909] [&lt;c04b7554&gt;] (driver_probe_device) from [&lt;c04b58c8&gt;] (bus_for_each_drv+0x44/0x8c)
[  153.199480] [&lt;c04b58c8&gt;] (bus_for_each_drv) from [&lt;c04b746c&gt;] (__device_attach+0xa0/0x108)
[  153.207782] [&lt;c04b746c&gt;] (__device_attach) from [&lt;c04b65a4&gt;] (bus_probe_device+0x88/0x90)
[  153.215999] [&lt;c04b65a4&gt;] (bus_probe_device) from [&lt;c04b6a04&gt;] (deferred_probe_work_func+0x60/0x90)
[  153.225003] [&lt;c04b6a04&gt;] (deferred_probe_work_func) from [&lt;c004f190&gt;] (process_one_work+0x204/0x634)
[  153.234178] [&lt;c004f190&gt;] (process_one_work) from [&lt;c004f618&gt;] (worker_thread+0x20/0x484)
[  153.242315] [&lt;c004f618&gt;] (worker_thread) from [&lt;c0055c2c&gt;] (kthread+0x118/0x150)
[  153.249758] [&lt;c0055c2c&gt;] (kthread) from [&lt;c00090b4&gt;] (ret_from_fork+0x14/0x20)
[  153.257006] Exception stack(0xdde43fb0 to 0xdde43ff8)
[  153.262095] 3fa0:                                     00000000 00000000 00000000 00000000
[  153.270306] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  153.278520] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[  153.285159] irq event stamp: 3323022
[  153.288787] hardirqs last  enabled at (3323021): [&lt;c0861c4c&gt;] _raw_spin_unlock_irq+0x24/0x2c
[  153.297261] hardirqs last disabled at (3323022): [&lt;c040d7a0&gt;] clk_enable_lock+0x10/0x124
[  153.305392] softirqs last  enabled at (3322092): [&lt;c000a504&gt;] __do_softirq+0x344/0x540
[  153.313352] softirqs last disabled at (3322081): [&lt;c00385c0&gt;] irq_exit+0x10c/0x128
[  153.320946] ---[ end trace a506731ccd9bd703 ]---

This endless clk warnings behaviour is well explained by Andrey Smirnov:

"Allocating DMA after registering I2C adapter can lead to infinite
probing loop, for example, consider the following scenario:

    1. i2c_imx_probe() is called and successfully registers an I2C
       adapter via i2c_add_numbered_adapter()

    2. As a part of i2c_add_numbered_adapter() new I2C slave devices
       are added from DT which results in a call to
       driver_deferred_probe_trigger()

    3. i2c_imx_probe() continues and calls i2c_imx_dma_request() which
       due to lack of proper DMA driver returns -EPROBE_DEFER

    4. i2c_imx_probe() fails, removes I2C adapter and returns
       -EPROBE_DEFER, which places it into deferred probe list

    5. Deferred probe work triggered in #2 above kicks in and calls
       i2c_imx_probe() again thus bringing us to step #1"

So revert commit e1ab9a468e3b ("i2c: imx: improve the error handling in
i2c_imx_dma_request()") and restore the old behaviour, in order to
avoid regressions on existing setups.

Cc: &lt;stable@vger.kernel.org&gt;
Reported-by: Andrey Smirnov &lt;andrew.smirnov@gmail.com&gt;
Reported-by: Russell King &lt;linux@armlinux.org.uk&gt;
Fixes: e1ab9a468e3b ("i2c: imx: improve the error handling in i2c_imx_dma_request()")
Signed-off-by: Fabio Estevam &lt;festevam@gmail.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 e8c220fac415d9f4a994b0c2871b835feac1eb4e upstream.

Since commit e1ab9a468e3b ("i2c: imx: improve the error handling in
i2c_imx_dma_request()") when booting with the DMA driver as module (such
as CONFIG_FSL_EDMA=m) the following endless clk warnings are seen:

[  153.077831] ------------[ cut here ]------------
[  153.082528] WARNING: CPU: 0 PID: 15 at drivers/clk/clk.c:924 clk_core_disable_lock+0x18/0x24
[  153.093077] i2c0 already disabled
[  153.096416] Modules linked in:
[  153.099521] CPU: 0 PID: 15 Comm: kworker/0:1 Tainted: G        W         5.2.0+ #321
[  153.107290] Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
[  153.113772] Workqueue: events deferred_probe_work_func
[  153.118979] [&lt;c0019560&gt;] (unwind_backtrace) from [&lt;c0014734&gt;] (show_stack+0x10/0x14)
[  153.126778] [&lt;c0014734&gt;] (show_stack) from [&lt;c083f8dc&gt;] (dump_stack+0x9c/0xd4)
[  153.134051] [&lt;c083f8dc&gt;] (dump_stack) from [&lt;c0031154&gt;] (__warn+0xf8/0x124)
[  153.141056] [&lt;c0031154&gt;] (__warn) from [&lt;c0031248&gt;] (warn_slowpath_fmt+0x38/0x48)
[  153.148580] [&lt;c0031248&gt;] (warn_slowpath_fmt) from [&lt;c040fde0&gt;] (clk_core_disable_lock+0x18/0x24)
[  153.157413] [&lt;c040fde0&gt;] (clk_core_disable_lock) from [&lt;c058f520&gt;] (i2c_imx_probe+0x554/0x6ec)
[  153.166076] [&lt;c058f520&gt;] (i2c_imx_probe) from [&lt;c04b9178&gt;] (platform_drv_probe+0x48/0x98)
[  153.174297] [&lt;c04b9178&gt;] (platform_drv_probe) from [&lt;c04b7298&gt;] (really_probe+0x1d8/0x2c0)
[  153.182605] [&lt;c04b7298&gt;] (really_probe) from [&lt;c04b7554&gt;] (driver_probe_device+0x5c/0x174)
[  153.190909] [&lt;c04b7554&gt;] (driver_probe_device) from [&lt;c04b58c8&gt;] (bus_for_each_drv+0x44/0x8c)
[  153.199480] [&lt;c04b58c8&gt;] (bus_for_each_drv) from [&lt;c04b746c&gt;] (__device_attach+0xa0/0x108)
[  153.207782] [&lt;c04b746c&gt;] (__device_attach) from [&lt;c04b65a4&gt;] (bus_probe_device+0x88/0x90)
[  153.215999] [&lt;c04b65a4&gt;] (bus_probe_device) from [&lt;c04b6a04&gt;] (deferred_probe_work_func+0x60/0x90)
[  153.225003] [&lt;c04b6a04&gt;] (deferred_probe_work_func) from [&lt;c004f190&gt;] (process_one_work+0x204/0x634)
[  153.234178] [&lt;c004f190&gt;] (process_one_work) from [&lt;c004f618&gt;] (worker_thread+0x20/0x484)
[  153.242315] [&lt;c004f618&gt;] (worker_thread) from [&lt;c0055c2c&gt;] (kthread+0x118/0x150)
[  153.249758] [&lt;c0055c2c&gt;] (kthread) from [&lt;c00090b4&gt;] (ret_from_fork+0x14/0x20)
[  153.257006] Exception stack(0xdde43fb0 to 0xdde43ff8)
[  153.262095] 3fa0:                                     00000000 00000000 00000000 00000000
[  153.270306] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  153.278520] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[  153.285159] irq event stamp: 3323022
[  153.288787] hardirqs last  enabled at (3323021): [&lt;c0861c4c&gt;] _raw_spin_unlock_irq+0x24/0x2c
[  153.297261] hardirqs last disabled at (3323022): [&lt;c040d7a0&gt;] clk_enable_lock+0x10/0x124
[  153.305392] softirqs last  enabled at (3322092): [&lt;c000a504&gt;] __do_softirq+0x344/0x540
[  153.313352] softirqs last disabled at (3322081): [&lt;c00385c0&gt;] irq_exit+0x10c/0x128
[  153.320946] ---[ end trace a506731ccd9bd703 ]---

This endless clk warnings behaviour is well explained by Andrey Smirnov:

"Allocating DMA after registering I2C adapter can lead to infinite
probing loop, for example, consider the following scenario:

    1. i2c_imx_probe() is called and successfully registers an I2C
       adapter via i2c_add_numbered_adapter()

    2. As a part of i2c_add_numbered_adapter() new I2C slave devices
       are added from DT which results in a call to
       driver_deferred_probe_trigger()

    3. i2c_imx_probe() continues and calls i2c_imx_dma_request() which
       due to lack of proper DMA driver returns -EPROBE_DEFER

    4. i2c_imx_probe() fails, removes I2C adapter and returns
       -EPROBE_DEFER, which places it into deferred probe list

    5. Deferred probe work triggered in #2 above kicks in and calls
       i2c_imx_probe() again thus bringing us to step #1"

So revert commit e1ab9a468e3b ("i2c: imx: improve the error handling in
i2c_imx_dma_request()") and restore the old behaviour, in order to
avoid regressions on existing setups.

Cc: &lt;stable@vger.kernel.org&gt;
Reported-by: Andrey Smirnov &lt;andrew.smirnov@gmail.com&gt;
Reported-by: Russell King &lt;linux@armlinux.org.uk&gt;
Fixes: e1ab9a468e3b ("i2c: imx: improve the error handling in i2c_imx_dma_request()")
Signed-off-by: Fabio Estevam &lt;festevam@gmail.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: at91: fix clk_offset for sama5d2</title>
<updated>2019-08-06T17:08:17+00:00</updated>
<author>
<name>Michał Mirosław</name>
<email>mirq-linux@rere.qmqm.pl</email>
</author>
<published>2019-07-22T19:05:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d28fa78fd052e8950347e9aad771a6e5bc773972'/>
<id>d28fa78fd052e8950347e9aad771a6e5bc773972</id>
<content type='text'>
commit b1ac6704493fa14b5dc19eb6b69a73932361a131 upstream.

In SAMA5D2 datasheet, TWIHS_CWGR register rescription mentions clock
offset of 3 cycles (compared to 4 in eg. SAMA5D3).

Cc: stable@vger.kernel.org # 5.2.x
[needs applying to i2c-at91.c instead for earlier kernels]
Fixes: 0ef6f3213dac ("i2c: at91: add support for new alternative command mode")
Signed-off-by: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
Acked-by: Ludovic Desroches &lt;ludovic.desroches@microchip.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 b1ac6704493fa14b5dc19eb6b69a73932361a131 upstream.

In SAMA5D2 datasheet, TWIHS_CWGR register rescription mentions clock
offset of 3 cycles (compared to 4 in eg. SAMA5D3).

Cc: stable@vger.kernel.org # 5.2.x
[needs applying to i2c-at91.c instead for earlier kernels]
Fixes: 0ef6f3213dac ("i2c: at91: add support for new alternative command mode")
Signed-off-by: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
Acked-by: Ludovic Desroches &lt;ludovic.desroches@microchip.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: at91: disable TXRDY interrupt after sending data</title>
<updated>2019-08-06T17:08:17+00:00</updated>
<author>
<name>Michał Mirosław</name>
<email>mirq-linux@rere.qmqm.pl</email>
</author>
<published>2019-07-22T18:55:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c304e1a5fbfb1dde63d55263a8a7b01bb1a70add'/>
<id>c304e1a5fbfb1dde63d55263a8a7b01bb1a70add</id>
<content type='text'>
commit d12e3aae160fb26b534c4496b211d6e60a5179ed upstream.

Driver was not disabling TXRDY interrupt after last TX byte.
This caused interrupt storm until transfer timeouts for slow
or broken device on the bus. The patch fixes the interrupt storm
on my SAMA5D2-based board.

Cc: stable@vger.kernel.org # 5.2.x
[v5.2 introduced file split; the patch should apply to i2c-at91.c before the split]
Fixes: fac368a04048 ("i2c: at91: add new driver")
Signed-off-by: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
Acked-by: Ludovic Desroches &lt;ludovic.desroches@microchip.com&gt;
Tested-by: Raag Jadav &lt;raagjadav@gmail.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 d12e3aae160fb26b534c4496b211d6e60a5179ed upstream.

Driver was not disabling TXRDY interrupt after last TX byte.
This caused interrupt storm until transfer timeouts for slow
or broken device on the bus. The patch fixes the interrupt storm
on my SAMA5D2-based board.

Cc: stable@vger.kernel.org # 5.2.x
[v5.2 introduced file split; the patch should apply to i2c-at91.c before the split]
Fixes: fac368a04048 ("i2c: at91: add new driver")
Signed-off-by: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
Acked-by: Ludovic Desroches &lt;ludovic.desroches@microchip.com&gt;
Tested-by: Raag Jadav &lt;raagjadav@gmail.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>
</feed>
