]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
dmaengine: ste_dma40: fix pm runtime ref counting
authorRabin Vincent <rabin.vincent@stericsson.com>
Mon, 27 May 2013 14:03:40 +0000 (16:03 +0200)
committerVinod Koul <vinod.koul@intel.com>
Mon, 27 May 2013 14:20:32 +0000 (19:50 +0530)
The pm runtime reference counting of the driver is broken for the case
when there is more than one transfer queued, leading to the device being
runtime suspend while active.  Fix it.

Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Cc: stable@vger.kernel.org
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/ste_dma40.c

index 1734feec47b13bd7e7d1370003035416cb2e3e70..71bf4ec300ea5ca10958c0a43f71c9e9175b7879 100644 (file)
@@ -1566,10 +1566,12 @@ static void dma_tc_handle(struct d40_chan *d40c)
                        return;
                }
 
-               if (d40_queue_start(d40c) == NULL)
+               if (d40_queue_start(d40c) == NULL) {
                        d40c->busy = false;
-               pm_runtime_mark_last_busy(d40c->base->dev);
-               pm_runtime_put_autosuspend(d40c->base->dev);
+
+                       pm_runtime_mark_last_busy(d40c->base->dev);
+                       pm_runtime_put_autosuspend(d40c->base->dev);
+               }
 
                d40_desc_remove(d40d);
                d40_desc_done(d40c, d40d);