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
306 depends on ARCH_MMP || COMPILE_TEST306 depends on ARCH_MMP || COMPILE_TEST
307 select DMA_ENGINE307 select DMA_ENGINE
308 select MMP_SRAM if ARCH_MMP308 select MMP_SRAM if ARCH_MMP
309 select GENERIC_ALLOCATOR
309 help310 help
310 Support the MMP Two-Channel DMA engine.311 Support the MMP Two-Channel DMA engine.
311 This engine used for MMP Audio DMA and pxa910 SQU.312 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
317 317
318 while (val) {318 while (val) {
319 u32 desc, len;319 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);
320 326
321 q_num = __fls(val);327 q_num = __fls(val);
322 val &= ~(1 << q_num);328 val &= ~(1 << q_num);
@@ -338,7 +344,6 @@ static irqreturn_t cppi41_irq(int irq, void *data) · 15 unmodified lines
338 dma_cookie_complete(&c->txd);344 dma_cookie_complete(&c->txd);
339 dmaengine_desc_get_callback_invoke(&c->txd, NULL);345 dmaengine_desc_get_callback_invoke(&c->txd, NULL);
340 346
341 /* Paired with cppi41_dma_issue_pending */
342 pm_runtime_mark_last_busy(cdd->ddev.dev);347 pm_runtime_mark_last_busy(cdd->ddev.dev);
343 pm_runtime_put_autosuspend(cdd->ddev.dev);348 pm_runtime_put_autosuspend(cdd->ddev.dev);
344 }349 }
@@ -362,8 +367,13 @@ static int cppi41_dma_alloc_chan_resources(struct dma_chan *chan) · 17 unmodified lines
362 int error;367 int error;
363 368
364 error = pm_runtime_get_sync(cdd->ddev.dev);369 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
366 return error;375 return error;
376 }
367 377
368 dma_cookie_init(chan);378 dma_cookie_init(chan);
369 dma_async_tx_descriptor_init(&c->txd, chan);379 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
385 int error;395 int error;
386 396
387 error = pm_runtime_get_sync(cdd->ddev.dev);397 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
389 return;401 return;
402 }
390 403
391 WARN_ON(!list_empty(&cdd->pending));404 WARN_ON(!list_empty(&cdd->pending));
392 405
@@ -460,9 +473,9 @@ static void cppi41_dma_issue_pending(struct dma_chan *chan) · 67 unmodified lines
460 struct cppi41_dd *cdd = c->cdd;473 struct cppi41_dd *cdd = c->cdd;
461 int error;474 int error;
462 475
463 /* PM runtime paired with dmaengine_desc_get_callback_invoke */
464 error = pm_runtime_get(cdd->ddev.dev);476 error = pm_runtime_get(cdd->ddev.dev);
465 if ((error != -EINPROGRESS) && error < 0) {477 if ((error != -EINPROGRESS) && error < 0) {
478 pm_runtime_put_noidle(cdd->ddev.dev);
466 dev_err(cdd->ddev.dev, "Failed to pm_runtime_get: %i\n",479 dev_err(cdd->ddev.dev, "Failed to pm_runtime_get: %i\n",
467 error);480 error);
468 481
@@ -473,6 +486,9 @@ static void cppi41_dma_issue_pending(struct dma_chan *chan) · 4 unmodified lines
473 push_desc_queue(c);486 push_desc_queue(c);
474 else487 else
475 pending_desc(c);488 pending_desc(c);
489
490 pm_runtime_mark_last_busy(cdd->ddev.dev);
491 pm_runtime_put_autosuspend(cdd->ddev.dev);
476}492}
477 493
478static u32 get_host_pd0(u32 length)494static u32 get_host_pd0(u32 length)
@@ -1059,8 +1075,8 @@ err_chans: · 580 unmodified lines
1059 deinit_cppi41(dev, cdd);1075 deinit_cppi41(dev, cdd);
1060err_init_cppi:1076err_init_cppi:
1061 pm_runtime_dont_use_autosuspend(dev);1077 pm_runtime_dont_use_autosuspend(dev);
1062 pm_runtime_put_sync(dev);
1063err_get_sync:1078err_get_sync:
1079 pm_runtime_put_sync(dev);
1064 pm_runtime_disable(dev);1080 pm_runtime_disable(dev);
1065 iounmap(cdd->usbss_mem);1081 iounmap(cdd->usbss_mem);
1066 iounmap(cdd->ctrl_mem);1082 iounmap(cdd->ctrl_mem);
@@ -1072,7 +1088,12 @@ err_get_sync: · 5 unmodified lines
1072static int cppi41_dma_remove(struct platform_device *pdev)1088static int cppi41_dma_remove(struct platform_device *pdev)
1073{1089{
1074 struct cppi41_dd *cdd = platform_get_drvdata(pdev);1090 struct cppi41_dd *cdd = platform_get_drvdata(pdev);
1091 int error;
1075 1092
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);
1076 of_dma_controller_free(pdev->dev.of_node);1097 of_dma_controller_free(pdev->dev.of_node);
1077 dma_async_device_unregister(&cdd->ddev);1098 dma_async_device_unregister(&cdd->ddev);
1078 1099
drivers/dma/edma.c+1−0
@@ -1628,6 +1628,7 @@ static int edma_alloc_chan_resources(struct dma_chan *chan) · 1627 unmodified lines
1628 if (echan->slot[0] < 0) {1628 if (echan->slot[0] < 0) {
1629 dev_err(dev, "Entry slot allocation failed for channel %u\n",1629 dev_err(dev, "Entry slot allocation failed for channel %u\n",
1630 EDMA_CHAN_SLOT(echan->ch_num));1630 EDMA_CHAN_SLOT(echan->ch_num));
1631 ret = echan->slot[0];
1631 goto err_slot;1632 goto err_slot;
1632 }1633 }
1633 1634
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
578 578
579 burst = convert_burst(8);579 burst = convert_burst(8);
580 width = convert_buswidth(DMA_SLAVE_BUSWIDTH_4_BYTES);580 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) |
582 DMA_CHAN_CFG_DST_DRQ(DRQ_SDRAM) |582 DMA_CHAN_CFG_DST_DRQ(DRQ_SDRAM) |
583 DMA_CHAN_CFG_DST_LINEAR_MODE |583 DMA_CHAN_CFG_DST_LINEAR_MODE |
584 DMA_CHAN_CFG_SRC_LINEAR_MODE |584 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