summaryrefslogtreecommitdiffstats
path: root/drivers/dma/ti
diff options
context:
space:
mode:
authorVinod Koul <vkoul@kernel.org>2019-11-14 16:02:51 +0530
committerVinod Koul <vkoul@kernel.org>2019-11-14 16:02:51 +0530
commitbb5a471de9bfd0853d48d8dc5572469778c2824d (patch)
tree6c485504e35baa48ee6c3f29f879f6372ac1722d /drivers/dma/ti
parentb37949560b93d01f20687dfb8e1d3b9aa5633d63 (diff)
parentbacdcb6675e170bb2e8d3824da220e10274f42a7 (diff)
downloadlinux-bb5a471de9bfd0853d48d8dc5572469778c2824d.tar.bz2
Merge branch 'fixes' into next
Diffstat (limited to 'drivers/dma/ti')
-rw-r--r--drivers/dma/ti/cppi41.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/dma/ti/cppi41.c b/drivers/dma/ti/cppi41.c
index 2f946f55076c..8c2f7ebe998c 100644
--- a/drivers/dma/ti/cppi41.c
+++ b/drivers/dma/ti/cppi41.c
@@ -586,9 +586,22 @@ static struct dma_async_tx_descriptor *cppi41_dma_prep_slave_sg(
enum dma_transfer_direction dir, unsigned long tx_flags, void *context)
{
struct cppi41_channel *c = to_cpp41_chan(chan);
+ struct dma_async_tx_descriptor *txd = NULL;
+ struct cppi41_dd *cdd = c->cdd;
struct cppi41_desc *d;
struct scatterlist *sg;
unsigned int i;
+ int error;
+
+ error = pm_runtime_get(cdd->ddev.dev);
+ if (error < 0) {
+ pm_runtime_put_noidle(cdd->ddev.dev);
+
+ return NULL;
+ }
+
+ if (cdd->is_suspended)
+ goto err_out_not_ready;
d = c->desc;
for_each_sg(sgl, sg, sg_len, i) {
@@ -611,7 +624,13 @@ static struct dma_async_tx_descriptor *cppi41_dma_prep_slave_sg(
d++;
}
- return &c->txd;
+ txd = &c->txd;
+
+err_out_not_ready:
+ pm_runtime_mark_last_busy(cdd->ddev.dev);
+ pm_runtime_put_autosuspend(cdd->ddev.dev);
+
+ return txd;
}
static void cppi41_compute_td_desc(struct cppi41_desc *d)