Commit 03743007 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'dmaengine-fixes-3.15-rc5' of...

Merge tag 'dmaengine-fixes-3.15-rc5' of git://git.kernel.org/pub/scm/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
parents 1ee1ceaf c1f43dd9
...@@ -1009,6 +1009,7 @@ static void dmaengine_unmap(struct kref *kref) ...@@ -1009,6 +1009,7 @@ static void dmaengine_unmap(struct kref *kref)
dma_unmap_page(dev, unmap->addr[i], unmap->len, dma_unmap_page(dev, unmap->addr[i], unmap->len,
DMA_BIDIRECTIONAL); DMA_BIDIRECTIONAL);
} }
cnt = unmap->map_cnt;
mempool_free(unmap, __get_unmap_pool(cnt)->pool); mempool_free(unmap, __get_unmap_pool(cnt)->pool);
} }
...@@ -1074,6 +1075,7 @@ dmaengine_get_unmap_data(struct device *dev, int nr, gfp_t flags) ...@@ -1074,6 +1075,7 @@ dmaengine_get_unmap_data(struct device *dev, int nr, gfp_t flags)
memset(unmap, 0, sizeof(*unmap)); memset(unmap, 0, sizeof(*unmap));
kref_init(&unmap->kref); kref_init(&unmap->kref);
unmap->dev = dev; unmap->dev = dev;
unmap->map_cnt = nr;
return unmap; return unmap;
} }
......
...@@ -191,12 +191,10 @@ static void mv_set_mode(struct mv_xor_chan *chan, ...@@ -191,12 +191,10 @@ static void mv_set_mode(struct mv_xor_chan *chan,
static void mv_chan_activate(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"); dev_dbg(mv_chan_to_devp(chan), " activate chan.\n");
activation = readl_relaxed(XOR_ACTIVATION(chan));
activation |= 0x1; /* writel ensures all descriptors are flushed before activation */
writel_relaxed(activation, XOR_ACTIVATION(chan)); writel(BIT(0), XOR_ACTIVATION(chan));
} }
static char mv_chan_is_busy(struct mv_xor_chan *chan) static char mv_chan_is_busy(struct mv_xor_chan *chan)
......
...@@ -429,6 +429,7 @@ typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param); ...@@ -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); typedef void (*dma_async_tx_callback)(void *dma_async_param);
struct dmaengine_unmap_data { struct dmaengine_unmap_data {
u8 map_cnt;
u8 to_cnt; u8 to_cnt;
u8 from_cnt; u8 from_cnt;
u8 bidi_cnt; u8 bidi_cnt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment