]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: rawnand: qcom: wait for desc completion in all BAM channels
authorAbhishek Sahu <absahu@codeaurora.org>
Wed, 20 Jun 2018 07:27:33 +0000 (12:57 +0530)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 18 Jul 2018 07:24:07 +0000 (09:24 +0200)
commit2cd4f8d608c4507f425edf5b2abd601d9f7fc10d
tree838a2bf99e3586d1871b57003c3ee8b4de00039e
parentf90132a37c68305e340bc34e3b6e5079691b7b3a
mtd: rawnand: qcom: wait for desc completion in all BAM channels

The BAM has 3 channels - tx, rx and command. command channel
is used for register read/writes, tx channel for data writes
and rx channel for data reads. Currently, the driver assumes the
transfer completion once it gets all the command descriptors
completed. Sometimes, there is race condition between data channel
(tx/rx) and command channel completion. In these cases,
the data present in buffer is not valid during small window
between command descriptor completion and data descriptor
completion.

This patch generates NAND transfer completion when both
(Data and Command) DMA channels have completed all its DMA
descriptors. It assigns completion callback in last
DMA descriptors of that channel and wait for completion.

Fixes: d9b5ef1a768a ("mtd: nand: qcom: support for command descriptor formation")
Cc: stable@vger.kernel.org
Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/qcom_nandc.c