Skip to content
Commit 4a3e85f2 authored by Boris Brezillon's avatar Boris Brezillon
Browse files

mtd: devices: m25p80: Make sure the buffer passed in op is DMA-able



As documented in spi-mem.h, spi_mem_op->data.buf.{in,out} must be
DMA-able, and commit 4120f8d1 ("mtd: spi-nor: Use the spi_mem_xx()
API") failed to follow this rule as buffers passed to
->{read,write}_reg() are usually placed on the stack.

Fix that by allocating a scratch buffer and copying the data around.

Fixes: 4120f8d1 ("mtd: spi-nor: Use the spi_mem_xx() API")
Reported-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Tested-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
parent 85516a98
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