iio: imu: inv_icm45600: fix regulator put warning when probe fails
Subsystems (3)
PATCH v2 1/1 iio: imu: inv_icm45600: fix regulator put warning when probe fails
When the driver probe fails we encounter a regulator put warning because vddio regulator is not stopped before release. The issue comes from pm_runtime not already setup when core probe fails and the vddio regulator disable callback is called.
Fix the issue by setting pm_runtime active early before vddio regulator resource cleanup. This requires to cut pm_runtime set_active and enable in 2 function calls.
---
Changes in v2:
- Rework patch to move pm_runtime set active early.
- Requires to cut pm_runtime set active and enable in 2 functions.
- Link to v1: https://lore.kernel.org/r/20260205-inv-icm45600-fix-regulator-put-warning-v1-1-314ec12512cb@tdk.com
--- drivers/iio/imu/inv_icm45600/inv_icm45600_core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/iio/imu/inv_icm45600/inv_icm45600_core.c +6 -1
@@ -744,6 +744,11 @@ int inv_icm45600_core_probe(struct regmap *regmap, const struct inv_icm45600_chi*/ fsleep (5 *USEC_PER_MSEC ); +/* set pm_runtime active early for disable vddio resource cleanup */ + ret =pm_runtime_set_active (dev); +if (ret) +return ret; + ret =inv_icm45600_enable_regulator_vddio (st);if (ret)return ret;
@@ -776,7 +781,7 @@ int inv_icm45600_core_probe(struct regmap *regmap, const struct inv_icm45600_chiif (ret)return ret; - ret =devm_pm_runtime_set_active_enabled (dev); + ret =devm_pm_runtime_enable (dev);if (ret)return ret;
---
base-commit: d820183f371d9aa8517a1cd21fe6edacf0f94b7f
change-id: 20260205-inv-icm45600-fix-regulator-put-warning-7c45a49c4c53
Best regards,
Signature · 1 line
Jean-Baptiste Maneyrol <[email protected]>
Quoted 7 lines · On Tue, 17 Feb 2026 11:44:50 +0100 Jean-Baptiste Maneyrol via B4 Relay…
From: Jean-Baptiste Maneyrol <[email protected]>
When the driver probe fails we encounter a regulator put warning because vddio regulator is not stopped before release. The issue comes from
pm_runtimenot already setup when core probe fails and the vddio regulator disable callback is called.
Quoted 7 lines
Fix the issue by setting
pm_runtimeactive early before vddio regulator resource cleanup. This requires to cutpm_runtimeset_activeand enable in 2 function calls.Fixes 7ff021a3faca ("iio: imu: inv_icm45600: add new inv_icm45600 driver")Signed-off-by Jean-Baptiste Maneyrol <[email protected]>
Applied to the fixes-togreg branch of iio.git.
Note I'll rebase that on rc1 once available and then spin a pull request.
Thanks,
Jonathan
Quoted 40 lines
---
Changes in v2:
- Rework patch to movepm_runtimeset active early.
- Requires to cutpm_runtimeset active and enable in 2 functions.
- Link to v1: https://lore.kernel.org/r/20260205-inv-icm45600-fix-regulator-put-warning-v1-1-314ec12512cb@tdk.com--- drivers/iio/imu/inv_icm45600/inv_icm45600_core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/iio/imu/inv_icm45600/inv_icm45600_core.c +6
-2@@ -744,6 +744,11 @@ int inv_icm45600_core_probe(struct regmap *regmap, const struct inv_icm45600_chi*/ fsleep (5 *USEC_PER_MSEC ); +/* set pm_runtime active early for disable vddio resource cleanup */ + ret =pm_runtime_set_active (dev); +if (ret) +return ret; + ret =inv_icm45600_enable_regulator_vddio (st);if (ret)return ret;@@ -776,7 +781,7 @@ int inv_icm45600_core_probe(struct regmap *regmap, const struct inv_icm45600_chiif (ret)return ret; - ret =devm_pm_runtime_set_active_enabled (dev); + ret =devm_pm_runtime_enable (dev);if (ret)return ret; ---base-commit:
d820183f371d9aa8517a1cd21fe6edacf0f94b7f
change-id: 20260205-inv-icm45600-fix-regulator-put-warning-7c45a49c4c53Best regards,