<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/iio, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/iio?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/iio?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-10-17T07:51:26Z</updated>
<entry>
<title>iio: bmc150-accel-core: Fix unsafe buffer attributes</title>
<updated>2022-10-17T07:51:26Z</updated>
<author>
<name>Matti Vaittinen</name>
<email>mazziesaccount@gmail.com</email>
</author>
<published>2022-10-03T08:11:12Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a10a0f385ab8af08ddb762ac3eca11e1b6d1fe69'/>
<id>urn:sha1:a10a0f385ab8af08ddb762ac3eca11e1b6d1fe69</id>
<content type='text'>
The iio_triggered_buffer_setup_ext() was 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().

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 IIO_CONST_ATTRs from the driver to IIO_DEVICE_ATTR in order
to prevent the invalid memory access.

Signed-off-by: Matti Vaittinen &lt;mazziesaccount@gmail.com&gt;
Fixes: 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr")
Link: https://lore.kernel.org/r/cf8a56658fc38db8bed64f456d898f5ad5a2814f.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: adxl367: Fix unsafe buffer attributes</title>
<updated>2022-10-17T07:51:26Z</updated>
<author>
<name>Matti Vaittinen</name>
<email>mazziesaccount@gmail.com</email>
</author>
<published>2022-10-03T08:10:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=5e23b33d1e84f04c80da6f1d89cbb3d3a3f81e01'/>
<id>urn:sha1:5e23b33d1e84f04c80da6f1d89cbb3d3a3f81e01</id>
<content type='text'>
The devm_iio_kfifo_buffer_setup_ext() was 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().

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 IIO_CONST_ATTRs from the driver to IIO_DEVICE_ATTR in order
to prevent the invalid memory access.

Signed-off-by: Matti Vaittinen &lt;mazziesaccount@gmail.com&gt;
Fixes: 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr")
Cc: &lt;Stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/2e2d9ec34fb1df8ab8e2749199822db8cc91d302.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: adxl372: Fix unsafe buffer attributes</title>
<updated>2022-10-17T07:51:26Z</updated>
<author>
<name>Matti Vaittinen</name>
<email>mazziesaccount@gmail.com</email>
</author>
<published>2022-10-03T08:10:51Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=ab0ee36e90f611f32c3a53afe9dc743de48138e2'/>
<id>urn:sha1:ab0ee36e90f611f32c3a53afe9dc743de48138e2</id>
<content type='text'>
The iio_triggered_buffer_setup_ext() was 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().

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 IIO_CONST_ATTRs from the driver to IIO_DEVICE_ATTR in order
to prevent the invalid memory access.

Signed-off-by: Matti Vaittinen &lt;mazziesaccount@gmail.com&gt;
Fixes: 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr")
Cc: &lt;Stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/19158499623cdf7f9c5efae1f13c9f1a918ff75f.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: at91-sama5d2_adc: Fix unsafe buffer attributes</title>
<updated>2022-10-17T07:51:26Z</updated>
<author>
<name>Matti Vaittinen</name>
<email>mazziesaccount@gmail.com</email>
</author>
<published>2022-10-03T08:11:33Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=54246b9034da08087ceb2083478c0d13403e12b4'/>
<id>urn:sha1:54246b9034da08087ceb2083478c0d13403e12b4</id>
<content type='text'>
The iio_triggered_buffer_setup_ext() was 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().

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 IIO_CONST_ATTRs from the driver to IIO_DEVICE_ATTR in order
to prevent the invalid memory access.

Signed-off-by: Matti Vaittinen &lt;mazziesaccount@gmail.com&gt;
Fixes: 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr")
Tested-by: Claudiu Beznea &lt;claudiu.beznea@microchip.com&gt;
Link: https://lore.kernel.org/r/be69775aa302159f088b8b91894e6ec449bca65b.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: temperature: ltc2983: allocate iio channels once</title>
<updated>2022-10-17T07:51:26Z</updated>
<author>
<name>Cosmin Tanislav</name>
<email>cosmin.tanislav@analog.com</email>
</author>
<published>2022-10-14T12:37:22Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=4132f19173211856d35180958d2754f5c56d520a'/>
<id>urn:sha1:4132f19173211856d35180958d2754f5c56d520a</id>
<content type='text'>
Currently, every time the device wakes up from sleep, the
iio_chan array is reallocated, leaking the previous one
until the device is removed (basically never).

Move the allocation to the probe function to avoid this.

Signed-off-by: Cosmin Tanislav &lt;cosmin.tanislav@analog.com&gt;
Fixes: f110f3188e563 ("iio: temperature: Add support for LTC2983")
Cc: &lt;Stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20221014123724.1401011-2-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: adc: stm32-adc: fix channel sampling time init</title>
<updated>2022-10-17T07:51:26Z</updated>
<author>
<name>Olivier Moysan</name>
<email>olivier.moysan@foss.st.com</email>
</author>
<published>2022-10-12T14:21:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=174dac5dc800e4e2e4552baf6340846a344d01a3'/>
<id>urn:sha1:174dac5dc800e4e2e4552baf6340846a344d01a3</id>
<content type='text'>
Fix channel init for ADC generic channel bindings.
In generic channel initialization, stm32_adc_smpr_init() is called to
initialize channel sampling time. The "st,min-sample-time-ns" property
is an optional property. If it is not defined, stm32_adc_smpr_init() is
currently skipped.
However stm32_adc_smpr_init() must always be called, to force a minimum
sampling time for the internal channels, as the minimum sampling time is
known. Make stm32_adc_smpr_init() call unconditional.

Fixes: 796e5d0b1e9b ("iio: adc: stm32-adc: use generic binding for sample-time")
Signed-off-by: Olivier Moysan &lt;olivier.moysan@foss.st.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Reviewed-by: Fabrice Gasnier &lt;fabrice.gasnier@foss.st.com&gt;
Link: https://lore.kernel.org/r/20221012142205.13041-2-olivier.moysan@foss.st.com
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: adc: mcp3911: mask out device ID in debug prints</title>
<updated>2022-10-17T07:51:26Z</updated>
<author>
<name>Marcus Folkesson</name>
<email>marcus.folkesson@gmail.com</email>
</author>
<published>2022-10-10T19:46:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=aa6c77d05eb1c57ee5b95a7b83a39384c37df4d9'/>
<id>urn:sha1:aa6c77d05eb1c57ee5b95a7b83a39384c37df4d9</id>
<content type='text'>
The Device ID should not be included when printing register.

Signed-off-by: Marcus Folkesson &lt;marcus.folkesson@gmail.com&gt;
Link: https://lore.kernel.org/r/20221010194654.676525-1-marcus.folkesson@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: adc: mcp3911: use correct id bits</title>
<updated>2022-10-17T07:51:26Z</updated>
<author>
<name>Marcus Folkesson</name>
<email>marcus.folkesson@gmail.com</email>
</author>
<published>2022-10-10T19:46:41Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=815f1647a603a822d66630bbe22cab4bc097c8c3'/>
<id>urn:sha1:815f1647a603a822d66630bbe22cab4bc097c8c3</id>
<content type='text'>
The device ID should be shifted 6 bits to left according to datasheet.

Fixes: 3a89b289df5d ("iio: adc: add support for mcp3911")
Signed-off-by: Marcus Folkesson &lt;marcus.folkesson@gmail.com&gt;
Link: https://lore.kernel.org/r/20221010194641.676484-1-marcus.folkesson@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: adc: mcp3911: return proper error code on failure to allocate trigger</title>
<updated>2022-10-17T07:51:26Z</updated>
<author>
<name>Marcus Folkesson</name>
<email>marcus.folkesson@gmail.com</email>
</author>
<published>2022-09-27T09:25:37Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a83695a666eb3541873c3c9734ec4e1d10ca2d7f'/>
<id>urn:sha1:a83695a666eb3541873c3c9734ec4e1d10ca2d7f</id>
<content type='text'>
smatch warnings:
drivers/iio/adc/mcp3911.c:441 mcp3911_probe() warn: passing zero to 'PTR_ERR'

Fixes: 08a65f61db69 ("iio: adc: mcp3911: add support for interrupts")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Marcus Folkesson &lt;marcus.folkesson@gmail.com&gt;
Link: https://lore.kernel.org/r/20220927092537.94663-1-marcus.folkesson@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: adc: mcp3911: fix sizeof() vs ARRAY_SIZE() bug</title>
<updated>2022-10-17T07:51:26Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2022-09-26T09:10:37Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=7578847b5949db3a75163908bd99c46d27e8b19f'/>
<id>urn:sha1:7578847b5949db3a75163908bd99c46d27e8b19f</id>
<content type='text'>
This code uses sizeof() instead of ARRAY_SIZE() so it reads beyond the
end of the mcp3911_osr_table[] array.

Fixes: 6d965885f4ea ("iio: adc: mcp3911: add support for oversampling ratio")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Marcus Folkesson &lt;marcus.folkesson@gmail.com&gt;
Link: https://lore.kernel.org/r/YzFsjY3xLHUQMjVr@kili
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
</feed>
