Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/sun-nontendocm-kernel.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormadmonkey <madfkingmonkey@gmail.com>2018-07-26 02:07:39 +0300
committermadmonkey <madfkingmonkey@gmail.com>2018-07-26 02:08:32 +0300
commit8a2777b41a5af447d35f43b36df0c2910b7136c9 (patch)
tree75d05a74cd9ea0cc9c6f3feb324627fff67948cc /drivers
parent9f53fdde860f03c64b78091dea3b1055652965a0 (diff)
sound fix
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dma/sunxi-dma.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/dma/sunxi-dma.c b/drivers/dma/sunxi-dma.c
index 615c14fc..2b5801cc 100644
--- a/drivers/dma/sunxi-dma.c
+++ b/drivers/dma/sunxi-dma.c
@@ -417,6 +417,9 @@ static int sunxi_terminate_all(struct sunxi_chan *ch)
writel(CHAN_STOP, sdev->base + DMA_ENABLE(chan_num));
writel(CHAN_RESUME, sdev->base + DMA_PAUSE(chan_num));
+ while(readl(sdev->base + DMA_STAT) & (1 << chan_num))
+ cpu_relax();
+
if (ch->cyclic) {
ch->cyclic = false;
if (ch->desc) {
@@ -855,12 +858,17 @@ struct dma_async_tx_descriptor *sunxi_prep_dma_cyclic( struct dma_chan *chan,
dma_addr_t phy;
unsigned int periods = buf_len / period_len;
unsigned int i;
+ unsigned long lock_flags;
/*
* Not allow duplicate prep dma on cyclic channel.
*/
- if (schan->desc && schan->cyclic)
+ spin_lock_irqsave(&schan->vc.lock, lock_flags);
+ if (schan->desc && schan->cyclic) {
+ spin_unlock_irqrestore(&schan->vc.lock, lock_flags);
return NULL;
+ }
+ spin_unlock_irqrestore(&schan->vc.lock, lock_flags);
txd = kzalloc(sizeof(*txd), GFP_NOWAIT);
if (!txd) {