Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932608AbbHKUBd (ORCPT ); Tue, 11 Aug 2015 16:01:33 -0400 Received: from smtp10.smtpout.orange.fr ([80.12.242.132]:49340 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753435AbbHKUBb (ORCPT ); Tue, 11 Aug 2015 16:01:31 -0400 X-ME-Helo: belgarion.home X-ME-Date: Tue, 11 Aug 2015 22:01:29 +0200 X-ME-IP: 90.38.169.142 From: Robert Jarzmik To: Ezequiel Garcia , David Woodhouse , Brian Norris Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Robert Jarzmik Subject: [PATCH 2/3] mtd: nand: pxa3xx_nand: fix early spurious interrupt Date: Tue, 11 Aug 2015 21:57:13 +0200 Message-Id: <1439323034-8820-2-git-send-email-robert.jarzmik@free.fr> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1439323034-8820-1-git-send-email-robert.jarzmik@free.fr> References: <1439323034-8820-1-git-send-email-robert.jarzmik@free.fr> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1309 Lines: 37 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 --- 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/