From 5f59d6c904451c573624166d5594bfeb99dfd363 Mon Sep 17 00:00:00 2001 From: Karthikeyan Mani Date: Fri, 6 Sep 2019 14:44:53 -0700 Subject: [PATCH] soc: pinctrl-lpi: Suspend sooner if resume fails If PM runtime resume fails, hardware vote will not happen until it is suspended. So in error scenarios set for a lesser suspend delay so that voting can happen sooner. Change-Id: Ia4175535e45ec291292b8d8656146826ffd05a26 Signed-off-by: Karthikeyan Mani --- soc/pinctrl-lpi.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/soc/pinctrl-lpi.c b/soc/pinctrl-lpi.c index 157e2c54a17b..3aff320ceea1 100644 --- a/soc/pinctrl-lpi.c +++ b/soc/pinctrl-lpi.c @@ -23,6 +23,7 @@ #include "pinctrl-utils.h" #define LPI_AUTO_SUSPEND_DELAY 100 /* delay in msec */ +#define LPI_AUTO_SUSPEND_DELAY_ERROR 1 /* delay in msec */ #define LPI_ADDRESS_SIZE 0x20000 #define LPI_SLEW_ADDRESS_SIZE 0x1000 @@ -824,13 +825,19 @@ int lpi_pinctrl_runtime_resume(struct device *dev) mutex_lock(&state->core_hw_vote_lock); ret = clk_prepare_enable(state->lpass_core_hw_vote); - if (ret < 0) + if (ret < 0) { + pm_runtime_set_autosuspend_delay(dev, + LPI_AUTO_SUSPEND_DELAY_ERROR); dev_err(dev, "%s:lpass core hw island enable failed\n", __func__); - else + goto exit; + } else { state->core_hw_vote_status = true; + } pm_runtime_set_autosuspend_delay(dev, LPI_AUTO_SUSPEND_DELAY); + +exit: mutex_unlock(&state->core_hw_vote_lock); return 0; }