<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/i2c, branch v6.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.3</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-04-15T18:06:49Z</updated>
<entry>
<title>Merge tag 'i2c-for-6.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux</title>
<updated>2023-04-15T18:06:49Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2023-04-15T18:06:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a7a55e27ad72fb0dc9281d6211cffeebef8dde65'/>
<id>urn:sha1:a7a55e27ad72fb0dc9281d6211cffeebef8dde65</id>
<content type='text'>
Pull i2c fixes from Wolfram Sang:
 "Just two driver fixes"

* tag 'i2c-for-6.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: ocores: generate stop condition after timeout in polling mode
  i2c: mchp-pci1xxxx: Update Timing registers
</content>
</entry>
<entry>
<title>Merge tag 'devicetree-fixes-for-6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux</title>
<updated>2023-04-13T22:21:56Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2023-04-13T22:21:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4413ad01e27eb989f4b19bb5b038328c220a383d'/>
<id>urn:sha1:4413ad01e27eb989f4b19bb5b038328c220a383d</id>
<content type='text'>
Pull devicetree fixes from Rob Herring:

 - Fix interaction between fw_devlink and DT overlays causing devices to
   not be probed

 - Fix the compatible string for loongson,cpu-interrupt-controller

* tag 'devicetree-fixes-for-6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  treewide: Fix probing of devices in DT overlays
  dt-bindings: interrupt-controller: loongarch: Fix mismatched compatible
</content>
</entry>
<entry>
<title>i2c: ocores: generate stop condition after timeout in polling mode</title>
<updated>2023-04-13T16:29:29Z</updated>
<author>
<name>Gregor Herburger</name>
<email>gregor.herburger@tq-group.com</email>
</author>
<published>2023-04-13T09:37:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f8160d3b35fc94491bb0cb974dbda310ef96c0e2'/>
<id>urn:sha1:f8160d3b35fc94491bb0cb974dbda310ef96c0e2</id>
<content type='text'>
In polling mode, no stop condition is generated after a timeout. This
causes SCL to remain low and thereby block the bus. If this happens
during a transfer it can cause slaves to misinterpret the subsequent
transfer and return wrong values.

To solve this, pass the ETIMEDOUT error up from ocores_process_polling()
instead of setting STATE_ERROR directly. The caller is adjusted to call
ocores_process_timeout() on error both in polling and in IRQ mode, which
will set STATE_ERROR and generate a stop condition.

Fixes: 69c8c0c0efa8 ("i2c: ocores: add polling interface")
Signed-off-by: Gregor Herburger &lt;gregor.herburger@tq-group.com&gt;
Signed-off-by: Matthias Schiffer &lt;matthias.schiffer@ew.tq-group.com&gt;
Acked-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Reviewed-by: Federico Vaga &lt;federico.vaga@cern.ch&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>treewide: Fix probing of devices in DT overlays</title>
<updated>2023-04-11T19:39:52Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2023-03-30T13:26:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1a50d9403fb90cbe4dea0ec9fd0351d2ecbd8924'/>
<id>urn:sha1:1a50d9403fb90cbe4dea0ec9fd0351d2ecbd8924</id>
<content type='text'>
When loading a DT overlay that creates a device, the device is not
probed, unless the DT overlay is unloaded and reloaded again.

After the recent refactoring to improve fw_devlink, it no longer depends
on the "compatible" property to identify which device tree nodes will
become struct devices.   fw_devlink now picks up dangling consumers
(consumers pointing to descendent device tree nodes of a device that
aren't converted to child devices) when a device is successfully bound
to a driver.  See __fw_devlink_pickup_dangling_consumers().

However, during DT overlay, a device's device tree node can have
sub-nodes added/removed without unbinding/rebinding the driver.  This
difference in behavior between the normal device instantiation and
probing flow vs. the DT overlay flow has a bunch of implications that
are pointed out elsewhere[1].  One of them is that the fw_devlink logic
to pick up dangling consumers is never exercised.

This patch solves the fw_devlink issue by marking all DT nodes added by
DT overlays with FWNODE_FLAG_NOT_DEVICE (fwnode that won't become
device), and by clearing the flag when a struct device is actually
created for the DT node.  This way, fw_devlink knows not to have
consumers waiting on these newly added DT nodes, and to propagate the
dependency to an ancestor DT node that has the corresponding struct
device.

Based on a patch by Saravana Kannan, which covered only platform and spi
devices.

[1] https://lore.kernel.org/r/CAGETcx_bkuFaLCiPrAWCPQz+w79ccDp6=9e881qmK=vx3hBMyg@mail.gmail.com

Fixes: 4a032827daa89350 ("of: property: Simplify of_link_to_phandle()")
Link: https://lore.kernel.org/r/CAGETcx_+rhHvaC_HJXGrr5_WAd2+k5f=rWYnkCZ6z5bGX-wj4w@mail.gmail.com
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Acked-by: Mark Brown &lt;broonie@kernel.org&gt;
Acked-by: Wolfram Sang &lt;wsa@kernel.org&gt; # for I2C
Acked-by: Shawn Guo &lt;shawnguo@kernel.org&gt;
Acked-by: Saravana Kannan &lt;saravanak@google.com&gt;
Tested-by: Ivan Bornyakov &lt;i.bornyakov@metrotek.ru&gt;
Link: https://lore.kernel.org/r/e1fa546682ea4c8474ff997ab6244c5e11b6f8bc.1680182615.git.geert+renesas@glider.be
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: mchp-pci1xxxx: Update Timing registers</title>
<updated>2023-03-29T19:12:06Z</updated>
<author>
<name>Tharun Kumar P</name>
<email>tharunkumar.pasumarthi@microchip.com</email>
</author>
<published>2023-03-20T14:22:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aa874cdfec07d4dd9c6f0c356d65c609ba31a26f'/>
<id>urn:sha1:aa874cdfec07d4dd9c6f0c356d65c609ba31a26f</id>
<content type='text'>
Update I2C timing registers based on latest hardware design.
This fix does not break functionality of chips with older design and
existing users will not be affected.

Fixes: 361693697249 ("i2c: microchip: pci1xxxx: Add driver for I2C host controller in multifunction endpoint of pci1xxxx switch")
Signed-off-by: Tharun Kumar P &lt;tharunkumar.pasumarthi@microchip.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: xgene-slimpro: Fix out-of-bounds bug in xgene_slimpro_i2c_xfer()</title>
<updated>2023-03-16T20:15:43Z</updated>
<author>
<name>Wei Chen</name>
<email>harperchen1110@gmail.com</email>
</author>
<published>2023-03-14T16:54:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=92fbb6d1296f81f41f65effd7f5f8c0f74943d15'/>
<id>urn:sha1:92fbb6d1296f81f41f65effd7f5f8c0f74943d15</id>
<content type='text'>
The data-&gt;block[0] variable comes from user and is a number between
0-255. Without proper check, the variable may be very large to cause
an out-of-bounds when performing memcpy in slimpro_i2c_blkwr.

Fix this bug by checking the value of writelen.

Fixes: f6505fbabc42 ("i2c: add SLIMpro I2C device driver on APM X-Gene platform")
Signed-off-by: Wei Chen &lt;harperchen1110@gmail.com&gt;
Cc: stable@vger.kernel.org
Reviewed-by: Andi Shyti &lt;andi.shyti@kernel.org&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: hisi: Only use the completion interrupt to finish the transfer</title>
<updated>2023-03-16T20:02:15Z</updated>
<author>
<name>Yicong Yang</name>
<email>yangyicong@hisilicon.com</email>
</author>
<published>2023-03-13T07:45:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d98263512684a47e81bcb72a5408958ecd1e60b0'/>
<id>urn:sha1:d98263512684a47e81bcb72a5408958ecd1e60b0</id>
<content type='text'>
The controller will always generate a completion interrupt when the
transfer is finished normally or not. Currently we use either error or
completion interrupt to finish, this may result the completion
interrupt unhandled and corrupt the next transfer, especially at low
speed mode. Since on error case, the error interrupt will come first
then is the completion interrupt. So only use the completion interrupt
to finish the whole transfer process.

Fixes: d62fbdb99a85 ("i2c: add support for HiSilicon I2C controller")
Reported-by: Sheng Feng &lt;fengsheng5@huawei.com&gt;
Signed-off-by: Sheng Feng &lt;fengsheng5@huawei.com&gt;
Signed-off-by: Yicong Yang &lt;yangyicong@hisilicon.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: hisi: Avoid redundant interrupts</title>
<updated>2023-03-16T20:00:47Z</updated>
<author>
<name>Yicong Yang</name>
<email>yangyicong@hisilicon.com</email>
</author>
<published>2023-03-13T07:45:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cc9812a3096d1986caca9a23bee99effc45c08df'/>
<id>urn:sha1:cc9812a3096d1986caca9a23bee99effc45c08df</id>
<content type='text'>
After issuing all the messages we can disable the TX_EMPTY interrupts
to avoid handling redundant interrupts. For doing a sinlge bus
detection (i2cdetect -y -r 0) we can reduce ~97% interrupts (before
~12000 after ~400).

Signed-off-by: Sheng Feng &lt;fengsheng5@huawei.com&gt;
Signed-off-by: Yicong Yang &lt;yangyicong@hisilicon.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: mxs: ensure that DMA buffers are safe for DMA</title>
<updated>2023-03-16T19:47:32Z</updated>
<author>
<name>Matthias Schiffer</name>
<email>matthias.schiffer@ew.tq-group.com</email>
</author>
<published>2023-02-13T15:25:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5190417bdf72c71b65bd9892103c6186816a6e8b'/>
<id>urn:sha1:5190417bdf72c71b65bd9892103c6186816a6e8b</id>
<content type='text'>
We found that after commit 9c46929e7989
("ARM: implement THREAD_INFO_IN_TASK for uniprocessor systems"), the
PCF85063 RTC driver stopped working on i.MX28 due to regmap_bulk_read()
reading bogus data into a stack buffer. This is caused by the i2c-mxs
driver using DMA transfers even for messages without the I2C_M_DMA_SAFE
flag, and the aforementioned commit enabling vmapped stacks.

As the MXS I2C controller requires DMA for reads of &gt;4 bytes, DMA can't be
disabled, so the issue is fixed by using i2c_get_dma_safe_msg_buf() to
create a bounce buffer when needed.

Fixes: 9c46929e7989 ("ARM: implement THREAD_INFO_IN_TASK for uniprocessor systems")
Signed-off-by: Matthias Schiffer &lt;matthias.schiffer@ew.tq-group.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>i2c: imx-lpi2c: check only for enabled interrupt flags</title>
<updated>2023-03-16T19:35:57Z</updated>
<author>
<name>Alexander Stein</name>
<email>alexander.stein@ew.tq-group.com</email>
</author>
<published>2023-01-30T15:32:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1c7885004567e8951d65a983be095f254dd20bef'/>
<id>urn:sha1:1c7885004567e8951d65a983be095f254dd20bef</id>
<content type='text'>
When reading from I2C, the Tx watermark is set to 0. Unfortunately the
TDF (transmit data flag) is enabled when Tx FIFO entries is equal or less
than watermark. So it is set in every case, hence the reset default of 1.
This results in the MSR_RDF _and_ MSR_TDF flags to be set thus trying
to send Tx data on a read message.
Mask the IRQ status to filter for wanted flags only.

Fixes: a55fa9d0e42e ("i2c: imx-lpi2c: add low power i2c bus driver")
Signed-off-by: Alexander Stein &lt;alexander.stein@ew.tq-group.com&gt;
Tested-by: Emanuele Ghidoli &lt;emanuele.ghidoli@toradex.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@kernel.org&gt;
</content>
</entry>
</feed>
