<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/iio/inkern.c, branch linux-6.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-01-13T05:17:49Z</updated>
<entry>
<title>Merge 6.13-rc4 into char-misc-next</title>
<updated>2025-01-13T05:17:49Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2025-01-13T05:17:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=be887fcad3f18031232eabcb398d009a3fc3ef61'/>
<id>urn:sha1:be887fcad3f18031232eabcb398d009a3fc3ef61</id>
<content type='text'>
We need the IIO fixes in here as well, and it resolves a merge conflict
in:
	drivers/iio/adc/ti-ads1119.c

Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio: consumers: ensure read buffers for labels and ext_info are page aligned</title>
<updated>2024-12-11T19:20:49Z</updated>
<author>
<name>Matteo Martelli</name>
</author>
<published>2024-12-02T15:11:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=22ccb0a1c57c436de899ccd3170d6d2ce7238836'/>
<id>urn:sha1:22ccb0a1c57c436de899ccd3170d6d2ce7238836</id>
<content type='text'>
Attributes of iio providers are exposed via sysfs. Typically, providers
pass attribute values to the iio core, which handles formatting and
printing to sysfs. However, some attributes, such as labels or extended
info, are directly formatted and printed to sysfs by provider drivers
using sysfs_emit() and sysfs_emit_at(). These helpers assume the read
buffer, allocated by sysfs fop, is page-aligned. When these attributes
are accessed by consumer drivers, the read buffer is allocated by the
consumer and may not be page-aligned, leading to failures in the
provider's callback that utilizes sysfs_emit*.

Add a check to ensure that read buffers for labels and external info
attributes are page-aligned. Update the prototype documentation as well.

Signed-off-by: Matteo Martelli &lt;matteomartelli3@gmail.com&gt;
Link: https://patch.msgid.link/20241202-iio-kmalloc-align-v1-1-aa9568c03937@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: inkern: call iio_device_put() only on mapped devices</title>
<updated>2024-12-08T16:49:09Z</updated>
<author>
<name>Joe Hattori</name>
</author>
<published>2024-12-04T11:13:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=64f43895b4457532a3cc524ab250b7a30739a1b1'/>
<id>urn:sha1:64f43895b4457532a3cc524ab250b7a30739a1b1</id>
<content type='text'>
In the error path of iio_channel_get_all(), iio_device_put() is called
on all IIO devices, which can cause a refcount imbalance. Fix this error
by calling iio_device_put() only on IIO devices whose refcounts were
previously incremented by iio_device_get().

Fixes: 314be14bb893 ("iio: Rename _st_ functions to loose the bit that meant the staging version.")
Signed-off-by: Joe Hattori &lt;joe@pf.is.s.u-tokyo.ac.jp&gt;
Link: https://patch.msgid.link/20241204111342.1246706-1-joe@pf.is.s.u-tokyo.ac.jp
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'iio-fixes-for-6.12c' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next</title>
<updated>2024-11-08T15:46:34Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2024-11-08T15:46:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=389c4245f5491e343b1dd07d65923ac372679037'/>
<id>urn:sha1:389c4245f5491e343b1dd07d65923ac372679037</id>
<content type='text'>
Jonathan writes:

IIO: 3rd set of fixes for the 6.12 cycle

Usual mixed bag of new issues from this cycle and ancient bugs
recently noticed.

core
- Fix wrong fwnode handle if __fwnode_iio_channel_get_by_name()
  looks at parents of the provider node.
core,backend
- Fix a wrong pointer error check.
gts library
- Fix plausible corner case where the value returned was not set.
- Avoid near infinite loop if the size of the table is 0.
  (neither are an issue for current drivers).
adi,ad4000
- Fix reading of unsigned channels that were returning garbage.
adi,ad7780
- Prevent a division by zero.
adi,ad7923
- Fix buffer overflows in arrays that were not resized when devices
  with more channels were added to the driver.
adi,adxl380
- Check only for negative error codes rather than including the
  positive channel read values in an error check.
invense,common
- Fix an issue where changing the sampling rate to another value and
  back again whilst the FIFO was off would not update things correctly.
kionix,kx022a
- Fix failure to sign extend value read from device.

* tag 'iio-fixes-for-6.12c' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
  iio: Fix fwnode_handle in __fwnode_iio_channel_get_by_name()
  iio: accel: adxl380: fix raw sample read
  iio: accel: kx022a: Fix raw read format
  iio: gts: fix infinite loop for gain_to_scaletables()
  iio: gts: Fix uninitialized symbol 'ret'
  iio: adc: ad4000: fix reading unsigned data
  ad7780: fix division by zero in ad7780_write_raw()
  iio: adc: ad7923: Fix buffer overflow for tx_buf and ring_xfer
  iio: backend: fix wrong pointer passed to IS_ERR()
  iio: invensense: fix multiple odr switch when FIFO is off
</content>
</entry>
<entry>
<title>iio: Fix fwnode_handle in __fwnode_iio_channel_get_by_name()</title>
<updated>2024-11-02T15:18:52Z</updated>
<author>
<name>Zicheng Qu</name>
</author>
<published>2024-11-02T09:25:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3993ca4add248f0f853f54f9273a7de850639f33'/>
<id>urn:sha1:3993ca4add248f0f853f54f9273a7de850639f33</id>
<content type='text'>
In the fwnode_iio_channel_get_by_name(), iterating over parent nodes to
acquire IIO channels via fwnode_for_each_parent_node(). The variable
chan was mistakenly attempted on the original node instead of the
current parent node. This patch corrects the logic to ensure that
__fwnode_iio_channel_get_by_name() is called with the correct parent
node.

Cc: stable@vger.kernel.org # v6.6+
Fixes: 1e64b9c5f9a0 ("iio: inkern: move to fwnode properties")
Signed-off-by: Zicheng Qu &lt;quzicheng@huawei.com&gt;
Link: https://patch.msgid.link/20241102092525.2389952-1-quzicheng@huawei.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: adc: Constify struct iio_map</title>
<updated>2024-09-30T08:21:02Z</updated>
<author>
<name>Christophe JAILLET</name>
</author>
<published>2024-09-07T17:24:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=faf178607772f28006e403d7bab6c4217d4ee447'/>
<id>urn:sha1:faf178607772f28006e403d7bab6c4217d4ee447</id>
<content type='text'>
'struct iio_map' are not modified in these drivers.

Constifying this structure moves some data to a read-only section, so
increase overall security.

In order to do it, the prototype of iio_map_array_register() and
devm_iio_map_array_register(), and a few structures that hold a
"struct iio_map *" need to be adjusted.

On a x86_64, with allmodconfig, as an example:
Before:
======
   text	   data	    bss	    dec	    hex	filename
  21086	    760	      0	  21846	   5556	drivers/iio/adc/axp20x_adc.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
  21470	    360	      0	  21830	   5546	drivers/iio/adc/axp20x_adc.o
  33842	   1697	    384	  35923	   8c53	drivers/iio/addac/ad74413r.o

--
Compile tested only

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Link: https://patch.msgid.link/5729dc3cc3892ecf0d8ea28c5f7307b34e27493e.1725729801.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: fix scale application in iio_convert_raw_to_processed_unlocked</title>
<updated>2024-08-03T15:29:32Z</updated>
<author>
<name>Matteo Martelli</name>
</author>
<published>2024-07-30T08:11:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8a3dcc970dc57b358c8db2702447bf0af4e0d83a'/>
<id>urn:sha1:8a3dcc970dc57b358c8db2702447bf0af4e0d83a</id>
<content type='text'>
When the scale_type is IIO_VAL_INT_PLUS_MICRO or IIO_VAL_INT_PLUS_NANO
the scale passed as argument is only applied to the fractional part of
the value. Fix it by also multiplying the integer part by the scale
provided.

Fixes: 48e44ce0f881 ("iio:inkern: Add function to read the processed value")
Signed-off-by: Matteo Martelli &lt;matteomartelli3@gmail.com&gt;
Link: https://patch.msgid.link/20240730-iio-fix-scale-v1-1-6246638c8daa@gmail.com
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: Add iio_read_channel_label to inkern API</title>
<updated>2024-06-28T19:06:56Z</updated>
<author>
<name>Sean Anderson</name>
</author>
<published>2024-06-24T17:46:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0214b27fc949a7bcaf57e71a7f9f534d6481d08b'/>
<id>urn:sha1:0214b27fc949a7bcaf57e71a7f9f534d6481d08b</id>
<content type='text'>
It can be convenient for other in-kernel drivers to reuse IIO channel
labels. Export the iio_read_channel_label function to allow this. The
signature is different depending on where we are calling it from, so
the meat is moved to do_iio_read_channel_label.

Signed-off-by: Sean Anderson &lt;sean.anderson@linux.dev&gt;
Acked-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Link: https://patch.msgid.link/20240624174601.1527244-2-sean.anderson@linux.dev
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'v6.10-rc4' into char-misc-next</title>
<updated>2024-06-17T06:31:12Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2024-06-17T06:31:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=20460472952043a4735e9abc1fd9de8e024d1c9e'/>
<id>urn:sha1:20460472952043a4735e9abc1fd9de8e024d1c9e</id>
<content type='text'>
We need the char-misc and iio fixes in here as well to build on top of.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver: iio: add missing checks on iio_info's callback access</title>
<updated>2024-06-13T18:19:22Z</updated>
<author>
<name>Julien Stephan</name>
</author>
<published>2024-05-30T09:22:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c4ec8dedca961db056ec85cb7ca8c9f7e2e92252'/>
<id>urn:sha1:c4ec8dedca961db056ec85cb7ca8c9f7e2e92252</id>
<content type='text'>
Some callbacks from iio_info structure are accessed without any check, so
if a driver doesn't implement them trying to access the corresponding
sysfs entries produce a kernel oops such as:

[ 2203.527791] Unable to handle kernel NULL pointer dereference at virtual address 00000000 when execute
[...]
[ 2203.783416] Call trace:
[ 2203.783429]  iio_read_channel_info_avail from dev_attr_show+0x18/0x48
[ 2203.789807]  dev_attr_show from sysfs_kf_seq_show+0x90/0x120
[ 2203.794181]  sysfs_kf_seq_show from seq_read_iter+0xd0/0x4e4
[ 2203.798555]  seq_read_iter from vfs_read+0x238/0x2a0
[ 2203.802236]  vfs_read from ksys_read+0xa4/0xd4
[ 2203.805385]  ksys_read from ret_fast_syscall+0x0/0x54
[ 2203.809135] Exception stack(0xe0badfa8 to 0xe0badff0)
[ 2203.812880] dfa0:                   00000003 b6f10f80 00000003 b6eab000 00020000 00000000
[ 2203.819746] dfc0: 00000003 b6f10f80 7ff00000 00000003 00000003 00000000 00020000 00000000
[ 2203.826619] dfe0: b6e1bc88 bed80958 b6e1bc94 b6e1bcb0
[ 2203.830363] Code: bad PC value
[ 2203.832695] ---[ end trace 0000000000000000 ]---

Reviewed-by: Nuno Sa &lt;nuno.sa@analog.com&gt;
Signed-off-by: Julien Stephan &lt;jstephan@baylibre.com&gt;
Link: https://lore.kernel.org/r/20240530-iio-core-fix-segfault-v3-1-8b7cd2a03773@baylibre.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
</feed>
