]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ti-linux-kernel/ti-linux-kernel.git/commitdiff
dmaengine: Add might_sleep() to dmaengine_synchronize()
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 4 Nov 2016 22:45:38 +0000 (22:45 +0000)
committerJean-Jacques Hiblot <jjhiblot@ti.com>
Wed, 7 Dec 2016 14:46:13 +0000 (15:46 +0100)
commit b1d6ab1aa8cdc23b89bcd578ea8d5e3c501a13d9 upstream.

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 6a44358af87bcf05d7c474b4e53d1120dd5975ef..95e689276ef122852b62cb400a8b41b455547e6e 100644 (file)
@@ -836,6 +836,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);
 }