<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/iio/industrialio-buffer.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-12-21T10:48:29Z</updated>
<entry>
<title>iio: buffer: Use IIO_SEPARATE instead of a hard-coded 0</title>
<updated>2023-12-21T10:48:29Z</updated>
<author>
<name>Christophe JAILLET</name>
</author>
<published>2023-12-17T16:41:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4bb104e4f30d2202657b77c948f9ef1366ac438e'/>
<id>urn:sha1:4bb104e4f30d2202657b77c948f9ef1366ac438e</id>
<content type='text'>
Use an explicit IIO_SEPARATE instead of 0 for the 'shared_by' parameter
when calling __iio_add_chan_devattr().

For some reason, commit 3704432fb1fd ("iio: refactor info mask and ext_info
attribute creation.") updated only 1 place out of 4.
Update the remaining ones now.

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Link: https://lore.kernel.org/r/1d17f57423172fcb9d9797cfe7c8282f356049c2.1702831285.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: buffer: document known issue</title>
<updated>2023-11-16T19:10:28Z</updated>
<author>
<name>Matti Vaittinen</name>
</author>
<published>2023-10-16T11:04:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6543f376ec8aa90a6c1ed44b765f4f0d6c3eb1db'/>
<id>urn:sha1:6543f376ec8aa90a6c1ed44b765f4f0d6c3eb1db</id>
<content type='text'>
Add documentation explaining why the code which scans all available scan
masks is checking only a single long worth of bits even though the code
was intended to be supporting masks wider than single long.

Signed-off-by: Matti Vaittinen &lt;mazziesaccount@gmail.com&gt;
Link: https://lore.kernel.org/r/ef61c2c1e9a1c5e9f713f656871fdcb1652afdc2.1697452986.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: buffer: fix coding style warnings</title>
<updated>2023-05-13T16:56:06Z</updated>
<author>
<name>Nuno Sá</name>
</author>
<published>2023-02-16T10:14:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=26e46ef7758922e983a9a2f688369f649cc1a635'/>
<id>urn:sha1:26e46ef7758922e983a9a2f688369f649cc1a635</id>
<content type='text'>
Just cosmetics. No functional change intended...

Signed-off-by: Nuno Sá &lt;nuno.sa@analog.com&gt;
Reviewed-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Link: https://lore.kernel.org/r/20230216101452.591805-4-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: buffer: make sure O_NONBLOCK is respected</title>
<updated>2023-02-18T14:07:58Z</updated>
<author>
<name>Nuno Sá</name>
</author>
<published>2023-02-16T10:14:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3da1814184582ed0faf039275a3f02e6f69944ee'/>
<id>urn:sha1:3da1814184582ed0faf039275a3f02e6f69944ee</id>
<content type='text'>
For output buffers, there's no guarantee that the buffer won't be full
in the first iteration of the loop in which case we would block
independently of userspace passing O_NONBLOCK or not. Fix it by always
checking the flag before going to sleep.

While at it (and as it's a bit related), refactored the loop so that the
stop condition is 'written != n', i.e, run the loop until all data has
been copied into the IIO buffers. This makes the code a bit simpler.

Fixes: 9eeee3b0bf190 ("iio: Add output buffer support")
Signed-off-by: Nuno Sá &lt;nuno.sa@analog.com&gt;
Reviewed-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Link: https://lore.kernel.org/r/20230216101452.591805-3-nuno.sa@analog.com
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: buffer: correctly return bytes written in output buffers</title>
<updated>2023-02-18T14:06:50Z</updated>
<author>
<name>Nuno Sá</name>
</author>
<published>2023-02-16T10:14:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b5184a26a28fac1d708b0bfeeb958a9260c2924c'/>
<id>urn:sha1:b5184a26a28fac1d708b0bfeeb958a9260c2924c</id>
<content type='text'>
If for some reason 'rb-&gt;access-&gt;write()' does not write the full
requested data and the O_NONBLOCK is set, we would return 'n' to
userspace which is not really truth. Hence, let's return the number of
bytes we effectively wrote.

Fixes: 9eeee3b0bf190 ("iio: Add output buffer support")
Signed-off-by: Nuno Sá &lt;nuno.sa@analog.com&gt;
Reviewed-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Link: https://lore.kernel.org/r/20230216101452.591805-2-nuno.sa@analog.com
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: Don't silently expect attribute types</title>
<updated>2022-11-23T19:44:04Z</updated>
<author>
<name>Matti Vaittinen</name>
</author>
<published>2022-10-03T08:13:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0a33755c4b01ed62a6d025cb585928304f9653d7'/>
<id>urn:sha1:0a33755c4b01ed62a6d025cb585928304f9653d7</id>
<content type='text'>
The iio_triggered_buffer_setup_ext() and the
devm_iio_kfifo_buffer_setup_ext() were changed by
commit 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr")
to silently expect that all attributes given in buffer_attrs array are
device-attributes. This expectation was not forced by the API - and some
drivers did register attributes created by IIO_CONST_ATTR().

When using IIO_CONST_ATTRs the added attribute "wrapping" does not copy
the pointer to stored string constant and when the sysfs file is read the
kernel will access to invalid location.

Change the function signatures to expect an array of iio_dev_attrs to
avoid similar errors in the future.

Merge conflict resolved whilst applying due to patch crossing with
two new drivers (kx022a accelerometer and ad4130 ADC).

Signed-off-by: Matti Vaittinen &lt;mazziesaccount@gmail.com&gt;
Tested-by: Claudiu Beznea &lt;claudiu.beznea@microchip.com&gt;
Link: https://lore.kernel.org/r/63f54787a684eb1232f1c5d275a09c786987fe4a.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: core: move 'mlock' to 'struct iio_dev_opaque'</title>
<updated>2022-11-23T19:44:00Z</updated>
<author>
<name>Nuno Sá</name>
</author>
<published>2022-10-12T15:16:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=16afe125b53f88b855d2713c8ba253d905dcf3cc'/>
<id>urn:sha1:16afe125b53f88b855d2713c8ba253d905dcf3cc</id>
<content type='text'>
Now that there are no more users accessing 'mlock' directly, we can move
it to the iio_dev private structure. Hence, it's now explicit that new
driver's should not directly use this lock.

Signed-off-by: Nuno Sá &lt;nuno.sa@analog.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/20221012151620.1725215-5-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: Fix indentation for multiline conditional.</title>
<updated>2022-08-15T21:29:57Z</updated>
<author>
<name>Joe Simmons-Talbott</name>
</author>
<published>2022-07-27T18:18:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3d4b8291df3b5c9bc62ea8213b5483c4ec852947'/>
<id>urn:sha1:3d4b8291df3b5c9bc62ea8213b5483c4ec852947</id>
<content type='text'>
As reported by checkpatch.pl make indentation match previous
conditional.

Signed-off-by: Joe Simmons-Talbott &lt;joetalbott@gmail.com&gt;
Link: https://lore.kernel.org/r/20220727181855.589052-3-joetalbott@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: Add blank lines after declarations.</title>
<updated>2022-08-15T21:29:56Z</updated>
<author>
<name>Joe Simmons-Talbott</name>
</author>
<published>2022-07-27T18:18:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9d9ec8d01443832d4e6d2f46bfd6b3270f390be3'/>
<id>urn:sha1:9d9ec8d01443832d4e6d2f46bfd6b3270f390be3</id>
<content type='text'>
As reported by checkpatch.pl add blank lines after declarations.

Signed-off-by: Joe Simmons-Talbott &lt;joetalbott@gmail.com&gt;
Link: https://lore.kernel.org/r/20220727181855.589052-2-joetalbott@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: Don't use bare "unsigned"</title>
<updated>2022-07-01T10:19:08Z</updated>
<author>
<name>Joe Simmons-Talbott</name>
</author>
<published>2022-06-24T02:18:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=abeba59f93542f57b106e8d27927d36a5b02a822'/>
<id>urn:sha1:abeba59f93542f57b106e8d27927d36a5b02a822</id>
<content type='text'>
Use "unsigned int" rather than bare "unsigned". Reported by checkpatch.pl.

Signed-off-by: Joe Simmons-Talbott &lt;joetalbott@gmail.com&gt;
Link: https://lore.kernel.org/r/20220624021806.1010962-1-joetalbott@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
</feed>
