All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu CASTET <matthieu.castet@parrot.com>
To: "dedekind1@gmail.com" <dedekind1@gmail.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH] nand_wait_ready timeout fix
Date: Thu, 22 Nov 2012 18:06:13 +0100	[thread overview]
Message-ID: <50AE5B85.9010108@parrot.com> (raw)
In-Reply-To: <1352987717.2221.54.camel@sauron.fi.intel.com>

Artem Bityutskiy a écrit :
> On Mon, 2012-11-05 at 14:51 +0100, Matthieu CASTET wrote:
>> nand_wait_ready timeout should not assume HZ=1000.
>> Make it independent of HZ value like it is done in nand_wait.
>>
>> Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
>> ---
>>  drivers/mtd/nand/nand_base.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
>> index d5ece6e..ee49fe2 100644
>> --- a/drivers/mtd/nand/nand_base.c
>> +++ b/drivers/mtd/nand/nand_base.c
>> @@ -492,7 +492,7 @@ static void panic_nand_wait_ready(struct mtd_info *mtd, unsigned long timeo)
>>  void nand_wait_ready(struct mtd_info *mtd)
>>  {
>>  	struct nand_chip *chip = mtd->priv;
>> -	unsigned long timeo = jiffies + 2;
>> +	unsigned long timeo = jiffies + (2 * HZ) / 1000;
> 
> I HZ=100, (2 * HZ) / 1000 will be 0, which is probably wrong.
> 
> Instead, this cruft should be re-worked and should use milliseconds for
> time-outs, and use things like 'msecs_to_jiffies()' instead.
> 
> 

Ok,

Should I also update nand_wait [1] ?


Matthieu

[1]
static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip)
{

    unsigned long timeo = jiffies;
    int status, state = chip->state;

    if (state == FL_ERASING)
        timeo += (HZ * 400) / 1000;
    else
        timeo += (HZ * 20) / 1000;

  reply	other threads:[~2012-11-22 17:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-05 13:51 [PATCH] nand_wait_ready timeout fix Matthieu CASTET
2012-11-15 13:55 ` Artem Bityutskiy
2012-11-22 17:06   ` Matthieu CASTET [this message]
2012-11-30 12:35     ` Artem Bityutskiy
  -- strict thread matches above, loose matches on Subject: below --
2012-11-22 17:31 Matthieu CASTET
2012-11-23 12:45 ` Johan Gunnarsson
2012-11-30 13:20 ` Artem Bityutskiy

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=50AE5B85.9010108@parrot.com \
    --to=matthieu.castet@parrot.com \
    --cc=dedekind1@gmail.com \
    --cc=linux-mtd@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.