History

Merge tag 'dmaengine-fix-4.9-rc6' of git://git.infradead.org/users/vkoul/slave-dma

Pull dmaengine fixes from Vinod Koul: "Some driver fixes which we pending in my tree: - return error code fix in edma driver - Kconfig fix for genric allocator in mmp_tdma - fix uninitialized value in sun6i - Runtime pm fixes for cppi" * tag 'dmaengine-fix-4.9-rc6' of git://git.infradead.org/users/vkoul/slave-dma: dmaengine: cppi41: More PM runtime fixes dmaengine: cpp41: Fix handling of error path dmaengine: cppi41: Fix unpaired pm runtime when only a USB hub is connected dmaengine: cppi41: Fix list not empty warning on module removal dmaengine: sun6i: fix the uninitialized value for v_lli dmaengine: mmp_tdma: add missing select GENERIC_ALLOCATOR in Kconfig dmaengine: edma: Fix error return code in edma_alloc_chan_resources()

Linus Torvalds committed 9 years ago

Commit eab8d4b2 parents 20afa6e d5afc1b4 files · +29 −6Browse files

Unified · Split

4 files
  1. drivers/dma/Kconfig +1 −0
  2. drivers/dma/cppi41.c +26 −5
  3. drivers/dma/edma.c +1 −0
  4. drivers/dma/sun6i-dma.c +1 −1
drivers/dma/Kconfig+1−0
@@ -306,6 +306,7 @@ config MMP_TDMA · 305 unmodified lines
306306 depends on ARCH_MMP || COMPILE_TEST
307307 select DMA_ENGINE
308308 select MMP_SRAM if ARCH_MMP
309+ select GENERIC_ALLOCATOR
309310 help
310311 Support the MMP Two-Channel DMA engine.
311312 This engine used for MMP Audio DMA and pxa910 SQU.
drivers/dma/cppi41.c+26−5
@@ -317,6 +317,12 @@ static irqreturn_t cppi41_irq(int irq, void *data) · 316 unmodified lines
317317
318318 while (val) {
319319 u32 desc, len;
320+ int error;
321+
322+ error = pm_runtime_get(cdd->ddev.dev);
323+ if (error < 0)
324+ dev_err(cdd->ddev.dev, "%s pm runtime get: %i\n",
325+ __func__, error);
320326
321327 q_num = __fls(val);
322328 val &= ~(1 << q_num);
@@ -338,7 +344,6 @@ static irqreturn_t cppi41_irq(int irq, void *data) · 15 unmodified lines
338344 dma_cookie_complete(&c->txd);
339345 dmaengine_desc_get_callback_invoke(&c->txd, NULL);
340346
341− /* Paired with cppi41_dma_issue_pending */
342347 pm_runtime_mark_last_busy(cdd->ddev.dev);
343348 pm_runtime_put_autosuspend(cdd->ddev.dev);
344349 }
@@ -362,8 +367,13 @@ static int cppi41_dma_alloc_chan_resources(struct dma_chan *chan) · 17 unmodified lines
362367 int error;
363368
364369 error = pm_runtime_get_sync(cdd->ddev.dev);
365− if (error < 0)
370+ if (error < 0) {
371+ dev_err(cdd->ddev.dev, "%s pm runtime get: %i\n",
372+ __func__, error);
373+ pm_runtime_put_noidle(cdd->ddev.dev);
374+
366375 return error;
376+ }
367377
368378 dma_cookie_init(chan);
369379 dma_async_tx_descriptor_init(&c->txd, chan);
@@ -385,8 +395,11 @@ static void cppi41_dma_free_chan_resources(struct dma_chan *chan) · 15 unmodified lines
385395 int error;
386396
387397 error = pm_runtime_get_sync(cdd->ddev.dev);
388− if (error < 0)
398+ if (error < 0) {
399+ pm_runtime_put_noidle(cdd->ddev.dev);
400+
389401 return;
402+ }
390403
391404 WARN_ON(!list_empty(&cdd->pending));
392405
@@ -460,9 +473,9 @@ static void cppi41_dma_issue_pending(struct dma_chan *chan) · 67 unmodified lines
460473 struct cppi41_dd *cdd = c->cdd;
461474 int error;
462475
463− /* PM runtime paired with dmaengine_desc_get_callback_invoke */
464476 error = pm_runtime_get(cdd->ddev.dev);
465477 if ((error != -EINPROGRESS) && error < 0) {
478+ pm_runtime_put_noidle(cdd->ddev.dev);
466479 dev_err(cdd->ddev.dev, "Failed to pm_runtime_get: %i\n",
467480 error);
468481
@@ -473,6 +486,9 @@ static void cppi41_dma_issue_pending(struct dma_chan *chan) · 4 unmodified lines
473486 push_desc_queue(c);
474487 else
475488 pending_desc(c);
489+
490+ pm_runtime_mark_last_busy(cdd->ddev.dev);
491+ pm_runtime_put_autosuspend(cdd->ddev.dev);
476492 }
477493
478494 static u32 get_host_pd0(u32 length)
@@ -1059,8 +1075,8 @@ err_chans: · 580 unmodified lines
10591075 deinit_cppi41(dev, cdd);
10601076 err_init_cppi:
10611077 pm_runtime_dont_use_autosuspend(dev);
1062− pm_runtime_put_sync(dev);
10631078 err_get_sync:
1079+ pm_runtime_put_sync(dev);
10641080 pm_runtime_disable(dev);
10651081 iounmap(cdd->usbss_mem);
10661082 iounmap(cdd->ctrl_mem);
@@ -1072,7 +1088,12 @@ err_get_sync: · 5 unmodified lines
10721088 static int cppi41_dma_remove(struct platform_device *pdev)
10731089 {
10741090 struct cppi41_dd *cdd = platform_get_drvdata(pdev);
1091+ int error;
10751092
1093+ error = pm_runtime_get_sync(&pdev->dev);
1094+ if (error < 0)
1095+ dev_err(&pdev->dev, "%s could not pm_runtime_get: %i\n",
1096+ __func__, error);
10761097 of_dma_controller_free(pdev->dev.of_node);
10771098 dma_async_device_unregister(&cdd->ddev);
10781099
drivers/dma/edma.c+1−0
@@ -1628,6 +1628,7 @@ static int edma_alloc_chan_resources(struct dma_chan *chan) · 1627 unmodified lines
16281628 if (echan->slot[0] < 0) {
16291629 dev_err(dev, "Entry slot allocation failed for channel %u\n",
16301630 EDMA_CHAN_SLOT(echan->ch_num));
1631+ ret = echan->slot[0];
16311632 goto err_slot;
16321633 }
16331634
drivers/dma/sun6i-dma.c+1−1
@@ -578,7 +578,7 @@ static struct dma_async_tx_descriptor *sun6i_dma_prep_dma_memcpy( · 577 unmodified lines
578578
579579 burst = convert_burst(8);
580580 width = convert_buswidth(DMA_SLAVE_BUSWIDTH_4_BYTES);
581− v_lli->cfg |= DMA_CHAN_CFG_SRC_DRQ(DRQ_SDRAM) |
581+ v_lli->cfg = DMA_CHAN_CFG_SRC_DRQ(DRQ_SDRAM) |
582582 DMA_CHAN_CFG_DST_DRQ(DRQ_SDRAM) |
583583 DMA_CHAN_CFG_DST_LINEAR_MODE |
584584 DMA_CHAN_CFG_SRC_LINEAR_MODE |

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t