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()

+29 -6
+1
drivers/dma/Kconfig
··· 306 306 depends on ARCH_MMP || COMPILE_TEST 307 307 select DMA_ENGINE 308 308 select MMP_SRAM if ARCH_MMP 309 + select GENERIC_ALLOCATOR 309 310 help 310 311 Support the MMP Two-Channel DMA engine. 311 312 This engine used for MMP Audio DMA and pxa910 SQU.
+26 -5
drivers/dma/cppi41.c
··· 317 317 318 318 while (val) { 319 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 327 q_num = __fls(val); 322 328 val &= ~(1 << q_num); ··· 344 338 dma_cookie_complete(&c->txd); 345 339 dmaengine_desc_get_callback_invoke(&c->txd, NULL); 346 340 347 - /* Paired with cppi41_dma_issue_pending */ 348 341 pm_runtime_mark_last_busy(cdd->ddev.dev); 349 342 pm_runtime_put_autosuspend(cdd->ddev.dev); 350 343 } ··· 367 362 int error; 368 363 369 364 error = pm_runtime_get_sync(cdd->ddev.dev); 370 - if (error < 0) 365 + if (error < 0) { 366 + dev_err(cdd->ddev.dev, "%s pm runtime get: %i\n", 367 + __func__, error); 368 + pm_runtime_put_noidle(cdd->ddev.dev); 369 + 371 370 return error; 371 + } 372 372 373 373 dma_cookie_init(chan); 374 374 dma_async_tx_descriptor_init(&c->txd, chan); ··· 395 385 int error; 396 386 397 387 error = pm_runtime_get_sync(cdd->ddev.dev); 398 - if (error < 0) 388 + if (error < 0) { 389 + pm_runtime_put_noidle(cdd->ddev.dev); 390 + 399 391 return; 392 + } 400 393 401 394 WARN_ON(!list_empty(&cdd->pending)); 402 395 ··· 473 460 struct cppi41_dd *cdd = c->cdd; 474 461 int error; 475 462 476 - /* PM runtime paired with dmaengine_desc_get_callback_invoke */ 477 463 error = pm_runtime_get(cdd->ddev.dev); 478 464 if ((error != -EINPROGRESS) && error < 0) { 465 + pm_runtime_put_noidle(cdd->ddev.dev); 479 466 dev_err(cdd->ddev.dev, "Failed to pm_runtime_get: %i\n", 480 467 error); 481 468 ··· 486 473 push_desc_queue(c); 487 474 else 488 475 pending_desc(c); 476 + 477 + pm_runtime_mark_last_busy(cdd->ddev.dev); 478 + pm_runtime_put_autosuspend(cdd->ddev.dev); 489 479 } 490 480 491 481 static u32 get_host_pd0(u32 length) ··· 1075 1059 deinit_cppi41(dev, cdd); 1076 1060 err_init_cppi: 1077 1061 pm_runtime_dont_use_autosuspend(dev); 1078 - pm_runtime_put_sync(dev); 1079 1062 err_get_sync: 1063 + pm_runtime_put_sync(dev); 1080 1064 pm_runtime_disable(dev); 1081 1065 iounmap(cdd->usbss_mem); 1082 1066 iounmap(cdd->ctrl_mem); ··· 1088 1072 static int cppi41_dma_remove(struct platform_device *pdev) 1089 1073 { 1090 1074 struct cppi41_dd *cdd = platform_get_drvdata(pdev); 1075 + int error; 1091 1076 1077 + error = pm_runtime_get_sync(&pdev->dev); 1078 + if (error < 0) 1079 + dev_err(&pdev->dev, "%s could not pm_runtime_get: %i\n", 1080 + __func__, error); 1092 1081 of_dma_controller_free(pdev->dev.of_node); 1093 1082 dma_async_device_unregister(&cdd->ddev); 1094 1083
+1
drivers/dma/edma.c
··· 1628 1628 if (echan->slot[0] < 0) { 1629 1629 dev_err(dev, "Entry slot allocation failed for channel %u\n", 1630 1630 EDMA_CHAN_SLOT(echan->ch_num)); 1631 + ret = echan->slot[0]; 1631 1632 goto err_slot; 1632 1633 } 1633 1634
+1 -1
drivers/dma/sun6i-dma.c
··· 578 578 579 579 burst = convert_burst(8); 580 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 582 DMA_CHAN_CFG_DST_DRQ(DRQ_SDRAM) | 583 583 DMA_CHAN_CFG_DST_LINEAR_MODE | 584 584 DMA_CHAN_CFG_SRC_LINEAR_MODE |