FAILED: patch "[PATCH] iio: imu: inv_icm42600: Avoid configuring if already" failed to apply to 5.15-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 466f7a2fef2a4e426f809f79845a1ec1aeb558f4
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2025101624-blazing-sharpener-111d@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 466f7a2fef2a4e426f809f79845a1ec1aeb558f4 Mon Sep 17 00:00:00 2001
From: Sean Nyekjaer <[email protected]>
Date: Mon, 1 Sep 2025 09:49:15 +0200
Subject: [PATCH] iio: imu: inv_icm42600: Avoid configuring if already
pm_runtime suspended
Do as in suspend, skip resume configuration steps if the device is already pm_runtime suspended. This avoids reconfiguring a device that is already in the correct low-power state and ensures that pm_runtime handles the power state transitions properly.
drivers/iio/imu/inv_icm42600/inv_icm42600_core.c +6 -5
@@ -837,17 +837,15 @@ static int inv_icm42600_suspend(struct device *dev)struct device *accel_dev;bool wakeup;int accel_conf; -int ret; +int ret =0 ;mutex_lock (&st->lock); st->suspended.gyro = st->conf.gyro.mode; st->suspended.accel = st->conf.accel.mode; st->suspended.temp = st->conf.temp_en; -if (pm_runtime_suspended (dev)) { - ret =0 ; +if (pm_runtime_suspended (dev)) goto out_unlock; - }/* disable FIFO data streaming */ if (st->fifo.on) {
@@ -900,10 +898,13 @@ static int inv_icm42600_resume(struct device *dev)struct inv_icm42600_sensor_state *accel_st =iio_priv (st->indio_accel);struct device *accel_dev;bool wakeup; -int ret; +int ret =0 ;mutex_lock (&st->lock); +if (pm_runtime_suspended (dev)) + goto out_unlock; +/* check wakeup capability */ accel_dev = &st->indio_accel->dev; wakeup = st->apex.on &&device_may_wakeup (accel_dev);
Sasha Levin
maintainerPATCH 1/2 iio: imu: inv_icm42600: use = { } instead of memset()
From: David Lechner <[email protected]>
[ Upstream commit 352112e2d9aab6a156c2803ae14eb89a9fd93b7d ]
Use { } instead of memset() to zero-initialize stack memory to simplify the code.
Stable-dep-of: 466f7a2fef2a ("iio: imu: inv_icm42600: Avoid configuring if already pm_runtime suspended")
--- drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 5 ++--- drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-)
drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c +2 -3
@@ -749,7 +749,8 @@ int inv_icm42600_accel_parse_fifo(struct iio_dev *indio_dev)const int8_t *temp;unsigned int odr;int64_t ts_val; -struct inv_icm42600_accel_buffer buffer; +/* buffer is copied to userspace, zeroing it to avoid any data leak */ +struct inv_icm42600_accel_buffer buffer = { };/* parse all fifo packets */ for (i =0 , no =0 ; i < st->fifo.count; i += size, ++no) {
@@ -768,8 +769,6 @@ int inv_icm42600_accel_parse_fifo(struct iio_dev *indio_dev)inv_icm42600_timestamp_apply_odr (ts, st->fifo.period, st->fifo.nb.total, no); -/* buffer is copied to userspace, zeroing it to avoid any data leak */ -memset (&buffer,0 ,sizeof (buffer));memcpy (&buffer.accel, accel,sizeof (buffer.accel));/* convert 8 bits FIFO temperature in high resolution format */ buffer.temp = temp ? (*temp *64 ) :0 ;
drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c +2 -3
@@ -761,7 +761,8 @@ int inv_icm42600_gyro_parse_fifo(struct iio_dev *indio_dev)const int8_t *temp;unsigned int odr;int64_t ts_val; -struct inv_icm42600_gyro_buffer buffer; +/* buffer is copied to userspace, zeroing it to avoid any data leak */ +struct inv_icm42600_gyro_buffer buffer = { };/* parse all fifo packets */ for (i =0 , no =0 ; i < st->fifo.count; i += size, ++no) {
@@ -780,8 +781,6 @@ int inv_icm42600_gyro_parse_fifo(struct iio_dev *indio_dev)inv_icm42600_timestamp_apply_odr (ts, st->fifo.period, st->fifo.nb.total, no); -/* buffer is copied to userspace, zeroing it to avoid any data leak */ -memset (&buffer,0 ,sizeof (buffer));memcpy (&buffer.gyro, gyro,sizeof (buffer.gyro));/* convert 8 bits FIFO temperature in high resolution format */ buffer.temp = temp ? (*temp *64 ) :0 ;
Signature · 1 line
2.51.0
Sasha Levin
maintainerPATCH 2/2 iio: imu: inv_icm42600: Avoid configuring if already pm_runtime suspended
From: Sean Nyekjaer <[email protected]>
[ Upstream commit 466f7a2fef2a4e426f809f79845a1ec1aeb558f4 ]
Do as in suspend, skip resume configuration steps if the device is already pm_runtime suspended. This avoids reconfiguring a device that is already in the correct low-power state and ensures that pm_runtime handles the power state transitions properly.
--- drivers/iio/imu/inv_icm42600/inv_icm42600_core.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/iio/imu/inv_icm42600/inv_icm42600_core.c +6 -5
@@ -680,17 +680,15 @@ EXPORT_SYMBOL_GPL(inv_icm42600_core_probe);static int __maybe_unused inv_icm42600_suspend (struct device *dev) {struct inv_icm42600_state *st =dev_get_drvdata (dev); -int ret; +int ret =0 ;mutex_lock (&st->lock); st->suspended.gyro = st->conf.gyro.mode; st->suspended.accel = st->conf.accel.mode; st->suspended.temp = st->conf.temp_en; -if (pm_runtime_suspended (dev)) { - ret =0 ; +if (pm_runtime_suspended (dev)) goto out_unlock; - }/* disable FIFO data streaming */ if (st->fifo.on) {
@@ -722,10 +720,13 @@ static int __maybe_unused inv_icm42600_resume(struct device *dev)struct inv_icm42600_state *st =dev_get_drvdata (dev);struct inv_icm42600_timestamp *gyro_ts =iio_priv (st->indio_gyro);struct inv_icm42600_timestamp *accel_ts =iio_priv (st->indio_accel); -int ret; +int ret =0 ;mutex_lock (&st->lock); +if (pm_runtime_suspended (dev)) + goto out_unlock; + ret =inv_icm42600_enable_regulator_vddio (st);if (ret) goto out_unlock;
Signature · 1 line
2.51.0