Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754144AbZF1FlK (ORCPT ); Sun, 28 Jun 2009 01:41:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751448AbZF1Fk6 (ORCPT ); Sun, 28 Jun 2009 01:40:58 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:35867 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751430AbZF1Fk6 (ORCPT ); Sun, 28 Jun 2009 01:40:58 -0400 Message-ID: <59240.192.168.10.88.1246167644.squirrel@dbdmail.itg.ti.com> Date: Sun, 28 Jun 2009 11:10:44 +0530 (IST) Subject: Re: [PATCH][MTD][NAND]: fix omap2.c compile failure and warning From: "vimal singh" To: "David Woodhouse" User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Priority: 3 (Normal) Importance: Normal Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1813 Lines: 55 > Er, did he? And please put proper email addresses in. If you can't find > an @ sign on your keyboard, cut and paste it from elsewhere. Corrected this. >> - if (!(status & 0x40)) >> + if (status & NAND_STATUS_READY) >> break; > > Hm... now you're polling the PASS/FAIL bit in the status, not the > READY/BUSY bit. I suspect that's not going to work too well... > Value of macro 'NAND_STATUS_READY' is '0x40' only. And AFAIK this is the bit for ready/busy, isn't it? Signed-off-by: Vimal Singh --- diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 0cd76f8..3b6e6ad 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include #include #include @@ -541,7 +543,7 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip struct omap_nand_info *info = container_of(mtd, struct omap_nand_info, mtd); unsigned long timeo = jiffies; - int status, state = this->state; + int status = NAND_STATUS_FAIL, state = this->state; if (state == FL_ERASING) timeo += (HZ * 400) / 1000; @@ -558,6 +560,7 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip status = __raw_readb(this->IO_ADDR_R); - if (!(status & 0x40)) + if (status & NAND_STATUS_READY) break; + cond_resched(); } return status; } -- 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/