Commit ed53604
iio: adc: stm32-adc: fix runtime autosuspend delay when slow polling
When the ADC is runtime suspended and starting a conversion, the stm32-adc
driver calls pm_runtime_get_sync() that gets cascaded to the parent
(e.g. runtime resume of stm32-adc-core driver). This also kicks the
autosuspend delay (e.g. 2s) of the parent.
Once the ADC is active, calling pm_runtime_get_sync() won't kick again the
autosuspend delay for the parent (stm32-adc-core driver) as already active.
Currently, this makes the stm32-adc-core driver go in suspend state
every 2s when doing slow polling. As an example, cat in_voltageY_raw at
0.2s rate), the auto suspend delay for the parent isn't refreshed. Once it
expires, the parent immediately falls into runtime suspended state,
in between two captures. It switches off regulators and so on. They get
switched back on again 0.2s later.
So, add an explicit call to pm_runtime_mark_last_busy() for the parent
driver (stm32-adc-core), synchronously with the child driver (stm32-adc).
Fixes: 9bdbb11 ("iio: adc: stm32-adc: add power management support")
Change-Id: I0bf0a9dafa58cea76f329372d5575ae02bc85888
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/linux-stm32/+/155457
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-by: Olivier MOYSAN <olivier.moysan@st.com>1 parent 6c809e3 commit ed53604
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1641 | 1641 | | |
1642 | 1642 | | |
1643 | 1643 | | |
| 1644 | + | |
1644 | 1645 | | |
1645 | 1646 | | |
1646 | 1647 | | |
| |||
1858 | 1859 | | |
1859 | 1860 | | |
1860 | 1861 | | |
| 1862 | + | |
1861 | 1863 | | |
1862 | 1864 | | |
1863 | 1865 | | |
| |||
2053 | 2055 | | |
2054 | 2056 | | |
2055 | 2057 | | |
| 2058 | + | |
2056 | 2059 | | |
2057 | 2060 | | |
2058 | 2061 | | |
| |||
2210 | 2213 | | |
2211 | 2214 | | |
2212 | 2215 | | |
| 2216 | + | |
2213 | 2217 | | |
2214 | 2218 | | |
2215 | 2219 | | |
| |||
2252 | 2256 | | |
2253 | 2257 | | |
2254 | 2258 | | |
| 2259 | + | |
2255 | 2260 | | |
2256 | 2261 | | |
2257 | 2262 | | |
| |||
2663 | 2668 | | |
2664 | 2669 | | |
2665 | 2670 | | |
| 2671 | + | |
2666 | 2672 | | |
2667 | 2673 | | |
2668 | 2674 | | |
| |||
0 commit comments