dmaengine: ti: omap-dma: Skip pointless cpu_pm context restore on errors
Subsystems (2)
PATCH 1/1 dmaengine: ti: omap-dma: Skip pointless cpu_pm context restore on errors
There's no need to restore DMA context on CPU_CLUSTER_PM_ENTER_FAILED as the DMA context won't be lost on errors.
Note that this does not cause invalid context restore as we already check for busy DMA with omap_dma_busy() in CPU_CLUSTER_PM_ENTER, and block any deeper idle states for the SoC by returning NOTIFY_BAD if busy.
If other drivers block deeper idle states with cpu_pm, we now just do a pointless restore, but only if dma was not busy on CPU_CLUSTER_PM_ENTER.
Let's update the CPU_CLUSTER_PM_ENTER_FAILED handling for correctness, and add a comment.
--- drivers/dma/ti/omap-dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/dma/ti/omap-dma.c +2 -1
@@ -1608,7 +1608,8 @@ static int omap_dma_context_notifier(struct notifier_block *nb,return NOTIFY_BAD ;omap_dma_context_save (od);break ; -case CPU_CLUSTER_PM_ENTER_FAILED : +case CPU_CLUSTER_PM_ENTER_FAILED :/* No need to restore context */ +break ;case CPU_CLUSTER_PM_EXIT :omap_dma_context_restore (od);break ;
Signature · 1 line
2.31.1
Quoted 7 lines · Tony Lindgren
There's no need to restore DMA context on
CPU_CLUSTER_PM_ENTER_FAILEDas the DMA context won't be lost on errors.Note that this does not cause invalid context restore as we already check for busy DMA with
omap_dma_busy()inCPU_CLUSTER_PM_ENTER, and block any deeper idle states for the SoC by returningNOTIFY_BADif busy.
Quoted 5 lines
If other drivers block deeper idle states with
cpu_pm, we now just do a pointless restore, but only if dma was not busy onCPU_CLUSTER_PM_ENTER.Let's update the
CPU_CLUSTER_PM_ENTER_FAILEDhandling for correctness, and add a comment.
Make sense,
Quoted 23 lines
Cc Aaro Koskinen <[email protected]>Cc Adam Ford <[email protected]>Cc Andreas Kemnade <[email protected]>Cc Peter Ujfalusi <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- drivers/dma/ti/omap-dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/dma/ti/omap-dma.c +2
-1@@ -1608,7 +1608,8 @@ static int omap_dma_context_notifier(struct notifier_block *nb,return NOTIFY_BAD ;omap_dma_context_save (od);break ; -case CPU_CLUSTER_PM_ENTER_FAILED : +case CPU_CLUSTER_PM_ENTER_FAILED :/* No need to restore context */ +break ;case CPU_CLUSTER_PM_EXIT :omap_dma_context_restore (od);break ;
Signature · 1 line
Péter
Quoted 7 lines · Tony Lindgren
There's no need to restore DMA context on
CPU_CLUSTER_PM_ENTER_FAILEDas the DMA context won't be lost on errors.Note that this does not cause invalid context restore as we already check for busy DMA with
omap_dma_busy()inCPU_CLUSTER_PM_ENTER, and block any deeper idle states for the SoC by returningNOTIFY_BADif busy.
Quoted 5 lines
If other drivers block deeper idle states with
cpu_pm, we now just do a pointless restore, but only if dma was not busy onCPU_CLUSTER_PM_ENTER.Let's update the
CPU_CLUSTER_PM_ENTER_FAILEDhandling for correctness, and add a comment.
Applied, thanks
Signature · 1 line
~Vinod