ARM: OMAP2+: fix omap_device with noirq_suspend
Subsystems (3)
Andreas Kemnade
maintainerRFC PATCH 1/1 ARM: OMAP2+: fix omap_device with noirq_suspend
Fixes cases where device runtime gets resumed in _suspend but then pm_runtime_force_suspend is used. So the device is disabled, but runtime active in _noirq_suspend leading to duplicate runtime_suspend calls. So rather check for the device state directly to indicate if changes are needed.
This relies on pm_runtime_force_resume being used in a balanced way.
---
This really needs intensive scrutiny but might be a less invasive patch solution better suited for stable and paves the way to get out of the omap_device theatre without too much hurry.
arch/arm/mach-omap2/omap_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-omap2/omap_device.c +1 -1
@@ -393,7 +393,7 @@ static int _od_suspend_noirq(struct device *dev) ret =pm_generic_suspend_noirq (dev); -if (!ret && !pm_runtime_status_suspended (dev)) { +if (!ret && (od->_state ==OMAP_DEVICE_STATE_ENABLED )) {if (pm_generic_runtime_suspend (dev) ==0 ) {omap_device_idle (pdev); od->flags |=OMAP_DEVICE_SUSPENDED ;
Signature · 1 line
2.47.3
Quoted 7 lines · Andreas Kemnade
Fixes cases where device runtime gets resumed in
_suspendbut thenpm_runtime_force_suspendis used. So the device is disabled, but runtime active in_noirq_suspendleading to duplicateruntime_suspendcalls. So rather check for the device state directly to indicate if changes are needed.
This relies onpm_runtime_force_resumebeing used in a balanced way.
Quoted 6 lines
Fixes 7da7fd7e66ac9 ("i2c: omap: wakeup the controller during suspend() callback")Signed-off-by Andreas Kemnade <[email protected]>---
This really needs intensive scrutiny but might be a less invasive patch solution better suited for stable and paves the way to get out of theomap_devicetheatre without too much hurry.
This looks & feels correct to me.
I also tested this (along with my WIP patch for that NEON count mismatch) and I have a very stable suspend/resume on OMAP3.
I tested on omap3-beagle (retention) and omap3-beagle-xm (off-mode) and both are now reliable across multiple suspend/resume sequences with these two patches.
Kevin
Quoted 18 lines
arch/arm/mach-omap2/omap_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/mach-omap2/omap_device.c +1
-1@@ -393,7 +393,7 @@ static int _od_suspend_noirq(struct device *dev) ret =pm_generic_suspend_noirq (dev); -if (!ret && !pm_runtime_status_suspended (dev)) { +if (!ret && (od->_state ==OMAP_DEVICE_STATE_ENABLED )) {if (pm_generic_runtime_suspend (dev) ==0 ) {omap_device_idle (pdev); od->flags |=OMAP_DEVICE_SUSPENDED ;Signature · 1 line
2.47.3
Andreas Kemnade
maintainerQuoted 21 lines · On Tue, 10 Nov 2026 16:22:39 -0800 Kevin Hilman <[email protected]> wrote:
Quoted 7 lines · Andreas Kemnade
Fixes cases where device runtime gets resumed in
_suspendbut thenpm_runtime_force_suspendis used. So the device is disabled, but runtime active in_noirq_suspendleading to duplicateruntime_suspendcalls. So rather check for the device state directly to indicate if changes are needed.
This relies onpm_runtime_force_resumebeing used in a balanced way.Quoted 6 lines
Fixes 7da7fd7e66ac9 ("i2c: omap: wakeup the controller during suspend() callback")Signed-off-by Andreas Kemnade <[email protected]>---
This really needs intensive scrutiny but might be a less invasive patch solution better suited for stable and paves the way to get out of theomap_devicetheatre without too much hurry.This looks & feels correct to me.
I also tested this (along with my WIP patch for that NEON count mismatch) and I have a very stable suspend/resume on OMAP3.
Quoted 7 lines
I tested on omap3-beagle (retention) and omap3-beagle-xm (off-mode) and both are now reliable across multiple suspend/resume sequences with these two patches.
Reviewed-by Kevin Hilman <[email protected]>Tested-by Kevin Hilman <[email protected]>
Then feel free to ignore the RFC and apply this one.
Regards,
Andreas
Quoted 8 lines · Andreas Kemnade
Fixes cases where device runtime gets resumed in
_suspendbut thenpm_runtime_force_suspendis used. So the device is disabled, but runtime active in_noirq_suspendleading to duplicateruntime_suspendcalls. So rather check for the device state directly to indicate if changes are needed.
This relies onpm_runtime_force_resumebeing used in a balanced way.[...]
Applied, thanks!
[1/1] ARM: OMAP2+: fix omap_device with noirq_suspend
commit: 20ae98b360710da7db17b0d8edbf84c88ff4658d
Best regards,
Signature · 1 line
Kevin Hilman (TI) <[email protected]>