Skip to content

Commit

Permalink
Merge tag 'dmaengine-fixes-3.15-rc5' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/djbw/dmaengine

Pull dmaengine fixes from Dan Williams:
 "Two fixes for -stable:

   - async_mult() sometimes maps less buffers than initially requested.
      We end up freeing dmaengine_unmap_data on an invalid pool.

   - mv_xor: register write ordering fix"

* tag 'dmaengine-fixes-3.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/dmaengine:
  dmaengine: fix dmaengine_unmap failure
  dma: mv_xor: Flush descriptors before activating a channel
  • Loading branch information
torvalds committed May 23, 2014
2 parents 1ee1cea + c1f43dd commit 0374300
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions drivers/dma/dmaengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,7 @@ static void dmaengine_unmap(struct kref *kref)
dma_unmap_page(dev, unmap->addr[i], unmap->len,
DMA_BIDIRECTIONAL);
}
cnt = unmap->map_cnt;
mempool_free(unmap, __get_unmap_pool(cnt)->pool);
}

Expand Down Expand Up @@ -1074,6 +1075,7 @@ dmaengine_get_unmap_data(struct device *dev, int nr, gfp_t flags)
memset(unmap, 0, sizeof(*unmap));
kref_init(&unmap->kref);
unmap->dev = dev;
unmap->map_cnt = nr;

return unmap;
}
Expand Down
8 changes: 3 additions & 5 deletions drivers/dma/mv_xor.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,10 @@ static void mv_set_mode(struct mv_xor_chan *chan,

static void mv_chan_activate(struct mv_xor_chan *chan)
{
u32 activation;

dev_dbg(mv_chan_to_devp(chan), " activate chan.\n");
activation = readl_relaxed(XOR_ACTIVATION(chan));
activation |= 0x1;
writel_relaxed(activation, XOR_ACTIVATION(chan));

/* writel ensures all descriptors are flushed before activation */
writel(BIT(0), XOR_ACTIVATION(chan));
}

static char mv_chan_is_busy(struct mv_xor_chan *chan)
Expand Down
1 change: 1 addition & 0 deletions include/linux/dmaengine.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param);
typedef void (*dma_async_tx_callback)(void *dma_async_param);

struct dmaengine_unmap_data {
u8 map_cnt;
u8 to_cnt;
u8 from_cnt;
u8 bidi_cnt;
Expand Down

0 comments on commit 0374300

Please sign in to comment.