Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1205404

[PATCH 2/3] mtd: nand: pxa3xx_nand: fix early spurious interrupt

From Robert Jarzmik <robert.jarzmik@free.fr>
Newsgroups linux.kernel
Subject [PATCH 2/3] mtd: nand: pxa3xx_nand: fix early spurious interrupt
Date 2015-08-11 22:10 +0200
Message-ID <pWo1Y-7ax-5@gated-at.bofh.it> (permalink)
References <pWo1Y-7ax-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


When the nand is first probe, and upon the first command start, the
status bits should be cleared before the interrupts are unmasked.

The bug is tricky : if the bootloader left a status bit set, the
unmasking of interrupts does trigger the interrupt handler before the
first command is issued, blocking the good behavior of the nand.

The same would happen if in pxa3xx_nand code flow a status bit is left,
and then a command is started.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 drivers/mtd/nand/pxa3xx_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index ed44bddcc43f..edfe329cc9db 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -451,8 +451,8 @@ static void pxa3xx_nand_start(struct pxa3xx_nand_info *info)
 	ndcr |= NDCR_ND_RUN;
 
 	/* clear status bits and run */
-	nand_writel(info, NDCR, 0);
 	nand_writel(info, NDSR, NDSR_MASK);
+	nand_writel(info, NDCR, 0);
 	nand_writel(info, NDCR, ndcr);
 }
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 2/3] mtd: nand: pxa3xx_nand: fix early spurious interrupt Robert Jarzmik <robert.jarzmik@free.fr> - 2015-08-11 22:10 +0200

csiph-web