forked from Minki/linux
Two fixes for -stable:
1/ async_mult() sometimes maps less buffers than initially requested. We end up freeing dmaengine_unmap_data on an invalid pool. 2/ mv_xor: register write ordering fix -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJTfoDyAAoJEB7SkWpmfYgC5sUP/3r0GU3071DcZ74rW7yW9UMC EW+GyYLISl2X4+zdTTV4iLhtOx4tnS+xock5LylrMi0WKD8ma4/6057dc+ham9t7 1/5qeZyZ/lKUjOjhNBqBevzyKubWryafRklOnglP6KjNiDSKbVsvl7pgzPLTjhCE 7tqv3/86Q6W7MIGFDUPQhrd2zTk46Gmu7GZixJ1jN3YhW0hqsqbk+QJALjT7rG5n 0q7f7PM83e+f5LEqlM1Om4AEkCaYrf6P8Nkatcut6tecixplI2kDOgK/0JEIA5FT Fnr/3j6/WFYrpn/BVRR+33FeTA2ZUl2kWSVpyOKNiAHrzE2AGhlFN+uZelUERUGE cDeEw//dFdjf+JjotTdBtukzHlijhSLttX5cF2lK5XOUql1AK1WnWsPm4iZAQ1/x Hv3k6BnhwfIyyYRyo1qIr4QqYxpMjgW1U4Cn9WV03A+6OT4UK5Q/8dvIg6KtmF+o fXzHWCI/pRU6zLj5t1UmoNL+0EmT/gDAEkmHXdcbbKQUlB3tiGyPAzt1mCwlqcx8 p3VQk9BqlNvDzYtGRCabCGaRxnxtlY0agBu+2AmXIwg6a+qd70BSoo1Nypb2bTMk qrHmWX7RvqssPiWa9PUfIsUYSoCG162n6Eh93cMgPNoxXl380o+kD8t5wzHoWSoB UdMsu58bfuBbDVIQM/ec =XFIL -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
037430078f
@ -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);
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user