]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: nand: omap2: Start dma request before enabling prefetch
authorCooper Jr., Franklin <fcooper@ti.com>
Fri, 15 Apr 2016 20:28:58 +0000 (15:28 -0500)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Thu, 5 May 2016 21:52:01 +0000 (23:52 +0200)
commit44211a590a0e5e4e31c30429d39bea0644850b2b
treea2216df0988f6932d387437d9eaafe53d13fe945
parent82579e42fa6fbe65bf5d0ec6b984a6e7af3b0e21
mtd: nand: omap2: Start dma request before enabling prefetch

The prefetch engine sends a dma request once a FIFO threshold has
been met. No other requests are received until the previous request
is handled.

Starting a dma transfer (dma_async_issue_pending) results in any
previous event for the dma channel to be cleared. Therefore, starting
the prefetch engine before initiating the dma transfer may result in
the prefetch triggering a dma request but instead of it being handled
it can end up being cleared. This will result in a hang since the code
will continue to wait for the dma request to complete.

By initiating the dma request before enabling the prefetch engine this
race condition is avoided and no dma request are missed/cleared.

Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/omap2.c