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