async_tx: fix kmap_atomic usage in async_memcpy
Andrew Morton: [async_memcpy] is very wrong if both ASYNC_TX_KMAP_DST and ASYNC_TX_KMAP_SRC can ever be set. We'll end up using the same kmap slot for both src add dest and we get either corrupted data or a BUG. Evgeniy Polyakov: Btw, shouldn't it always be kmap_atomic() even if flag is not set. That pages are usual one returned by alloc_page(). So fix the usage of kmap_atomic and kill the ASYNC_TX_KMAP_DST and ASYNC_TX_KMAP_SRC flags. Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
7c6129c68f
commit
eb0645a8b1
@ -51,10 +51,6 @@ struct dma_chan_ref {
|
||||
* @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a
|
||||
* dependency chain
|
||||
* @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining.
|
||||
* @ASYNC_TX_KMAP_SRC: if the transaction is to be performed synchronously
|
||||
* take an atomic mapping (KM_USER0) on the source page(s)
|
||||
* @ASYNC_TX_KMAP_DST: if the transaction is to be performed synchronously
|
||||
* take an atomic mapping (KM_USER0) on the dest page(s)
|
||||
*/
|
||||
enum async_tx_flags {
|
||||
ASYNC_TX_XOR_ZERO_DST = (1 << 0),
|
||||
@ -62,8 +58,6 @@ enum async_tx_flags {
|
||||
ASYNC_TX_ASSUME_COHERENT = (1 << 2),
|
||||
ASYNC_TX_ACK = (1 << 3),
|
||||
ASYNC_TX_DEP_ACK = (1 << 4),
|
||||
ASYNC_TX_KMAP_SRC = (1 << 5),
|
||||
ASYNC_TX_KMAP_DST = (1 << 6),
|
||||
};
|
||||
|
||||
#ifdef CONFIG_DMA_ENGINE
|
||||
|
Reference in New Issue
Block a user