[PATCH 5.5 157/257] mtd: rawnand: cadence: reinit completion before executing a new command
From: Greg Kroah-Hartman
Date: Thu Apr 16 2020 - 11:39:52 EST
From: Piotr Sroka <piotrs@xxxxxxxxxxx>
commit 0d7d6c8183aadb1dcc13f415941404a7913b46b3 upstream.
Reing the completion object before executing CDMA command to make sure
the 'done' flag is OK.
Fixes: ec4ba01e894d ("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Piotr Sroka <piotrs@xxxxxxxxxxx>
Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
Link: https://lore.kernel.org/linux-mtd/1581328530-29966-4-git-send-email-piotrs@xxxxxxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
drivers/mtd/nand/raw/cadence-nand-controller.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/mtd/nand/raw/cadence-nand-controller.c
+++ b/drivers/mtd/nand/raw/cadence-nand-controller.c
@@ -997,6 +997,7 @@ static int cadence_nand_cdma_send(struct
return status;
cadence_nand_reset_irq(cdns_ctrl);
+ reinit_completion(&cdns_ctrl->complete);
writel_relaxed((u32)cdns_ctrl->dma_cdma_desc,
cdns_ctrl->reg + CMD_REG2);