From: Artem Bityutskiy <dedekind@infradead.org>
To: Peter Horton <phorton@bitbox.co.uk>
Cc: dwmw2@infradead.org, Peter Horton <zero@colonel-panic.org>,
linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org
Subject: Re: [PATCH] mtd: fix timeout in M25P80 driver
Date: Fri, 17 Apr 2009 12:21:28 +0300 [thread overview]
Message-ID: <1239960088.3390.297.camel@localhost.localdomain> (raw)
In-Reply-To: <49E83C3D.8020404@bitbox.co.uk>
On Fri, 2009-04-17 at 09:22 +0100, Peter Horton wrote:
> Artem Bityutskiy wrote:
> > On Mon, 2009-04-13 at 15:26 +0100, Peter Horton wrote:
> >> Extend erase timeout in M25P80 SPI Flash driver.
> >>
> >> The M25P80 drivers fails erasing sectors on a M25P128 because the ready
> >> wait timeout is too short. Change the timeout from a simple loop count to a
> >> suitable number of seconds.
> >>
> >> Signed-off-by: Peter Horton <zero@colonel-panic.org>
> >> ---
> >> Index: linux-2.6.29-git12/drivers/mtd/devices/m25p80.c
> >> ===================================================================
> >> --- linux-2.6.29-git12.orig/drivers/mtd/devices/m25p80.c 2009-04-12 21:41:16.000000000 +0000
> >> +++ linux-2.6.29-git12/drivers/mtd/devices/m25p80.c 2009-04-12 21:43:01.000000000 +0000
> >> @@ -54,7 +54,7 @@
> >> #define SR_SRWD 0x80 /* SR write protect */
> >>
> >> /* Define max times to check status register before we give up. */
> >> -#define MAX_READY_WAIT_COUNT 100000
> >> +#define MAX_READY_WAIT_JIFFIES (10 * HZ) /* eg. M25P128 specs 6s max sector erase */
> >> #define CMD_SIZE 4
> >>
> >> #ifdef CONFIG_M25PXX_USE_FAST_READ
> >> @@ -145,20 +145,20 @@
> >> */
> >> static int wait_till_ready(struct m25p *flash)
> >> {
> >> - int count;
> >> + unsigned long deadline;
> >> int sr;
> >>
> >> - /* one chip guarantees max 5 msec wait here after page writes,
> >> - * but potentially three seconds (!) after page erase.
> >> - */
> > Why did you remove the comment? Is it wrong or useless?
> >
>
> I moved the comment up to the definition of MAX_READY_WAIT_JIFFIES.
> Looking through the code I missed the fact the driver can generate "chip
> erase", on the M25P128 the maximum ready timeout for this is 250s !!!
So I assume you are going to send another patch? Also, how about
Andrew's suggestion not to hog CPU?
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
prev parent reply other threads:[~2009-04-17 9:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-13 14:26 [PATCH] mtd: fix timeout in M25P80 driver Peter Horton
2009-04-13 19:33 ` Martin Michlmayr
2009-04-15 23:10 ` Andrew Morton
2009-04-17 7:24 ` Artem Bityutskiy
2009-04-17 8:22 ` Peter Horton
2009-04-17 9:21 ` Artem Bityutskiy [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=1239960088.3390.297.camel@localhost.localdomain \
--to=dedekind@infradead.org \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=phorton@bitbox.co.uk \
--cc=zero@colonel-panic.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