<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/i2c, branch linux-5.9.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-5.9.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-5.9.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2020-12-11T12:22:12+00:00</updated>
<entry>
<title>i2c: qup: Fix error return code in qup_i2c_bam_schedule_desc()</title>
<updated>2020-12-11T12:22:12+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2020-11-16T14:10:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b85ca7d11c61e81a644d3658a86c79e0cec6c6a7'/>
<id>urn:sha1:b85ca7d11c61e81a644d3658a86c79e0cec6c6a7</id>
<content type='text'>
commit e9acf0298c664f825e6f1158f2a97341bf9e03ca upstream.

Fix to return the error code from qup_i2c_change_state()
instaed of 0 in qup_i2c_bam_schedule_desc().

Fixes: fbf9921f8b35d9b2 ("i2c: qup: Fix error handling")
Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Zhihao Cheng &lt;chengzhihao1@huawei.com&gt;
Reviewed-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>i2c: qcom: Fix IRQ error misassignement</title>
<updated>2020-12-11T12:22:12+00:00</updated>
<author>
<name>Robert Foss</name>
<email>robert.foss@linaro.org</email>
</author>
<published>2020-11-30T10:04:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=97783a290bf97374c5c542cb105bd0e064612cce'/>
<id>urn:sha1:97783a290bf97374c5c542cb105bd0e064612cce</id>
<content type='text'>
commit 14718b3e129b058cb716a60c6faf40ef68661c54 upstream.

During cci_isr() errors read from register fields belonging to
i2c master1 are currently assigned to the status field belonging to
i2c master0. This patch corrects this error, and always assigns
master1 errors to the status field of master1.

Fixes: e517526195de ("i2c: Add Qualcomm CCI I2C driver")
Reported-by: Loic Poulain &lt;loic.poulain@linaro.org&gt;
Suggested-by: Loic Poulain &lt;loic.poulain@linaro.org&gt;
Signed-off-by: Robert Foss &lt;robert.foss@linaro.org&gt;
Reviewed-by: Manivannan Sadhasivam &lt;manivannan.sadhasivam@linaro.org&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>i2c: imx: Don't generate STOP condition if arbitration has been lost</title>
<updated>2020-12-11T12:22:07+00:00</updated>
<author>
<name>Christian Eggers</name>
<email>ceggers@arri.de</email>
</author>
<published>2020-10-09T11:03:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=da4d792e74cecbee9c2e6f1a2db3dfd6849f6d45'/>
<id>urn:sha1:da4d792e74cecbee9c2e6f1a2db3dfd6849f6d45</id>
<content type='text'>
commit 61e6fe59ede155881a622f5901551b1cc8748f6a upstream.

If arbitration is lost, the master automatically changes to slave mode.
I2SR_IBB may or may not be reset by hardware. Raising a STOP condition
by resetting I2CR_MSTA has no effect and will not clear I2SR_IBB.

So calling i2c_imx_bus_busy() is not required and would busy-wait until
timeout.

Signed-off-by: Christian Eggers &lt;ceggers@arri.de&gt;
Tested (not extensively) on Vybrid VF500 (Toradex VF50):
Tested-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Acked-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
Cc: stable@vger.kernel.org # Requires trivial backporting, simple remove
                           # the 3rd argument from the calls to
                           # i2c_imx_bus_busy().
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>i2c: imx: Check for I2SR_IAL after every byte</title>
<updated>2020-12-11T12:22:07+00:00</updated>
<author>
<name>Christian Eggers</name>
<email>ceggers@arri.de</email>
</author>
<published>2020-10-09T11:03:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e385ea09b2e801cef1509e06bc691597aac80a99'/>
<id>urn:sha1:e385ea09b2e801cef1509e06bc691597aac80a99</id>
<content type='text'>
commit 1de67a3dee7a279ebe4d892b359fe3696938ec15 upstream.

Arbitration Lost (IAL) can happen after every single byte transfer. If
arbitration is lost, the I2C hardware will autonomously switch from
master mode to slave. If a transfer is not aborted in this state,
consecutive transfers will not be executed by the hardware and will
timeout.

Signed-off-by: Christian Eggers &lt;ceggers@arri.de&gt;
Tested (not extensively) on Vybrid VF500 (Toradex VF50):
Tested-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Acked-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>i2c: imx: Fix reset of I2SR_IAL flag</title>
<updated>2020-12-11T12:22:07+00:00</updated>
<author>
<name>Christian Eggers</name>
<email>ceggers@arri.de</email>
</author>
<published>2020-10-09T11:03:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=12b2af654bac6ee44c751ee4fcb28cfd78e22ccb'/>
<id>urn:sha1:12b2af654bac6ee44c751ee4fcb28cfd78e22ccb</id>
<content type='text'>
commit 384a9565f70a876c2e78e58c5ca0bbf0547e4f6d upstream.

According to the "VFxxx Controller Reference Manual" (and the comment
block starting at line 97), Vybrid requires writing a one for clearing
an interrupt flag. Syncing the method for clearing I2SR_IIF in
i2c_imx_isr().

Signed-off-by: Christian Eggers &lt;ceggers@arri.de&gt;
Fixes: 4b775022f6fd ("i2c: imx: add struct to hold more configurable quirks")
Reviewed-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Acked-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>i2c: designware: slave should do WRITE_REQUESTED before WRITE_RECEIVED</title>
<updated>2020-11-18T18:22:15+00:00</updated>
<author>
<name>Michael Wu</name>
<email>michael.wu@vatics.com</email>
</author>
<published>2020-10-30T08:04:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=56cbb085945380057a519adc1e00eb44428a129f'/>
<id>urn:sha1:56cbb085945380057a519adc1e00eb44428a129f</id>
<content type='text'>
[ Upstream commit 3b5f7f10ff6e6b66f553e12cc50d9bb751ce60ad ]

Sometimes we would get the following flow when doing an i2cset:

0x1 STATUS SLAVE_ACTIVITY=0x1 : RAW_INTR_STAT=0x514 : INTR_STAT=0x4
I2C_SLAVE_WRITE_RECEIVED
0x1 STATUS SLAVE_ACTIVITY=0x0 : RAW_INTR_STAT=0x714 : INTR_STAT=0x204
I2C_SLAVE_WRITE_REQUESTED
I2C_SLAVE_WRITE_RECEIVED

Documentation/i2c/slave-interface.rst says that I2C_SLAVE_WRITE_REQUESTED,
which is mandatory, should be sent while the data did not arrive yet. It
means in a write-request I2C_SLAVE_WRITE_REQUESTED should be reported
before any I2C_SLAVE_WRITE_RECEIVED.

By the way, I2C_SLAVE_STOP didn't be reported in the above case because
DW_IC_INTR_STAT was not 0x200.

dev-&gt;status can be used to record the current state, especially Designware
I2C controller has no interrupts to identify a write-request. This patch
makes not only I2C_SLAVE_WRITE_REQUESTED been reported first when
IC_INTR_RX_FULL is rising and dev-&gt;status isn't STATUS_WRITE_IN_PROGRESS
but also I2C_SLAVE_STOP been reported when a STOP condition is received.

Signed-off-by: Michael Wu &lt;michael.wu@vatics.com&gt;
Acked-by: Jarkko Nikula &lt;jarkko.nikula@linux.intel.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: designware: call i2c_dw_read_clear_intrbits_slave() once</title>
<updated>2020-11-18T18:22:15+00:00</updated>
<author>
<name>Michael Wu</name>
<email>michael.wu@vatics.com</email>
</author>
<published>2020-10-30T08:04:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0df649e55193ceb9601d0d903ef498f61e649047'/>
<id>urn:sha1:0df649e55193ceb9601d0d903ef498f61e649047</id>
<content type='text'>
[ Upstream commit 66b92313e2ca9208b5f3ebf5d86e9a818299d8fa ]

If some bits were cleared by i2c_dw_read_clear_intrbits_slave() in
i2c_dw_isr_slave() and not handled immediately, those cleared bits would
not be shown again by later i2c_dw_read_clear_intrbits_slave(). They
therefore were forgotten to be handled.

i2c_dw_read_clear_intrbits_slave() should be called once in an ISR and take
its returned state for all later handlings.

Signed-off-by: Michael Wu &lt;michael.wu@vatics.com&gt;
Acked-by: Jarkko Nikula &lt;jarkko.nikula@linux.intel.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: sh_mobile: implement atomic transfers</title>
<updated>2020-11-18T18:22:14+00:00</updated>
<author>
<name>Ulrich Hecht</name>
<email>uli+renesas@fpond.eu</email>
</author>
<published>2020-09-28T15:59:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=168b746c3de0b6e54cf58ca39e3afb9bda6d82ce'/>
<id>urn:sha1:168b746c3de0b6e54cf58ca39e3afb9bda6d82ce</id>
<content type='text'>
[ Upstream commit a49cc1fe9d64a2dc4e19b599204f403e5d25f44b ]

Implements atomic transfers to fix reboot/shutdown on r8a7790 Lager and
similar boards.

Signed-off-by: Ulrich Hecht &lt;uli+renesas@fpond.eu&gt;
Tested-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Tested-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
[wsa: some whitespace fixing]
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: mediatek: move dma reset before i2c reset</title>
<updated>2020-11-18T18:22:14+00:00</updated>
<author>
<name>Qii Wang</name>
<email>qii.wang@mediatek.com</email>
</author>
<published>2020-10-30T11:58:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6a1d0696c878990360239ff5b466260046b838b6'/>
<id>urn:sha1:6a1d0696c878990360239ff5b466260046b838b6</id>
<content type='text'>
[ Upstream commit aafced673c06b7c77040c1df42e2e965be5d0376 ]

The i2c driver default do dma reset after i2c reset, but sometimes
i2c reset will trigger dma tx2rx, then apdma write data to dram
which has been i2c_put_dma_safe_msg_buf(kfree). Move dma reset
before i2c reset in mtk_i2c_init_hw to fix it.

Signed-off-by: Qii Wang &lt;qii.wang@mediatek.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: imx: Fix external abort on interrupt in exit paths</title>
<updated>2020-11-05T10:51:48+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzk@kernel.org</email>
</author>
<published>2020-09-20T21:12:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ff2d398534a8dfd14b15e1e029be9d2b0d2c381f'/>
<id>urn:sha1:ff2d398534a8dfd14b15e1e029be9d2b0d2c381f</id>
<content type='text'>
commit e50e4f0b85be308a01b830c5fbdffc657e1a6dd0 upstream.

If interrupt comes late, during probe error path or device remove (could
be triggered with CONFIG_DEBUG_SHIRQ), the interrupt handler
i2c_imx_isr() will access registers with the clock being disabled.  This
leads to external abort on non-linefetch on Toradex Colibri VF50 module
(with Vybrid VF5xx):

    Unhandled fault: external abort on non-linefetch (0x1008) at 0x8882d003
    Internal error: : 1008 [#1] ARM
    Modules linked in:
    CPU: 0 PID: 1 Comm: swapper Not tainted 5.7.0 #607
    Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
      (i2c_imx_isr) from [&lt;8017009c&gt;] (free_irq+0x25c/0x3b0)
      (free_irq) from [&lt;805844ec&gt;] (release_nodes+0x178/0x284)
      (release_nodes) from [&lt;80580030&gt;] (really_probe+0x10c/0x348)
      (really_probe) from [&lt;80580380&gt;] (driver_probe_device+0x60/0x170)
      (driver_probe_device) from [&lt;80580630&gt;] (device_driver_attach+0x58/0x60)
      (device_driver_attach) from [&lt;805806bc&gt;] (__driver_attach+0x84/0xc0)
      (__driver_attach) from [&lt;8057e228&gt;] (bus_for_each_dev+0x68/0xb4)
      (bus_for_each_dev) from [&lt;8057f3ec&gt;] (bus_add_driver+0x144/0x1ec)
      (bus_add_driver) from [&lt;80581320&gt;] (driver_register+0x78/0x110)
      (driver_register) from [&lt;8010213c&gt;] (do_one_initcall+0xa8/0x2f4)
      (do_one_initcall) from [&lt;80c0100c&gt;] (kernel_init_freeable+0x178/0x1dc)
      (kernel_init_freeable) from [&lt;80807048&gt;] (kernel_init+0x8/0x110)
      (kernel_init) from [&lt;80100114&gt;] (ret_from_fork+0x14/0x20)

Additionally, the i2c_imx_isr() could wake up the wait queue
(imx_i2c_struct-&gt;queue) before its initialization happens.

The resource-managed framework should not be used for interrupt handling,
because the resource will be released too late - after disabling clocks.
The interrupt handler is not prepared for such case.

Fixes: 1c4b6c3bcf30 ("i2c: imx: implement bus recovery")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Acked-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
