From 8ad31bf45db1c4a8f400cbc10400ce9fc0bed227 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Sun, 26 Apr 2015 11:53:54 +0200 Subject: dmaengine: usb-dmac: Protect PM-only functions to kill warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If CONFIG_PM=n: drivers/dma/sh/usb-dmac.c:677: warning: ‘usb_dmac_runtime_suspend’ defined but not used drivers/dma/sh/usb-dmac.c:688: warning: ‘usb_dmac_runtime_resume’ defined but not used Protect the unused functions by #ifdef CONFIG_PM to fix this. Signed-off-by: Geert Uytterhoeven Signed-off-by: Vinod Koul --- drivers/dma/sh/usb-dmac.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/dma/sh/usb-dmac.c b/drivers/dma/sh/usb-dmac.c index f705798..ebd8a5f 100644 --- a/drivers/dma/sh/usb-dmac.c +++ b/drivers/dma/sh/usb-dmac.c @@ -673,6 +673,7 @@ static struct dma_chan *usb_dmac_of_xlate(struct of_phandle_args *dma_spec, * Power management */ +#ifdef CONFIG_PM static int usb_dmac_runtime_suspend(struct device *dev) { struct usb_dmac *dmac = dev_get_drvdata(dev); @@ -690,6 +691,7 @@ static int usb_dmac_runtime_resume(struct device *dev) return usb_dmac_init(dmac); } +#endif /* CONFIG_PM */ static const struct dev_pm_ops usb_dmac_pm = { SET_RUNTIME_PM_OPS(usb_dmac_runtime_suspend, usb_dmac_runtime_resume, -- cgit v1.1 From 801661467fd50832191c81665d061ffabcc1c5de Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 26 Apr 2015 12:52:02 +0200 Subject: dmaengine: xgene: Set hardware dependency The xgene-dma driver is only useful on X-Gene SoC. Signed-off-by: Jean Delvare Cc: Rameshwar Prasad Sahu Cc: Loc Ho Cc: Vinod Koul Signed-off-by: Vinod Koul --- drivers/dma/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index fd7ac13..bda2cb0 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -437,6 +437,7 @@ config IMG_MDC_DMA config XGENE_DMA tristate "APM X-Gene DMA support" + depends on ARCH_XGENE || COMPILE_TEST select DMA_ENGINE select DMA_ENGINE_RAID select ASYNC_TX_ENABLE_CHANNEL_SWITCH -- cgit v1.1 From 63f89caad0e32dcfa17b2d17919816253de48996 Mon Sep 17 00:00:00 2001 From: Christopher Freeman Date: Wed, 4 Mar 2015 01:16:58 -0800 Subject: dmaengine: increment privatecnt when using dma_get_any_slave_channel Channels allocated via dma_get_any_slave_channel were not increasing the counter tracking private allocations. When these channels were released, privatecnt may erroneously fall to zero. The DMA device would then lose its DMA_PRIVATE cap and fail to allocate future private channels (via private_candidate) as any allocations still outstanding would incorrectly be seen as public allocations. Signed-off-by: Christopher Freeman Signed-off-by: Vinod Koul --- drivers/dma/dmaengine.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 0e035a8..2890d74 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -571,11 +571,15 @@ struct dma_chan *dma_get_any_slave_channel(struct dma_device *device) chan = private_candidate(&mask, device, NULL, NULL); if (chan) { + dma_cap_set(DMA_PRIVATE, device->cap_mask); + device->privatecnt++; err = dma_chan_get(chan); if (err) { pr_debug("%s: failed to get %s: (%d)\n", __func__, dma_chan_name(chan), err); chan = NULL; + if (--device->privatecnt == 0) + dma_cap_clear(DMA_PRIVATE, device->cap_mask); } } -- cgit v1.1