From: Huang Shijie <b32955@freescale.com>
To: Matthieu CASTET <matthieu.castet@parrot.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
Artem Bityutskiy <dedekind1@gmail.com>
Subject: Re: question: Why the nand_wait() wait for 20ms for nand program.
Date: Tue, 22 Jan 2013 10:46:33 +0800 [thread overview]
Message-ID: <50FDFD89.7030407@freescale.com> (raw)
In-Reply-To: <50FD0B3D.2070803@parrot.com>
于 2013年01月21日 17:32, Matthieu CASTET 写道:
> Huang Shijie a écrit :
>> 于 2013年01月21日 17:15, Matthieu CASTET 写道:
>>> Huang Shijie a écrit :
>>>> 于 2013年01月21日 16:57, Matthieu CASTET 写道:
>>>>> Huang Shijie a écrit :
>>>>>> 于 2013年01月18日 20:26, Matthieu CASTET 写道:
>>>>>>> Huang Shijie a écrit :
>>>>>>>> Hi all:
>>>>>>>> Why the nand_wait() wait for 20ms for nand program. could we
>>>>>>>> expand this time to 40ms? I have a nand chip : Micron MT29F64G08CBABAWP.
>>>>>>>> The chip's BUSY/READY pin may needs more then 20ms to become ready,
>>>>>>>> though its
>>>>>>>> datasheet tells me the tPROG's max value is 2.5ms.
>>>>>>>>
>>>>>>> Don't you have an hardware problem (missing pullup/down on ready busy pin) ?
>>>>>>>
>>>>>>> If the datasheet say the max value is 2.5 ms , how it can be more than 20 ms.
>>>>>> I finally found the root cause.
>>>>>>
>>>>>> I added the do_gettimeofday() in the nand_wait() to measure the
>>>>>> READY/BUSY time. The code is like this:
>>>>>> ---------------------------------------------------- code start
>>>>>>
>>>>> Could you dump jiffies and timeo in your code ?
>>>> The following just shows some part of the log:
>>>>
>>>> [my_nand_wait]status : 80,<21480, 21480>,< 665911, 664170>,<1, 1741>
>>>> [my_nand_wait]status : 80,<21480, 21480>,< 735989, 734626>,<1, 1363>
>>>> [my_nand_wait]status : 80,<21480, 21480>,< 805693, 804825>,<0, 868>
>>>>
>>>> From the log, we can see that the kernel just waits for 1741us to break
>>>> the while loop,
>>>> not 20ms.
>>>>
>>> Yes but you should display jiffies and timeo value to understand why the kernel
>>> thinks 2 jiffies elapsed.
>> I dumpped the jiffies and timeo too. The jiffies is really _equal_ to
>> the timeo, and then the while loop breaks.
>>
>> thanks for your comments.
>>
>> I think there is something wrong with the timer.
>>
> timeo += (HZ * 20) / 1000;
>
> So what is the value of HZ ?
>
> In order (HZ * 20) / 1000 is 0 HZ should be< 50.
thanks for your help.
I really appreciate it.
this bug is caused by our unstable kernel.
I tried with some other stable code, the issue never occurs.
thanks
Huang shijie
>
> Matthieu
>
prev parent reply other threads:[~2013-01-22 2:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-18 8:05 question: Why the nand_wait() wait for 20ms for nand program Huang Shijie
2013-01-18 12:26 ` Matthieu CASTET
2013-01-21 3:34 ` Huang Shijie
2013-01-21 8:57 ` Matthieu CASTET
[not found] ` <50FD0554.8030108@freescale.com>
2013-01-21 9:15 ` Matthieu CASTET
2013-01-21 9:25 ` Huang Shijie
2013-01-21 9:32 ` Matthieu CASTET
2013-01-21 9:35 ` Huang Shijie
[not found] ` <50FF9068.1030709@freescale.com>
2013-02-01 16:58 ` question about mtd_torturetest.c Artem Bityutskiy
2013-02-04 5:19 ` Gupta, Pekon
2013-02-04 6:58 ` Artem Bityutskiy
2013-02-04 7:32 ` Huang Shijie
2013-01-22 2:46 ` Huang Shijie [this message]
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=50FDFD89.7030407@freescale.com \
--to=b32955@freescale.com \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=matthieu.castet@parrot.com \
/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