<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/i2c, branch v5.15.7</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.7</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.7'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-12-08T08:04:46+00:00</updated>
<entry>
<title>i2c: cbus-gpio: set atomic transfer callback</title>
<updated>2021-12-08T08:04:46+00:00</updated>
<author>
<name>Aaro Koskinen</name>
<email>aaro.koskinen@iki.fi</email>
</author>
<published>2021-11-27T19:42:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f744230dfbf2960f9dc3104ce804377b228bebfc'/>
<id>urn:sha1:f744230dfbf2960f9dc3104ce804377b228bebfc</id>
<content type='text'>
commit b12764695c3fcade145890b67f82f8b139174cc7 upstream.

CBUS transfers have always been atomic, but after commit 63b96983a5dd
("i2c: core: introduce callbacks for atomic transfers") we started to see
warnings during e.g. poweroff as the atomic callback is not explicitly set.
Fix that.

Fixes the following WARNING seen during Nokia N810 power down:

[  786.570617] reboot: Power down
[  786.573913] ------------[ cut here ]------------
[  786.578826] WARNING: CPU: 0 PID: 672 at drivers/i2c/i2c-core.h:40 i2c_smbus_xfer+0x100/0x110
[  786.587799] No atomic I2C transfer handler for 'i2c-2'

Fixes: 63b96983a5dd ("i2c: core: introduce callbacks for atomic transfers")
Signed-off-by: Aaro Koskinen &lt;aaro.koskinen@iki.fi&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: stm32f7: stop dma transfer in case of NACK</title>
<updated>2021-12-08T08:04:46+00:00</updated>
<author>
<name>Alain Volmat</name>
<email>alain.volmat@foss.st.com</email>
</author>
<published>2021-09-20T15:21:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e2d234f96d8ba8c80ccb2e6d856865752f478c15'/>
<id>urn:sha1:e2d234f96d8ba8c80ccb2e6d856865752f478c15</id>
<content type='text'>
commit 31b90a95ccbbb4b628578ac17e3b3cc8eeacfe31 upstream.

In case of receiving a NACK, the dma transfer should be stopped
to avoid feeding data into the FIFO.
Also ensure to properly return the proper error code and avoid
waiting for the end of the dma completion in case of
error happening during the transmission.

Fixes: 7ecc8cfde553 ("i2c: i2c-stm32f7: Add DMA support")
Signed-off-by: Alain Volmat &lt;alain.volmat@foss.st.com&gt;
Reviewed-by: Pierre-Yves MORDRET &lt;pierre-yves.mordret@foss.st.com&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: stm32f7: recover the bus on access timeout</title>
<updated>2021-12-08T08:04:46+00:00</updated>
<author>
<name>Alain Volmat</name>
<email>alain.volmat@foss.st.com</email>
</author>
<published>2021-09-20T15:21:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3dd6c5899695e536161c0866a61751b7a0772987'/>
<id>urn:sha1:3dd6c5899695e536161c0866a61751b7a0772987</id>
<content type='text'>
commit b933d1faf8fa30d16171bcff404e39c41b2a7c84 upstream.

When getting an access timeout, ensure that the bus is in a proper
state prior to returning the error.

Fixes: aeb068c57214 ("i2c: i2c-stm32f7: add driver")
Signed-off-by: Alain Volmat &lt;alain.volmat@foss.st.com&gt;
Reviewed-by: Pierre-Yves MORDRET &lt;pierre-yves.mordret@foss.st.com&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: stm32f7: flush TX FIFO upon transfer errors</title>
<updated>2021-12-08T08:04:46+00:00</updated>
<author>
<name>Alain Volmat</name>
<email>alain.volmat@foss.st.com</email>
</author>
<published>2021-09-20T15:21:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a153d4253530ef2b9a258cd0ed4771f0dd5774c7'/>
<id>urn:sha1:a153d4253530ef2b9a258cd0ed4771f0dd5774c7</id>
<content type='text'>
commit 0c21d02ca469574d2082379db52d1a27b99eed0c upstream.

While handling an error during transfer (ex: NACK), it could
happen that the driver has already written data into TXDR
before the transfer get stopped.
This commit add TXDR Flush after end of transfer in case of error to
avoid sending a wrong data on any other slave upon next transfer.

Fixes: aeb068c57214 ("i2c: i2c-stm32f7: add driver")
Signed-off-by: Alain Volmat &lt;alain.volmat@foss.st.com&gt;
Reviewed-by: Pierre-Yves MORDRET &lt;pierre-yves.mordret@foss.st.com&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: virtio: disable timeout handling</title>
<updated>2021-12-01T08:04:50+00:00</updated>
<author>
<name>Vincent Whitchurch</name>
<email>vincent.whitchurch@axis.com</email>
</author>
<published>2021-11-11T16:04:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cc432b0727ce404cc13e8f6b5ce29f412c3f9f1f'/>
<id>urn:sha1:cc432b0727ce404cc13e8f6b5ce29f412c3f9f1f</id>
<content type='text'>
[ Upstream commit 84e1d0bf1d7121759622dabf8fbef4c99ad597c5 ]

If a timeout is hit, it can result is incorrect data on the I2C bus
and/or memory corruptions in the guest since the device can still be
operating on the buffers it was given while the guest has freed them.

Here is, for example, the start of a slub_debug splat which was
triggered on the next transfer after one transfer was forced to timeout
by setting a breakpoint in the backend (rust-vmm/vhost-device):

 BUG kmalloc-1k (Not tainted): Poison overwritten
 First byte 0x1 instead of 0x6b
 Allocated in virtio_i2c_xfer+0x65/0x35c age=350 cpu=0 pid=29
 	__kmalloc+0xc2/0x1c9
 	virtio_i2c_xfer+0x65/0x35c
 	__i2c_transfer+0x429/0x57d
 	i2c_transfer+0x115/0x134
 	i2cdev_ioctl_rdwr+0x16a/0x1de
 	i2cdev_ioctl+0x247/0x2ed
 	vfs_ioctl+0x21/0x30
 	sys_ioctl+0xb18/0xb41
 Freed in virtio_i2c_xfer+0x32e/0x35c age=244 cpu=0 pid=29
 	kfree+0x1bd/0x1cc
 	virtio_i2c_xfer+0x32e/0x35c
 	__i2c_transfer+0x429/0x57d
 	i2c_transfer+0x115/0x134
 	i2cdev_ioctl_rdwr+0x16a/0x1de
 	i2cdev_ioctl+0x247/0x2ed
 	vfs_ioctl+0x21/0x30
 	sys_ioctl+0xb18/0xb41

There is no simple fix for this (the driver would have to always create
bounce buffers and hold on to them until the device eventually returns
the buffers), so just disable the timeout support for now.

Fixes: 3cfc88380413d20f ("i2c: virtio: add a virtio i2c frontend driver")
Acked-by: Jie Deng &lt;jie.deng@intel.com&gt;
Signed-off-by: Vincent Whitchurch &lt;vincent.whitchurch@axis.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Viresh Kumar &lt;viresh.kumar@linaro.org&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: xlr: Fix a resource leak in the error handling path of 'xlr_i2c_probe()'</title>
<updated>2021-11-18T18:17:04+00:00</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2021-08-19T20:48:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=01e189372d4871fb516966c145810f6262184c9f'/>
<id>urn:sha1:01e189372d4871fb516966c145810f6262184c9f</id>
<content type='text'>
[ Upstream commit 7f98960c046ee1136e7096aee168eda03aef8a5d ]

A successful 'clk_prepare()' call should be balanced by a corresponding
'clk_unprepare()' call in the error handling path of the probe, as already
done in the remove function.

More specifically, 'clk_prepare_enable()' is used, but 'clk_disable()' is
also already called. So just the unprepare step has still to be done.

Update the error handling path accordingly.

Fixes: 75d31c2372e4 ("i2c: xlr: add support for Sigma Designs controller variant")
Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&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: mediatek: fixing the incorrect register offset</title>
<updated>2021-11-18T18:16:59+00:00</updated>
<author>
<name>Kewei Xu</name>
<email>kewei.xu@mediatek.com</email>
</author>
<published>2021-09-17T10:14:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=47dbabb8279c5b5e7025dae58d6d0bb8d6a75b72'/>
<id>urn:sha1:47dbabb8279c5b5e7025dae58d6d0bb8d6a75b72</id>
<content type='text'>
[ Upstream commit b8228aea5a19d5111a7bf44f7de6749d1f5d487a ]

The reason for the modification here is that the previous
offset information is incorrect, OFFSET_DEBUGSTAT = 0xE4 is
the correct value.

Fixes: 25708278f810 ("i2c: mediatek: Add i2c support for MediaTek MT8183")
Signed-off-by: Kewei Xu &lt;kewei.xu@mediatek.com&gt;
Reviewed-by: Chen-Yu Tsai &lt;wenst@chromium.org&gt;
Reviewed-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: i801: Use PCI bus rescan mutex to protect P2SB access</title>
<updated>2021-11-18T18:16:59+00:00</updated>
<author>
<name>Heiner Kallweit</name>
<email>hkallweit1@gmail.com</email>
</author>
<published>2021-09-05T15:59:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c31b0fe8e116354cbfbea52e49a29095f42ec9bd'/>
<id>urn:sha1:c31b0fe8e116354cbfbea52e49a29095f42ec9bd</id>
<content type='text'>
[ Upstream commit 7d6b61c394a42b8385858bb9e306d48a0112823c ]

As pointed out by Andy in [0] using a local mutex here isn't strictly
wrong but not sufficient. We should hold the PCI rescan lock for P2SB
operations.

[0] https://www.spinics.net/lists/linux-i2c/msg52717.html

Fixes: 1a987c69ce2c ("i2c: i801: make p2sb_spinlock a mutex")
Reported-by: Andy Shevchenko &lt;andriy.shevchenko@intel.com&gt;
Signed-off-by: Heiner Kallweit &lt;hkallweit1@gmail.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@intel.com&gt;
Reviewed-by: Jean Delvare &lt;jdelvare@suse.de&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: mlxcpld: Modify register setting for 400KHz frequency</title>
<updated>2021-10-04T19:56:20+00:00</updated>
<author>
<name>Vadim Pasternak</name>
<email>vadimp@nvidia.com</email>
</author>
<published>2021-08-23T14:45:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fa1049135c15b4930ce7ea757a81b1b78908f304'/>
<id>urn:sha1:fa1049135c15b4930ce7ea757a81b1b78908f304</id>
<content type='text'>
Change setting for 400KHz frequency support by more accurate value.

Fixes: 66b0c2846ba8 ("i2c: mlxcpld: Add support for I2C bus frequency setting")
Signed-off-by: Vadim Pasternak &lt;vadimp@nvidia.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: mlxcpld: Fix criteria for frequency setting</title>
<updated>2021-10-04T19:56:13+00:00</updated>
<author>
<name>Vadim Pasternak</name>
<email>vadimp@nvidia.com</email>
</author>
<published>2021-08-23T14:45:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=52f57396c75acd77ebcdf3d20aed24ed248e9f79'/>
<id>urn:sha1:52f57396c75acd77ebcdf3d20aed24ed248e9f79</id>
<content type='text'>
Value for getting frequency capability wrongly has been taken from
register offset instead of register value.

Fixes: 66b0c2846ba8 ("i2c: mlxcpld: Add support for I2C bus frequency setting")
Signed-off-by: Vadim Pasternak &lt;vadimp@nvidia.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
</feed>
