Skip to content

Commit

Permalink
dmaengine: tegra-apb: Error out if DMA_PREP_INTERRUPT flag is unset
Browse files Browse the repository at this point in the history
Apparently driver was never tested with DMA_PREP_INTERRUPT flag being
unset since it completely disables interrupt handling instead of skipping
the callbacks invocations, hence putting channel into unusable state.

The flag is always set by all of kernel drivers that use APB DMA, so let's
error out in otherwise case for consistency. It won't be difficult to
support that case properly if ever will be needed.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
  • Loading branch information
Dmitry Osipenko authored and Vinod Koul committed Jun 4, 2019
1 parent c983d80 commit dc16106
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions drivers/dma/tegra20-apb-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,8 +988,12 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_slave_sg(
csr |= tdc->slave_id << TEGRA_APBDMA_CSR_REQ_SEL_SHIFT;
}

if (flags & DMA_PREP_INTERRUPT)
if (flags & DMA_PREP_INTERRUPT) {
csr |= TEGRA_APBDMA_CSR_IE_EOC;
} else {
WARN_ON_ONCE(1);
return NULL;
}

apb_seq |= TEGRA_APBDMA_APBSEQ_WRAP_WORD_1;

Expand Down Expand Up @@ -1131,8 +1135,12 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_dma_cyclic(
csr |= tdc->slave_id << TEGRA_APBDMA_CSR_REQ_SEL_SHIFT;
}

if (flags & DMA_PREP_INTERRUPT)
if (flags & DMA_PREP_INTERRUPT) {
csr |= TEGRA_APBDMA_CSR_IE_EOC;
} else {
WARN_ON_ONCE(1);
return NULL;
}

apb_seq |= TEGRA_APBDMA_APBSEQ_WRAP_WORD_1;

Expand Down

0 comments on commit dc16106

Please sign in to comment.