Skip to content

Commit 831ae3c

Browse files
committed
Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave-dmaengine fixes from Vinod Koul: "Here is the slave dmanegine fixes. We have the fix for deadlock issue on imx-dma by Michael and Josh's edma config fix along with author change" * 'fixes' of git://git.infradead.org/users/vkoul/slave-dma: dmaengine: imx-dma: fix callback path in tasklet dmaengine: imx-dma: fix lockdep issue between irqhandler and tasklet dmaengine: imx-dma: fix slow path issue in prep_dma_cyclic dma/Kconfig: Make TI_EDMA select TI_PRIV_EDMA edma: Update author email address
2 parents e62063d + fcaaba6 commit 831ae3c

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

drivers/dma/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ config TI_EDMA
198198
depends on ARCH_DAVINCI || ARCH_OMAP
199199
select DMA_ENGINE
200200
select DMA_VIRTUAL_CHANNELS
201+
select TI_PRIV_EDMA
201202
default n
202203
help
203204
Enable support for the TI EDMA controller. This DMA

drivers/dma/edma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,6 @@ static void __exit edma_exit(void)
749749
}
750750
module_exit(edma_exit);
751751

752-
MODULE_AUTHOR("Matt Porter <[email protected]>");
752+
MODULE_AUTHOR("Matt Porter <[email protected]>");
753753
MODULE_DESCRIPTION("TI EDMA DMA engine driver");
754754
MODULE_LICENSE("GPL v2");

drivers/dma/imx-dma.c

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -437,17 +437,18 @@ static void dma_irq_handle_channel(struct imxdma_channel *imxdmac)
437437
struct imxdma_engine *imxdma = imxdmac->imxdma;
438438
int chno = imxdmac->channel;
439439
struct imxdma_desc *desc;
440+
unsigned long flags;
440441

441-
spin_lock(&imxdma->lock);
442+
spin_lock_irqsave(&imxdma->lock, flags);
442443
if (list_empty(&imxdmac->ld_active)) {
443-
spin_unlock(&imxdma->lock);
444+
spin_unlock_irqrestore(&imxdma->lock, flags);
444445
goto out;
445446
}
446447

447448
desc = list_first_entry(&imxdmac->ld_active,
448449
struct imxdma_desc,
449450
node);
450-
spin_unlock(&imxdma->lock);
451+
spin_unlock_irqrestore(&imxdma->lock, flags);
451452

452453
if (desc->sg) {
453454
u32 tmp;
@@ -519,15 +520,13 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
519520
{
520521
struct imxdma_channel *imxdmac = to_imxdma_chan(d->desc.chan);
521522
struct imxdma_engine *imxdma = imxdmac->imxdma;
522-
unsigned long flags;
523523
int slot = -1;
524524
int i;
525525

526526
/* Configure and enable */
527527
switch (d->type) {
528528
case IMXDMA_DESC_INTERLEAVED:
529529
/* Try to get a free 2D slot */
530-
spin_lock_irqsave(&imxdma->lock, flags);
531530
for (i = 0; i < IMX_DMA_2D_SLOTS; i++) {
532531
if ((imxdma->slots_2d[i].count > 0) &&
533532
((imxdma->slots_2d[i].xsr != d->x) ||
@@ -537,10 +536,8 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
537536
slot = i;
538537
break;
539538
}
540-
if (slot < 0) {
541-
spin_unlock_irqrestore(&imxdma->lock, flags);
539+
if (slot < 0)
542540
return -EBUSY;
543-
}
544541

545542
imxdma->slots_2d[slot].xsr = d->x;
546543
imxdma->slots_2d[slot].ysr = d->y;
@@ -549,7 +546,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
549546

550547
imxdmac->slot_2d = slot;
551548
imxdmac->enabled_2d = true;
552-
spin_unlock_irqrestore(&imxdma->lock, flags);
553549

554550
if (slot == IMX_DMA_2D_SLOT_A) {
555551
d->config_mem &= ~CCR_MSEL_B;
@@ -625,18 +621,17 @@ static void imxdma_tasklet(unsigned long data)
625621
struct imxdma_channel *imxdmac = (void *)data;
626622
struct imxdma_engine *imxdma = imxdmac->imxdma;
627623
struct imxdma_desc *desc;
624+
unsigned long flags;
628625

629-
spin_lock(&imxdma->lock);
626+
spin_lock_irqsave(&imxdma->lock, flags);
630627

631628
if (list_empty(&imxdmac->ld_active)) {
632629
/* Someone might have called terminate all */
633-
goto out;
630+
spin_unlock_irqrestore(&imxdma->lock, flags);
631+
return;
634632
}
635633
desc = list_first_entry(&imxdmac->ld_active, struct imxdma_desc, node);
636634

637-
if (desc->desc.callback)
638-
desc->desc.callback(desc->desc.callback_param);
639-
640635
/* If we are dealing with a cyclic descriptor, keep it on ld_active
641636
* and dont mark the descriptor as complete.
642637
* Only in non-cyclic cases it would be marked as complete
@@ -663,7 +658,11 @@ static void imxdma_tasklet(unsigned long data)
663658
__func__, imxdmac->channel);
664659
}
665660
out:
666-
spin_unlock(&imxdma->lock);
661+
spin_unlock_irqrestore(&imxdma->lock, flags);
662+
663+
if (desc->desc.callback)
664+
desc->desc.callback(desc->desc.callback_param);
665+
667666
}
668667

669668
static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
@@ -883,7 +882,7 @@ static struct dma_async_tx_descriptor *imxdma_prep_dma_cyclic(
883882
kfree(imxdmac->sg_list);
884883

885884
imxdmac->sg_list = kcalloc(periods + 1,
886-
sizeof(struct scatterlist), GFP_KERNEL);
885+
sizeof(struct scatterlist), GFP_ATOMIC);
887886
if (!imxdmac->sg_list)
888887
return NULL;
889888

0 commit comments

Comments
 (0)