Skip to content

Commit

Permalink
mtd: docg3 increase write/erase timeout
Browse files Browse the repository at this point in the history
After several tries with ubifs, it appears empirically that constructor
provided figures for erase/write timeouts are underestimated. A timeout
of 100ms seems to work with a 5 years worn chip, and no timeouts occur
anymore.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Robert Jarzmik authored and David Woodhouse committed Mar 27, 2012
1 parent a7baef1 commit a2b3d28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/mtd/devices/docg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,10 +1116,10 @@ static int doc_get_op_status(struct docg3 *docg3)
*/
static int doc_write_erase_wait_status(struct docg3 *docg3)
{
int status, ret = 0;
int i, status, ret = 0;

if (!doc_is_ready(docg3))
usleep_range(3000, 3000);
for (i = 0; !doc_is_ready(docg3) && i < 5; i++)
msleep(20);
if (!doc_is_ready(docg3)) {
doc_dbg("Timeout reached and the chip is still not ready\n");
ret = -EAGAIN;
Expand Down

0 comments on commit a2b3d28

Please sign in to comment.