diff options
| -rw-r--r-- | drivers/dma/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/dma/edma.c | 2 | ||||
| -rw-r--r-- | drivers/dma/imx-dma.c | 31 |
3 files changed, 17 insertions, 17 deletions
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index 526ec77c7ba0..f238cfd33847 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig | |||
| @@ -198,6 +198,7 @@ config TI_EDMA | |||
| 198 | depends on ARCH_DAVINCI || ARCH_OMAP | 198 | depends on ARCH_DAVINCI || ARCH_OMAP |
| 199 | select DMA_ENGINE | 199 | select DMA_ENGINE |
| 200 | select DMA_VIRTUAL_CHANNELS | 200 | select DMA_VIRTUAL_CHANNELS |
| 201 | select TI_PRIV_EDMA | ||
| 201 | default n | 202 | default n |
| 202 | help | 203 | help |
| 203 | Enable support for the TI EDMA controller. This DMA | 204 | Enable support for the TI EDMA controller. This DMA |
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index ff50ff4c6a57..098a8da450f0 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c | |||
| @@ -749,6 +749,6 @@ static void __exit edma_exit(void) | |||
| 749 | } | 749 | } |
| 750 | module_exit(edma_exit); | 750 | module_exit(edma_exit); |
| 751 | 751 | ||
| 752 | MODULE_AUTHOR("Matt Porter <mporter@ti.com>"); | 752 | MODULE_AUTHOR("Matt Porter <matt.porter@linaro.org>"); |
| 753 | MODULE_DESCRIPTION("TI EDMA DMA engine driver"); | 753 | MODULE_DESCRIPTION("TI EDMA DMA engine driver"); |
| 754 | MODULE_LICENSE("GPL v2"); | 754 | MODULE_LICENSE("GPL v2"); |
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index 78f8ca5fccee..55852c026791 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c | |||
| @@ -437,17 +437,18 @@ static void dma_irq_handle_channel(struct imxdma_channel *imxdmac) | |||
| 437 | struct imxdma_engine *imxdma = imxdmac->imxdma; | 437 | struct imxdma_engine *imxdma = imxdmac->imxdma; |
| 438 | int chno = imxdmac->channel; | 438 | int chno = imxdmac->channel; |
| 439 | struct imxdma_desc *desc; | 439 | struct imxdma_desc *desc; |
| 440 | unsigned long flags; | ||
| 440 | 441 | ||
| 441 | spin_lock(&imxdma->lock); | 442 | spin_lock_irqsave(&imxdma->lock, flags); |
| 442 | if (list_empty(&imxdmac->ld_active)) { | 443 | if (list_empty(&imxdmac->ld_active)) { |
| 443 | spin_unlock(&imxdma->lock); | 444 | spin_unlock_irqrestore(&imxdma->lock, flags); |
| 444 | goto out; | 445 | goto out; |
| 445 | } | 446 | } |
| 446 | 447 | ||
| 447 | desc = list_first_entry(&imxdmac->ld_active, | 448 | desc = list_first_entry(&imxdmac->ld_active, |
| 448 | struct imxdma_desc, | 449 | struct imxdma_desc, |
| 449 | node); | 450 | node); |
| 450 | spin_unlock(&imxdma->lock); | 451 | spin_unlock_irqrestore(&imxdma->lock, flags); |
| 451 | 452 | ||
| 452 | if (desc->sg) { | 453 | if (desc->sg) { |
| 453 | u32 tmp; | 454 | u32 tmp; |
| @@ -519,7 +520,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) | |||
| 519 | { | 520 | { |
| 520 | struct imxdma_channel *imxdmac = to_imxdma_chan(d->desc.chan); | 521 | struct imxdma_channel *imxdmac = to_imxdma_chan(d->desc.chan); |
| 521 | struct imxdma_engine *imxdma = imxdmac->imxdma; | 522 | struct imxdma_engine *imxdma = imxdmac->imxdma; |
| 522 | unsigned long flags; | ||
| 523 | int slot = -1; | 523 | int slot = -1; |
| 524 | int i; | 524 | int i; |
| 525 | 525 | ||
| @@ -527,7 +527,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) | |||
| 527 | switch (d->type) { | 527 | switch (d->type) { |
| 528 | case IMXDMA_DESC_INTERLEAVED: | 528 | case IMXDMA_DESC_INTERLEAVED: |
| 529 | /* Try to get a free 2D slot */ | 529 | /* Try to get a free 2D slot */ |
| 530 | spin_lock_irqsave(&imxdma->lock, flags); | ||
| 531 | for (i = 0; i < IMX_DMA_2D_SLOTS; i++) { | 530 | for (i = 0; i < IMX_DMA_2D_SLOTS; i++) { |
| 532 | if ((imxdma->slots_2d[i].count > 0) && | 531 | if ((imxdma->slots_2d[i].count > 0) && |
| 533 | ((imxdma->slots_2d[i].xsr != d->x) || | 532 | ((imxdma->slots_2d[i].xsr != d->x) || |
| @@ -537,10 +536,8 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) | |||
| 537 | slot = i; | 536 | slot = i; |
| 538 | break; | 537 | break; |
| 539 | } | 538 | } |
| 540 | if (slot < 0) { | 539 | if (slot < 0) |
| 541 | spin_unlock_irqrestore(&imxdma->lock, flags); | ||
| 542 | return -EBUSY; | 540 | return -EBUSY; |
| 543 | } | ||
| 544 | 541 | ||
| 545 | imxdma->slots_2d[slot].xsr = d->x; | 542 | imxdma->slots_2d[slot].xsr = d->x; |
| 546 | imxdma->slots_2d[slot].ysr = d->y; | 543 | imxdma->slots_2d[slot].ysr = d->y; |
| @@ -549,7 +546,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) | |||
| 549 | 546 | ||
| 550 | imxdmac->slot_2d = slot; | 547 | imxdmac->slot_2d = slot; |
| 551 | imxdmac->enabled_2d = true; | 548 | imxdmac->enabled_2d = true; |
| 552 | spin_unlock_irqrestore(&imxdma->lock, flags); | ||
| 553 | 549 | ||
| 554 | if (slot == IMX_DMA_2D_SLOT_A) { | 550 | if (slot == IMX_DMA_2D_SLOT_A) { |
| 555 | d->config_mem &= ~CCR_MSEL_B; | 551 | d->config_mem &= ~CCR_MSEL_B; |
| @@ -625,18 +621,17 @@ static void imxdma_tasklet(unsigned long data) | |||
| 625 | struct imxdma_channel *imxdmac = (void *)data; | 621 | struct imxdma_channel *imxdmac = (void *)data; |
| 626 | struct imxdma_engine *imxdma = imxdmac->imxdma; | 622 | struct imxdma_engine *imxdma = imxdmac->imxdma; |
| 627 | struct imxdma_desc *desc; | 623 | struct imxdma_desc *desc; |
| 624 | unsigned long flags; | ||
| 628 | 625 | ||
| 629 | spin_lock(&imxdma->lock); | 626 | spin_lock_irqsave(&imxdma->lock, flags); |
| 630 | 627 | ||
| 631 | if (list_empty(&imxdmac->ld_active)) { | 628 | if (list_empty(&imxdmac->ld_active)) { |
| 632 | /* Someone might have called terminate all */ | 629 | /* Someone might have called terminate all */ |
| 633 | goto out; | 630 | spin_unlock_irqrestore(&imxdma->lock, flags); |
| 631 | return; | ||
| 634 | } | 632 | } |
| 635 | desc = list_first_entry(&imxdmac->ld_active, struct imxdma_desc, node); | 633 | desc = list_first_entry(&imxdmac->ld_active, struct imxdma_desc, node); |
| 636 | 634 | ||
| 637 | if (desc->desc.callback) | ||
| 638 | desc->desc.callback(desc->desc.callback_param); | ||
| 639 | |||
| 640 | /* If we are dealing with a cyclic descriptor, keep it on ld_active | 635 | /* If we are dealing with a cyclic descriptor, keep it on ld_active |
| 641 | * and dont mark the descriptor as complete. | 636 | * and dont mark the descriptor as complete. |
| 642 | * Only in non-cyclic cases it would be marked as complete | 637 | * Only in non-cyclic cases it would be marked as complete |
| @@ -663,7 +658,11 @@ static void imxdma_tasklet(unsigned long data) | |||
| 663 | __func__, imxdmac->channel); | 658 | __func__, imxdmac->channel); |
| 664 | } | 659 | } |
| 665 | out: | 660 | 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 | |||
| 667 | } | 666 | } |
| 668 | 667 | ||
| 669 | static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, | 668 | 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( | |||
| 883 | kfree(imxdmac->sg_list); | 882 | kfree(imxdmac->sg_list); |
| 884 | 883 | ||
| 885 | imxdmac->sg_list = kcalloc(periods + 1, | 884 | imxdmac->sg_list = kcalloc(periods + 1, |
| 886 | sizeof(struct scatterlist), GFP_KERNEL); | 885 | sizeof(struct scatterlist), GFP_ATOMIC); |
| 887 | if (!imxdmac->sg_list) | 886 | if (!imxdmac->sg_list) |
| 888 | return NULL; | 887 | return NULL; |
| 889 | 888 | ||
