dmaengine: Add might_sleep() to dmaengine_synchronize()
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 23 Nov 2015 10:06:43 +0000 (11:06 +0100)
committerVinod Koul <vinod.koul@intel.com>
Sat, 5 Dec 2015 08:13:30 +0000 (13:43 +0530)
Implementations of dmaengine_synchronize() are allowed to sleep, hence the
function must not be called to from atomic context. Add might_sleep() to
dmaengine_synchronize() to make it easier to detect non-compliant callers.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
include/linux/dmaengine.h

index 4662d9aa6d5a59b1c02af088b3687d6befbbfdc5..2f69e1d93f92e026d4ac4a2200571908d348a6da 100644 (file)
@@ -895,6 +895,8 @@ static inline int dmaengine_terminate_async(struct dma_chan *chan)
  */
 static inline void dmaengine_synchronize(struct dma_chan *chan)
 {
+       might_sleep();
+
        if (chan->device->device_synchronize)
                chan->device->device_synchronize(chan);
 }