]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mtd: rawnand: lpc32xx_slc: fail DMA transfer on completion timeout
authorPengpeng Hou <pengpeng@iscas.ac.cn>
Fri, 3 Jul 2026 07:39:43 +0000 (15:39 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 3 Jul 2026 13:45:55 +0000 (15:45 +0200)
commit17a8ce84964f243c8f89dc7353ac7e8d3137bc74
tree91eb9e262b422c153fe1a6de5baa51e10842f74a
parentdbf590b662695b16fbf5917ef129697be4410ea9
mtd: rawnand: lpc32xx_slc: fail DMA transfer on completion timeout

lpc32xx_xmit_dma() waits for the DMA completion callback but ignores
wait_for_completion_timeout(). A timed out DMA transfer is therefore
unmapped and reported as successful to the NAND read/write path.

Return -ETIMEDOUT when the completion wait expires. Terminate the DMA
channel before unmapping the scatterlist so the timed out transfer cannot
continue to access the buffer after the error is returned.

Fixes: 2944a44da09e ("mtd: add LPC32xx SLC NAND driver")
Cc: stable@vger.kernel.org
Reviewed-by: Vladimir Zapolskiy <vz@kernel.org>
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/lpc32xx_slc.c