From: leiwen@marvell.com (Lei Wen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 23/25] pxa3xx_nand: fix reset timeout on mmp2
Date: Wed, 9 Jun 2010 09:53:18 +0800 [thread overview]
Message-ID: <mailman.46.1276839603.27306.linux-arm-kernel@lists.infradead.org> (raw)
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 <leiwen@marvell.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
---
drivers/mtd/nand/pxa3xx_nand.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index e76264c..99f4088 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -968,6 +968,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;
nand->ndcb0[0] |= NDCB0_CMD_TYPE(5)
| cmd;
@@ -993,7 +997,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
@@ -1009,6 +1013,7 @@ static void pxa3xx_nand_cmdfunc(struct mtd_info
*mtd, unsigned command,
nand_writel(nand, NDTR1CS0, info->ndtr1cs0);
}
+ polling_mode = use_polling;
exec_cmd = prepare_command_pool(nand, command, column, page_addr);
if (exec_cmd) {
init_completion(&nand->cmd_complete);
@@ -1028,6 +1033,7 @@ static void pxa3xx_nand_cmdfunc(struct mtd_info
*mtd, unsigned command,
}
nand->state &= ~STATE_CMD_PREPARED;
}
+ use_polling = polling_mode;
}
static uint8_t pxa3xx_nand_read_byte(struct mtd_info *mtd)
--
1.7.0.4
next reply other threads:[~2010-06-09 1:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-09 1:53 Lei Wen [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-06-18 5:37 [PATCH 23/25] pxa3xx_nand: fix reset timeout on mmp2 Haojian Zhuang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mailman.46.1276839603.27306.linux-arm-kernel@lists.infradead.org \
--to=leiwen@marvell.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).