Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: xilinx_dma: use readl_poll_timeout_atomic variant

The xilinx_dma_poll_timeout macro is sometimes called while holding a
spinlock (see xilinx_dma_issue_pending() for an example) this means we
shouldn't sleep when polling the dma channel registers. To address it
in xilinx poll timeout macro use readl_poll_timeout_atomic instead of
readl_poll_timeout variant.

Signed-off-by: Marc Ferland <ferlandm@amotus.ca>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Link: https://lore.kernel.org/r/1604473206-32573-2-git-send-email-radhey.shyam.pandey@xilinx.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Marc Ferland and committed by
Vinod Koul
0ba2df09 76866411

+2 -2
+2 -2
drivers/dma/xilinx/xilinx_dma.c
··· 517 517 #define to_dma_tx_descriptor(tx) \ 518 518 container_of(tx, struct xilinx_dma_tx_descriptor, async_tx) 519 519 #define xilinx_dma_poll_timeout(chan, reg, val, cond, delay_us, timeout_us) \ 520 - readl_poll_timeout(chan->xdev->regs + chan->ctrl_offset + reg, val, \ 521 - cond, delay_us, timeout_us) 520 + readl_poll_timeout_atomic(chan->xdev->regs + chan->ctrl_offset + reg, \ 521 + val, cond, delay_us, timeout_us) 522 522 523 523 /* IO accessors */ 524 524 static inline u32 dma_read(struct xilinx_dma_chan *chan, u32 reg)