From: <gregkh@linuxfoundation.org>
To: kapoorarnav43@gmail.com,jean-baptiste.maneyrol@tdk.com,jonathan.cameron@oss.qualcomm.com
Cc: <stable@vger.kernel.org>
Subject: FAILED: patch "[PATCH] iio: imu: inv_mpu6050: fix swapped accel and gyro startup" failed to apply to 5.15-stable tree
Date: Wed, 25 Nov 2026 13:22:18 +0100 [thread overview]
Message-ID: <2026112518-eternal-joyfully-573d@gregkh> (raw)
The 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 <stable@vger.kernel.org>.
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 3a5e2ca34cadd9d5993064884aa5b9c4f6d71dff
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026112518-eternal-joyfully-573d@gregkh' --subject-prefix 'PATCH 5.15.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3a5e2ca34cadd9d5993064884aa5b9c4f6d71dff Mon Sep 17 00:00:00 2001
From: Arnav Kapoor <kapoorarnav43@gmail.com>
Date: Sun, 11 Oct 2026 10:27:04 +0530
Subject: [PATCH] iio: imu: inv_mpu6050: fix swapped accel and gyro startup
times
struct inv_mpu6050_hw declares startup_time as { accel, gyro }, but
every entry of hw_info[] initializes it positionally as
{ *_GYRO_STARTUP_TIME, *_ACCEL_STARTUP_TIME }, so the two values are
swapped for all chips.
inv_mpu6050_switch_engine() waits for startup_time.gyro after enabling
the gyroscope, so it waits for the accelerometer startup time instead,
e.g. 20 ms instead of 60 ms on MPU6050 and 20 ms instead of 100 ms on
ICM20602, and the first gyroscope samples can be read before the sensor
has settled. Enabling only the accelerometer waits longer than needed.
Use designated initializers, so each value is assigned to the member it
is named after.
Fixes: e46a36d92da0 ("Add startup time for each chip using inv_mpu6050 driver")
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
index 1614f49be66c..7265a3c3de05 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -150,7 +150,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6050,
.fifo_size = 1024,
.temp = {INV_MPU6050_TEMP_OFFSET, INV_MPU6050_TEMP_SCALE},
- .startup_time = {INV_MPU6050_GYRO_STARTUP_TIME, INV_MPU6050_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6050_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6050_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU6500_WHOAMI_VALUE,
@@ -159,7 +162,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU6515_WHOAMI_VALUE,
@@ -168,7 +174,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU6880_WHOAMI_VALUE,
@@ -177,7 +186,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 4096,
.temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU6000_WHOAMI_VALUE,
@@ -186,7 +198,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6050,
.fifo_size = 1024,
.temp = {INV_MPU6050_TEMP_OFFSET, INV_MPU6050_TEMP_SCALE},
- .startup_time = {INV_MPU6050_GYRO_STARTUP_TIME, INV_MPU6050_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6050_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6050_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU9150_WHOAMI_VALUE,
@@ -195,7 +210,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6050,
.fifo_size = 1024,
.temp = {INV_MPU6050_TEMP_OFFSET, INV_MPU6050_TEMP_SCALE},
- .startup_time = {INV_MPU6050_GYRO_STARTUP_TIME, INV_MPU6050_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6050_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6050_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU9250_WHOAMI_VALUE,
@@ -204,7 +222,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU9255_WHOAMI_VALUE,
@@ -213,7 +234,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20608_WHOAMI_VALUE,
@@ -222,7 +246,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20608D_WHOAMI_VALUE,
@@ -231,7 +258,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20609_WHOAMI_VALUE,
@@ -240,7 +270,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 4 * 1024,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20689_WHOAMI_VALUE,
@@ -249,7 +282,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 4 * 1024,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20600_WHOAMI_VALUE,
@@ -258,7 +294,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 1008,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_ICM20602_GYRO_STARTUP_TIME, INV_ICM20602_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_ICM20602_ACCEL_STARTUP_TIME,
+ .gyro = INV_ICM20602_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20602_WHOAMI_VALUE,
@@ -267,7 +306,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 1008,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_ICM20602_GYRO_STARTUP_TIME, INV_ICM20602_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_ICM20602_ACCEL_STARTUP_TIME,
+ .gyro = INV_ICM20602_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20690_WHOAMI_VALUE,
@@ -276,7 +318,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 1024,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_ICM20690_GYRO_STARTUP_TIME, INV_ICM20690_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_ICM20690_ACCEL_STARTUP_TIME,
+ .gyro = INV_ICM20690_GYRO_STARTUP_TIME,
+ },
},
{ .whoami = INV_IAM20380_WHOAMI_VALUE,
.name = "IAM20380",
@@ -284,7 +329,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_IAM20680_WHOAMI_VALUE,
@@ -293,7 +341,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_IAM20680HP_WHOAMI_VALUE,
@@ -302,7 +353,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 4 * 1024,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_IAM20680HT_WHOAMI_VALUE,
@@ -311,7 +365,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 4 * 1024,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
};
reply other threads:[~2026-11-25 12:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2026112518-eternal-joyfully-573d@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=jean-baptiste.maneyrol@tdk.com \
--cc=jonathan.cameron@oss.qualcomm.com \
--cc=kapoorarnav43@gmail.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox