[PATCH togreg v3 0/2] iio: imu: inv_icm42607: fix PM error handling
Linmao Li <[email protected]>
| Newsgroups | org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
The recently queued ICM-42607 PM support has two error paths that can leave the PM core's state inconsistent with the device. Patch 1 propagates sensor shutdown failures from runtime suspend, matching the behavior of the sibling ICM-42600 driver. Patch 2 ensures that system resume restores runtime PM management on both of its error paths, so that a failed resume does not leave runtime PM disabled for good. Changes since v2: - Patch 2: restructure inv_icm42607_resume() along the lines Andy suggested. No functional change. - Dropped the redundant hand-written base note; --base already emits base-commit:. - Patch 1 is unchanged. Changes since v1: - Patch 2: split the device side of inv_icm42607_resume() into a helper so the PM bookkeeping stays in the wrapper. No functional change. - Rebased onto the current togreg head. On the ordering question from the v2 review: pm_runtime_force_suspend() runs the .runtime_suspend callback, which writes PWR_MGMT0 over the bus, so it has to happen while vddio is still enabled - that is, before inv_icm42607_disable_vddio_reg() in .suspend(). .resume() then unwinds in the opposite order, which is why pm_runtime_force_resume() comes last there. That ordering is what the driver already does; this series does not change it. The Fixes commit is in iio.git togreg and has been included in linux-next. It has not reached mainline. Both patches were compile-tested with W=1 and checked with smatch. No ICM-42607 hardware or fault-injection setup was available. Linmao Li (2): iio: imu: inv_icm42607: propagate runtime suspend errors iio: imu: inv_icm42607: restore runtime PM on system resume errors .../iio/imu/inv_icm42607/inv_icm42607_core.c | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) base-commit: 350d1fb9204b13c5f95e511e98b8bcb47574d425 -- 2.25.1