Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine dw: Revert "dmaengine: dw: Enable runtime PM"

This reverts commit 842067940a3e3fc008a60fee388e000219b32632.
For some solutions e.g. sound/soc/intel/catpt, DW DMA is part of a
compound device (in that very example, domains: ADSP, SSP0, SSP1, DMA0
and DMA1 are part of a single entity) rather than being a standalone
one. Driver for said device may enlist DMA to transfer data during
suspend or resume sequences.

Manipulating RPM explicitly in dw's DMA request and release channel
functions causes suspend() to also invoke resume() for the exact same
device. Similar situation occurs for resume() sequence. Effectively
renders device dysfunctional after first suspend() attempt. Revert the
change to address the problem.

Fixes: 842067940a3e ("dmaengine: dw: Enable runtime PM")
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210203191924.15706-1-cezary.rojewski@intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Cezary Rojewski and committed by
Vinod Koul
b6c14d7a 89e3becd

-6
-6
drivers/dma/dw/core.c
··· 982 982 983 983 dev_vdbg(chan2dev(chan), "%s\n", __func__); 984 984 985 - pm_runtime_get_sync(dw->dma.dev); 986 - 987 985 /* ASSERT: channel is idle */ 988 986 if (dma_readl(dw, CH_EN) & dwc->mask) { 989 - pm_runtime_put_sync_suspend(dw->dma.dev); 990 987 dev_dbg(chan2dev(chan), "DMA channel not idle?\n"); 991 988 return -EIO; 992 989 } ··· 1000 1003 * We need controller-specific data to set up slave transfers. 1001 1004 */ 1002 1005 if (chan->private && !dw_dma_filter(chan, chan->private)) { 1003 - pm_runtime_put_sync_suspend(dw->dma.dev); 1004 1006 dev_warn(chan2dev(chan), "Wrong controller-specific data\n"); 1005 1007 return -EINVAL; 1006 1008 } ··· 1042 1046 dw->in_use &= ~dwc->mask; 1043 1047 if (!dw->in_use) 1044 1048 do_dw_dma_off(dw); 1045 - 1046 - pm_runtime_put_sync_suspend(dw->dma.dev); 1047 1049 1048 1050 dev_vdbg(chan2dev(chan), "%s: done\n", __func__); 1049 1051 }