<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/iio/buffer, branch v6.1.168</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-09-12T09:10:26+00:00</updated>
<entry>
<title>iio: buffer-dmaengine: fix releasing dma channel on error</title>
<updated>2024-09-12T09:10:26+00:00</updated>
<author>
<name>David Lechner</name>
<email>dlechner@baylibre.com</email>
</author>
<published>2024-07-23T16:32:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=08b072b8ef5b80c4746ff0077f58781e7a26a325'/>
<id>urn:sha1:08b072b8ef5b80c4746ff0077f58781e7a26a325</id>
<content type='text'>
commit 84c65d8008764a8fb4e627ff02de01ec4245f2c4 upstream.

If dma_get_slave_caps() fails, we need to release the dma channel before
returning an error to avoid leaking the channel.

Fixes: 2d6ca60f3284 ("iio: Add a DMAengine framework based buffer")
Signed-off-by: David Lechner &lt;dlechner@baylibre.com&gt;
Link: https://patch.msgid.link/20240723-iio-fix-dmaengine-free-on-error-v1-1-2c7cbc9b92ff@baylibre.com
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio: triggered-buffer: prevent possible freeing of wrong buffer</title>
<updated>2024-01-01T12:39:01+00:00</updated>
<author>
<name>David Lechner</name>
<email>dlechner@baylibre.com</email>
</author>
<published>2023-10-31T21:05:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=01bc94b581921a3a104d346bbb02e9f459d3a939'/>
<id>urn:sha1:01bc94b581921a3a104d346bbb02e9f459d3a939</id>
<content type='text'>
commit bce61476dc82f114e24e9c2e11fb064781ec563c upstream.

Commit ee708e6baacd ("iio: buffer: introduce support for attaching more
IIO buffers") introduced support for multiple buffers per indio_dev but
left indio_dev-&gt;buffer for a few legacy use cases.

In the case of the triggered buffer, iio_triggered_buffer_cleanup()
still assumes that indio_dev-&gt;buffer points to the buffer allocated by
iio_triggered_buffer_setup_ext(). However, since
iio_triggered_buffer_setup_ext() now calls iio_device_attach_buffer()
to attach the buffer, indio_dev-&gt;buffer will only point to the buffer
allocated by iio_device_attach_buffer() if it the first buffer attached.

This adds a check to make sure that no other buffer has been attached
yet to ensure that indio_dev-&gt;buffer will be assigned when
iio_device_attach_buffer() is called.

As per discussion in the review thread, we may want to deal with multiple
triggers per device, but this is a fix for the issue in the meantime and
any such support would be unlikely to be suitable for a backport.

Fixes: ee708e6baacd ("iio: buffer: introduce support for attaching more IIO buffers")
Signed-off-by: David Lechner &lt;dlechner@baylibre.com&gt;
Acked-by: Nuno Sa &lt;nuno.sa@analog.com&gt;
Link: https://lore.kernel.org/r/20231031210521.1661552-1-dlechner@baylibre.com
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio: core: Simplify the registration of kfifo buffers</title>
<updated>2022-04-10T15:25:46+00:00</updated>
<author>
<name>Miquel Raynal</name>
<email>miquel.raynal@bootlin.com</email>
</author>
<published>2022-02-07T14:38:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f67c6c73cb07a4778425a2064640333ef7bfa42b'/>
<id>urn:sha1:f67c6c73cb07a4778425a2064640333ef7bfa42b</id>
<content type='text'>
Among all the users of the kfifo buffers, no one uses the
INDIO_BUFFER_HARDWARE mode. So let's take this as a general rule and
simplify a little bit the internals - overall the documentation - by
eliminating unused specific cases. Use the INDIO_BUFFER_SOFTWARE mode by
default with kfifo buffers, which will basically mimic what all the "non
direct" modes do.

Cc: Benson Leung &lt;bleung@chromium.org&gt;
Cc: Guenter Roeck &lt;groeck@chromium.org&gt;
Cc: Jyoti Bhayana &lt;jbhayana@google.com&gt;
Cc: Jean-Baptiste Maneyrol &lt;jmaneyrol@invensense.com&gt;
Cc: Lorenzo Bianconi &lt;lorenzo.bianconi83@gmail.com&gt;
Cc: Michael Hennerich &lt;Michael.Hennerich@analog.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/r/20220207143840.707510-13-miquel.raynal@bootlin.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: hw_consumer: Use struct_size() helper in kzalloc()</title>
<updated>2022-01-23T18:03:37+00:00</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavoars@kernel.org</email>
</author>
<published>2022-01-20T22:52:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2d255ec5100570559550ed61dd4c9c57d593e9a9'/>
<id>urn:sha1:2d255ec5100570559550ed61dd4c9c57d593e9a9</id>
<content type='text'>
Make use of the struct_size() helper instead of an open-coded version,
in order to avoid any potential type mistakes or integer overflows that,
in the worst scenario, could lead to heap overflows.

Also, address the following sparse warnings:
drivers/iio/buffer/industrialio-hw-consumer.c:63:23: warning: using sizeof on a flexible structure when using CF='-Wflexible-array-sizeof'

Link: https://github.com/KSPP/linux/issues/174
Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/20220120225243.GA37225@embeddedor
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: dmaengine-buffer: Use sysfs_emit()</title>
<updated>2022-01-23T18:03:36+00:00</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2021-12-16T18:52:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0ce1a30cd7efa1d8f13fd5dd2a1e460ad49bfa41'/>
<id>urn:sha1:0ce1a30cd7efa1d8f13fd5dd2a1e460ad49bfa41</id>
<content type='text'>
sysfs_emit() is preferred over raw s*printf() for sysfs attributes since it
knows about the sysfs buffer specifics and has some built-in checks for
size and alignment.

Use sysfs_emit() for the `length_align_bytes` buffer attribute.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Link: https://lore.kernel.org/r/20211216185217.1054495-3-lars@metafoo.de
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: buffer-dma: Use round_down() instead of rounddown()</title>
<updated>2021-11-27T15:12:44+00:00</updated>
<author>
<name>Paul Cercueil</name>
<email>paul@crapouillou.net</email>
</author>
<published>2021-11-15T14:19:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ab1fb45579d876aee70eb736d3d9e6a9bacc798d'/>
<id>urn:sha1:ab1fb45579d876aee70eb736d3d9e6a9bacc798d</id>
<content type='text'>
We know that the buffer's alignment will always be a power of two;
therefore, we can use the faster round_down() macro.

Signed-off-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
Reviewed-by: Alexandru Ardelean &lt;ardeleanalex@gmail.com&gt;
Link: https://lore.kernel.org/r/20211115141925.60164-4-paul@crapouillou.net
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: triggered-buffer: extend support to configure output buffers</title>
<updated>2021-10-19T07:30:45+00:00</updated>
<author>
<name>Alexandru Ardelean</name>
<email>alexandru.ardelean@analog.com</email>
</author>
<published>2021-10-07T08:00:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c02cd5c19c17698f12b731e898127095f9bc2921'/>
<id>urn:sha1:c02cd5c19c17698f12b731e898127095f9bc2921</id>
<content type='text'>
Now that output (kfifo) buffers are supported, we need to extend the
{devm_}iio_triggered_buffer_setup_ext() parameter list to take a direction
parameter.

This allows us to attach an output triggered buffer to a DAC device.
Unfortunately it's a bit difficult to add another macro to avoid changing 5
drivers where {devm_}iio_triggered_buffer_setup_ext() is used.
Well, it's doable, but may not be worth the trouble vs just updating all
these 5 drivers.

Signed-off-by: Alexandru Ardelean &lt;alexandru.ardelean@analog.com&gt;
Signed-off-by: Mihail Chindris &lt;mihail.chindris@analog.com&gt;
Link: https://lore.kernel.org/r/20211007080035.2531-4-mihail.chindris@analog.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: kfifo-buffer: Add output buffer support</title>
<updated>2021-10-19T07:30:45+00:00</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2021-10-07T08:00:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1546d6718dc92b27935931ee4e4c2e9893ef3066'/>
<id>urn:sha1:1546d6718dc92b27935931ee4e4c2e9893ef3066</id>
<content type='text'>
Add output buffer support to the kfifo buffer implementation.

The implementation is straight forward and mostly just wraps the kfifo
API to provide the required operations.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Alexandru Ardelean &lt;alexandru.ardelean@analog.com&gt;
Signed-off-by: Mihail Chindris &lt;mihail.chindris@analog.com&gt;
Link: https://lore.kernel.org/r/20211007080035.2531-3-mihail.chindris@analog.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: core: move @id from struct iio_dev to struct iio_dev_opaque</title>
<updated>2021-05-17T12:49:13+00:00</updated>
<author>
<name>Jonathan Cameron</name>
<email>Jonathan.Cameron@huawei.com</email>
</author>
<published>2021-04-26T17:49:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=15ea2878bfb255099092634d28f31177f237ccd7'/>
<id>urn:sha1:15ea2878bfb255099092634d28f31177f237ccd7</id>
<content type='text'>
Continuing from Alexandru Ardelean's introduction of the split between
driver modifiable fields and those that should only be set by the core.

This could have been done in two steps to make the actual move after
introducing iio_device_id() but there seemed limited point to that
given how mechanical the majority of the patch is.

Includes fixup from Alex for missing mxs-lradc-adc conversion.

Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Reviewed-by: Alexandru Ardelean &lt;ardeleanalex@gmail.com&gt;
Link: https://lore.kernel.org/r/20210426174911.397061-2-jic23@kernel.org
</content>
</entry>
<entry>
<title>iio: triggered-buffer: simplify devm_iio_triggered_buffer_setup_ext()</title>
<updated>2021-05-17T12:49:07+00:00</updated>
<author>
<name>Yicong Yang</name>
<email>yangyicong@hisilicon.com</email>
</author>
<published>2021-04-08T11:38:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8e39d4723a00cfc7029e61f7bd9ffa357409f9d2'/>
<id>urn:sha1:8e39d4723a00cfc7029e61f7bd9ffa357409f9d2</id>
<content type='text'>
Use devm_add_action_or_reset() instead of devres_alloc() and
devres_add(), which works the same. This will simplify the
code. There is no functional changes.

Signed-off-by: Yicong Yang &lt;yangyicong@hisilicon.com&gt;
Reviewed-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Reviewed-by: Nuno Sa &lt;nuno.sa@analog.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/1617881896-3164-5-git-send-email-yangyicong@hisilicon.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
</feed>
