Skip to content

Commit 3333222

Browse files
committed
Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave dmaengine fixes from Vinod Koul: "Here are the fixes in dmaengine subsystem for rc2: - privatecnt fix for slave dma request API by Christopher - warn fix for PM ifdef in usb-dmac by Geert - fix hardware dependency for xgene by Jean" * 'next' of git://git.infradead.org/users/vkoul/slave-dma: dmaengine: increment privatecnt when using dma_get_any_slave_channel dmaengine: xgene: Set hardware dependency dmaengine: usb-dmac: Protect PM-only functions to kill warning
2 parents 180d89f + 63f89ca commit 3333222

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

drivers/dma/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ config IMG_MDC_DMA
437437

438438
config XGENE_DMA
439439
tristate "APM X-Gene DMA support"
440+
depends on ARCH_XGENE || COMPILE_TEST
440441
select DMA_ENGINE
441442
select DMA_ENGINE_RAID
442443
select ASYNC_TX_ENABLE_CHANNEL_SWITCH

drivers/dma/dmaengine.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,11 +571,15 @@ struct dma_chan *dma_get_any_slave_channel(struct dma_device *device)
571571

572572
chan = private_candidate(&mask, device, NULL, NULL);
573573
if (chan) {
574+
dma_cap_set(DMA_PRIVATE, device->cap_mask);
575+
device->privatecnt++;
574576
err = dma_chan_get(chan);
575577
if (err) {
576578
pr_debug("%s: failed to get %s: (%d)\n",
577579
__func__, dma_chan_name(chan), err);
578580
chan = NULL;
581+
if (--device->privatecnt == 0)
582+
dma_cap_clear(DMA_PRIVATE, device->cap_mask);
579583
}
580584
}
581585

drivers/dma/sh/usb-dmac.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,7 @@ static struct dma_chan *usb_dmac_of_xlate(struct of_phandle_args *dma_spec,
673673
* Power management
674674
*/
675675

676+
#ifdef CONFIG_PM
676677
static int usb_dmac_runtime_suspend(struct device *dev)
677678
{
678679
struct usb_dmac *dmac = dev_get_drvdata(dev);
@@ -690,6 +691,7 @@ static int usb_dmac_runtime_resume(struct device *dev)
690691

691692
return usb_dmac_init(dmac);
692693
}
694+
#endif /* CONFIG_PM */
693695

694696
static const struct dev_pm_ops usb_dmac_pm = {
695697
SET_RUNTIME_PM_OPS(usb_dmac_runtime_suspend, usb_dmac_runtime_resume,

0 commit comments

Comments
 (0)