This fixes some small bugs relating to the handling of logical
channels in the DMA40 driver:
- Fix a bug when asking for paused status of a logical channel
would fail (bug found by Jonas Aaberg)
- Handle DMA channel request for logical channel 0 (bug found by
Marcin Mielczarczyk)
Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Signed-off-by: Marcin Mielczarczyk <marcin.mielczarczyk@tieto.com>
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
---
drivers/dma/ste_dma40.c | 92 +++++++++++++++++++++++++++++++++++-----------
1 files changed, 70 insertions(+), 22 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index f86b99f..0ac6543 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -663,7 +663,7 @@ static void d40_config_set_event(struct d40_chan *d40c, bool do_enable)
spin_unlock_irqrestore(&d40c->phy_chan->lock, flags);
}
-static bool d40_chan_has_events(struct d40_chan *d40c)
+static u32 d40_chan_has_events(struct d40_chan *d40c)
{
u32 val = 0;
@@ -678,7 +678,7 @@ static bool d40_chan_has_events(struct d40_chan *d40c)
val = readl(d40c->base->virtbase + D40_DREG_PCBASE +
d40c->phy_chan->num * D40_DREG_PCDELTA +
D40_CHAN_REG_SDLNK);
- return (bool) val;
+ return val;
}
static void d40_config_enable_lidx(struct d40_chan *d40c)
@@ -1043,11 +1043,11 @@ static int d40_validate_conf(struct d40_chan *d40c,
}
static bool d40_alloc_mask_set(struct d40_phy_res *phy, bool is_src,
- int log_event_line)
+ int log_event_line, bool is_log)
{
unsigned long flags;
spin_lock_irqsave(&phy->lock, flags);
- if (!log_event_line) {
+ if (!is_log) {
/* Physical interrupts are masked per physical full channel */
if (phy->allocated_src == D40_ALLOC_FREE &&
phy->allocated_dst == D40_ALLOC_FREE) {
@@ -1165,15 +1165,16 @@ static int d40_allocate_channel(struct d40_chan *d40c)
/* Find physical half channel */
for (i = 0; i < ...