From patchwork Fri May 14 06:22:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 52562 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1EBC8B7E80 for ; Fri, 14 May 2010 16:33:22 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1OCoQA-0000gG-Mr; Fri, 14 May 2010 06:30:55 +0000 Received: from mail-pv0-f177.google.com ([74.125.83.177]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1OCoIW-0002kP-8c; Fri, 14 May 2010 06:23:03 +0000 Received: by pvg3 with SMTP id 3so513072pvg.36 for ; Thu, 13 May 2010 23:22:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=+eEhjp5md+95Q1quqWG+Guyill1vZRCMkjAaMb8Vnbo=; b=F83kx7PmbnexsT1GfmoixIGAcwt3wpCygtSiULzGmq0jc2HPLI/oI8WM30d5vNDzWR ULQxvf7D8K0V+QfalmJRC5LNl/nORtOjl1GBQkFLW1wPQyHwHDdZxMwitAVSi7YVQALD M+jfvonnp6cTcmT3dBxbAynb1sY3wvlhvVVts= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=sCpqar0cCeTqZTqUR3ozEnsCzp9+fN3yR1qKfJhogvUjJnC6aQB76BxRa5TkDwRS7T zYJtqTcV8L4jHexQt/tainBqftk8M4VYdlZGGUe7Jf52GK6A/Gpeaxb8491cRlroa/Ja Zb1RRA+EumjHP3L7J4EQQAatjoAXZB3DFw/GY= MIME-Version: 1.0 Received: by 10.142.1.29 with SMTP id 29mr377770wfa.337.1273818179087; Thu, 13 May 2010 23:22:59 -0700 (PDT) Received: by 10.142.252.16 with HTTP; Thu, 13 May 2010 23:22:59 -0700 (PDT) Date: Fri, 14 May 2010 14:22:59 +0800 Message-ID: Subject: [PATCH 16/20] mtd: pxa3xx_nand: fix reset timeout on mmp2 From: Haojian Zhuang To: Marc Kleine-Budde , David Woodhouse , David Woodhouse , linux-mtd@lists.infradead.org, Eric Miao , linux-arm-kernel X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100514_022301_617418_C58C0305 X-CRM114-Status: GOOD ( 16.06 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.3.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.83.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is freemail (haojian.zhuang[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From 08439bc0a24c82b287fd7d53160bdeea71d60e27 Mon Sep 17 00:00:00 2001 From: Lei Wen Date: Mon, 29 Mar 2010 17:35:45 +0800 Subject: [PATCH] mtd: pxa3xx_nand: fix reset timeout on mmp2 For mmp2 board, reset command would always have timeout when enable the IRQ processing. The command done would comes after exit the IRQ processing whatever the timeout value is set. Change reset command use polling mode fix the issue. Signed-off-by: Lei Wen Signed-off-by: Haojian Zhuang --- drivers/mtd/nand/pxa3xx_nand.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) | cmd; @@ -1123,7 +1127,7 @@ static void pxa3xx_nand_cmdfunc(struct mtd_info *mtd, unsigned command, { struct pxa3xx_nand_info *info = mtd->priv; struct pxa3xx_nand *nand = info->nand_data; - int ret, exec_cmd; + int ret, exec_cmd, polling_mode; /* if this is a x16 device ,then convert the input * "byte" address into a "word" address appropriate @@ -1140,6 +1144,7 @@ static void pxa3xx_nand_cmdfunc(struct mtd_info *mtd, unsigned command, } DBG_NAND(printk("command %x, page %x\n", command, page_addr)); + polling_mode = use_polling; exec_cmd = prepare_command_pool(nand, command, column, page_addr); if (exec_cmd) { init_completion(&nand->cmd_complete); @@ -1160,6 +1165,7 @@ static void pxa3xx_nand_cmdfunc(struct mtd_info *mtd, unsigned command, disable_int(nand, NDCR_INT_MASK); nand->state &= ~STATE_CMD_PREPARED; } + use_polling = polling_mode; } static uint8_t pxa3xx_nand_read_byte(struct mtd_info *mtd) diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 31ebc78..2eebd20 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1099,6 +1099,10 @@ static int prepare_command_pool(struct pxa3xx_nand *nand, int command, break; case NAND_CMD_RESET: + /* on some platform, it is stranger that when issue reset command, + * cmd done would not come till timeout cause irq exit. + * Force polling mode for reset command*/ + use_polling = 1; cmd = cmdset.reset; info->ndcb0[0] |= NDCB0_CMD_TYPE(5)