<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/iio/imu, branch linux-5.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-06-04T12:32:27Z</updated>
<entry>
<title>iio: imu: st_lsm6dsx: fix possible lockup in st_lsm6dsx_read_tagged_fifo</title>
<updated>2025-06-04T12:32:27Z</updated>
<author>
<name>Silvano Seva</name>
</author>
<published>2025-03-11T08:49:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4db7d923a8c298788181b796f71adf6ca499f966'/>
<id>urn:sha1:4db7d923a8c298788181b796f71adf6ca499f966</id>
<content type='text'>
commit 8114ef86e2058e2554111b793596f17bee23fa15 upstream.

Prevent st_lsm6dsx_read_tagged_fifo from falling in an infinite loop in
case pattern_len is equal to zero and the device FIFO is not empty.

Fixes: 801a6e0af0c6 ("iio: imu: st_lsm6dsx: add support to LSM6DSO")
Signed-off-by: Silvano Seva &lt;s.seva@4sigma.it&gt;
Acked-by: Lorenzo Bianconi &lt;lorenzo@kernel.org&gt;
Link: https://patch.msgid.link/20250311085030.3593-4-s.seva@4sigma.it
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: imu: st_lsm6dsx: fix possible lockup in st_lsm6dsx_read_fifo</title>
<updated>2025-06-04T12:32:27Z</updated>
<author>
<name>Silvano Seva</name>
</author>
<published>2025-03-11T08:49:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f06a1a1954527cc4ed086d926c81ff236b2adde9'/>
<id>urn:sha1:f06a1a1954527cc4ed086d926c81ff236b2adde9</id>
<content type='text'>
commit 159ca7f18129834b6f4c7eae67de48e96c752fc9 upstream.

Prevent st_lsm6dsx_read_fifo from falling in an infinite loop in case
pattern_len is equal to zero and the device FIFO is not empty.

Fixes: 290a6ce11d93 ("iio: imu: add support to lsm6dsx driver")
Signed-off-by: Silvano Seva &lt;s.seva@4sigma.it&gt;
Acked-by: Lorenzo Bianconi &lt;lorenzo@kernel.org&gt;
Link: https://patch.msgid.link/20250311085030.3593-2-s.seva@4sigma.it
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: imu: kmx61: fix information leak in triggered buffer</title>
<updated>2025-02-01T17:18:48Z</updated>
<author>
<name>Javier Carrasco</name>
</author>
<published>2024-11-25T21:16:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0871eb8d700b33dd7fa86c80630d62ddaef58c2c'/>
<id>urn:sha1:0871eb8d700b33dd7fa86c80630d62ddaef58c2c</id>
<content type='text'>
commit 6ae053113f6a226a2303caa4936a4c37f3bfff7b upstream.

The 'buffer' local array is used to push data to user space from a
triggered buffer, but it does not set values for inactive channels, as
it only uses iio_for_each_active_channel() to assign new values.

Initialize the array to zero before using it to avoid pushing
uninitialized information to userspace.

Cc: stable@vger.kernel.org
Fixes: c3a23ecc0901 ("iio: imu: kmx61: Add support for data ready triggers")
Signed-off-by: Javier Carrasco &lt;javier.carrasco.cruz@gmail.com&gt;
Link: https://patch.msgid.link/20241125-iio_memset_scan_holes-v1-5-0cb6e98d895c@gmail.com
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: imu: inv_mpu6050: fix an error code problem in inv_mpu6050_read_raw</title>
<updated>2024-01-08T10:29:45Z</updated>
<author>
<name>Su Hui</name>
</author>
<published>2023-10-30T02:02:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a85d6aa2b5550ddb33ac03bca00cdcda59438b32'/>
<id>urn:sha1:a85d6aa2b5550ddb33ac03bca00cdcda59438b32</id>
<content type='text'>
[ Upstream commit c3df0e29fb7788c4b3ddf37d5ed87dda2b822943 ]

inv_mpu6050_sensor_show() can return -EINVAL or IIO_VAL_INT. Return the
true value rather than only return IIO_VAL_INT.

Fixes: d5098447147c ("iio: imu: mpu6050: add calibration offset support")
Signed-off-by: Su Hui &lt;suhui@nfschina.com&gt;
Link: https://lore.kernel.org/r/20231030020218.65728-1-suhui@nfschina.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>iio: Fix error handling for PM</title>
<updated>2022-03-02T10:41:12Z</updated>
<author>
<name>Miaoqian Lin</name>
</author>
<published>2022-01-06T11:23:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a28f8dbd474a652a49120aa21514a2596b699e20'/>
<id>urn:sha1:a28f8dbd474a652a49120aa21514a2596b699e20</id>
<content type='text'>
commit 632fe0bb8c5b9c06ec961f575ee42a6fff5eceeb upstream.

The pm_runtime_enable will increase power disable depth.
If the probe fails, we should use pm_runtime_disable() to balance
pm_runtime_enable(). In the PM Runtime docs:
    Drivers in -&gt;remove() callback should undo the runtime PM changes done
    in -&gt;probe(). Usually this means calling pm_runtime_disable(),
    pm_runtime_dont_use_autosuspend() etc.
We should do this in error handling.

Fix this problem for the following drivers: bmc150, bmg160, kmx61,
kxcj-1013, mma9551, mma9553.

Fixes: 7d0ead5c3f00 ("iio: Reconcile operation order between iio_register/unregister and pm functions")
Signed-off-by: Miaoqian Lin &lt;linmq006@gmail.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20220106112309.16879-1-linmq006@gmail.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: imu: st_lsm6dsx: Avoid potential array overflow in st_lsm6dsx_set_odr()</title>
<updated>2021-11-26T09:47:16Z</updated>
<author>
<name>Teng Qi</name>
</author>
<published>2021-10-11T11:40:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a9eae47a550e6a52d3729033e4a8d9f44a79e4f'/>
<id>urn:sha1:3a9eae47a550e6a52d3729033e4a8d9f44a79e4f</id>
<content type='text'>
[ Upstream commit 94be878c882d8d784ff44c639bf55f3b029f85af ]

The length of hw-&gt;settings-&gt;odr_table is 2 and ref_sensor-&gt;id is an enum
variable whose value is between 0 and 5.
However, the value ST_LSM6DSX_ID_MAX (i.e. 5) is not caught properly in
 switch (sensor-&gt;id) {

If ref_sensor-&gt;id is ST_LSM6DSX_ID_MAX, an array overflow will ocurrs in
function st_lsm6dsx_check_odr():
  odr_table = &amp;sensor-&gt;hw-&gt;settings-&gt;odr_table[sensor-&gt;id];

and in function st_lsm6dsx_set_odr():
  reg = &amp;hw-&gt;settings-&gt;odr_table[ref_sensor-&gt;id].reg;

To avoid this array overflow, handle ST_LSM6DSX_ID_GYRO explicitly and
return -EINVAL for the default case.

The enum value ST_LSM6DSX_ID_MAX is only present as an easy way to check
the limit and as such is never used, however this is not locally obvious.

Reported-by: TOTE Robot &lt;oslab@tsinghua.edu.cn&gt;
Signed-off-by: Teng Qi &lt;starmiku1207184332@gmail.com&gt;
Acked-by: Lorenzo Bianconi &lt;lorenzo@kernel.org&gt;
Link: https://lore.kernel.org/r/20211011114003.976221-1-starmiku1207184332@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>iio: adis16400: do not return ints in irq handlers</title>
<updated>2021-07-14T14:53:37Z</updated>
<author>
<name>Nuno Sa</name>
</author>
<published>2021-04-22T10:19:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2e088ed6fac1149eb448a7516e2728c96b6a9d44'/>
<id>urn:sha1:2e088ed6fac1149eb448a7516e2728c96b6a9d44</id>
<content type='text'>
[ Upstream commit ab3df79782e7d8a27a58576c9b4e8c6c4879ad79 ]

On an IRQ handler we should not return normal error codes as 'irqreturn_t'
is expected.

Not necessary to apply to stable as the original check cannot fail and
as such the bug cannot actually occur.

Fixes: 5eda3550a3cc1 ("staging:iio:adis16400: Preallocate transfer message")
Reviewed-by: Alexandru Ardelean &lt;ardeleanalex@gmail.com&gt;
Signed-off-by: Nuno Sa &lt;nuno.sa@analog.com&gt;
Link: https://lore.kernel.org/r/20210422101911.135630-3-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>iio: adis_buffer: do not return ints in irq handlers</title>
<updated>2021-07-14T14:53:36Z</updated>
<author>
<name>Nuno Sa</name>
</author>
<published>2021-04-22T10:19:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8271a443e5e4231269ea74e252d4271820f9ca2b'/>
<id>urn:sha1:8271a443e5e4231269ea74e252d4271820f9ca2b</id>
<content type='text'>
[ Upstream commit d877539ad8e8fdde9af69887055fec6402be1a13 ]

On an IRQ handler we should not return normal error codes as 'irqreturn_t'
is expected.

Not necessarily stable material as the old check cannot fail, so it's a bug
we can not hit.

Fixes: ccd2b52f4ac69 ("staging:iio: Add common ADIS library")
Reviewed-by: Alexandru Ardelean &lt;ardeleanalex@gmail.com&gt;
Signed-off-by: Nuno Sa &lt;nuno.sa@analog.com&gt;
Link: https://lore.kernel.org/r/20210422101911.135630-2-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>iio: adis16400: Fix an error code in adis16400_initial_setup()</title>
<updated>2021-03-24T10:26:42Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2021-02-16T19:42:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=87163fbba6d22e00d1a25fd19bee9e68d8a97a56'/>
<id>urn:sha1:87163fbba6d22e00d1a25fd19bee9e68d8a97a56</id>
<content type='text'>
commit a71266e454b5df10d019b06f5ebacd579f76be28 upstream.

This is to silence a new Smatch warning:

    drivers/iio/imu/adis16400.c:492 adis16400_initial_setup()
    warn: sscanf doesn't return error codes

If the condition "if (st-&gt;variant-&gt;flags &amp; ADIS16400_HAS_SLOW_MODE) {"
is false then we return 1 instead of returning 0 and probe will fail.

Fixes: 72a868b38bdd ("iio: imu: check sscanf return value")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Cc: &lt;Stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/YCwgFb3JVG6qrlQ+@mwanda
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: imu: st_lsm6dsx: fix edge-trigger interrupts</title>
<updated>2021-01-17T13:05:34Z</updated>
<author>
<name>Lorenzo Bianconi</name>
</author>
<published>2020-11-14T18:39:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6f367fb1b7ee30988c29fda690a68ce50a762644'/>
<id>urn:sha1:6f367fb1b7ee30988c29fda690a68ce50a762644</id>
<content type='text'>
commit 3f9bce7a22a3f8ac9d885c9d75bc45569f24ac8b upstream

If we are using edge IRQs, new samples can arrive while processing
current interrupt since there are no hw guarantees the irq line
stays "low" long enough to properly detect the new interrupt.
In this case the new sample will be missed.
Polling FIFO status register in st_lsm6dsx_handler_thread routine
allow us to read new samples even if the interrupt arrives while
processing previous data and the timeslot where the line is "low"
is too short to be properly detected.

Fixes: 89ca88a7cdf2 ("iio: imu: st_lsm6dsx: support active-low interrupts")
Fixes: 290a6ce11d93 ("iio: imu: add support to lsm6dsx driver")
Signed-off-by: Lorenzo Bianconi &lt;lorenzo@kernel.org&gt;
Link: https://lore.kernel.org/r/5e93cda7dc1e665f5685c53ad8e9ea71dbae782d.1605378871.git.lorenzo@kernel.org
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
[sudip: manual backport to old irq handler path]
Signed-off-by: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
