From: "min" <min@xj9.so-net.ne.jp>
To: <linux-mtd@lists.infradead.org>
Subject: Failed to erase flash while multiple erase processes are running
Date: Sat, 6 Dec 2008 00:07:08 +0900 [thread overview]
Message-ID: <000e01c956eb$3732cff0$0201a8c0@Dell2300> (raw)
Hello,everyone:
I am using Linux 2.16.18(powerpc) to develop an embeded linux system.
My Flash is S29GL256P(serval partitions are divided in it,included a data
area(JFFS2),and a config area(no filesystem, used to write product code or
serial number).
I write a program to save data(for example:serial number) to config area
with mmap function(/dev/mtdblock5),and they work ok.
But the problem is while I am copying a file in JFFS2 area ,and concurrently
to run My mmap program, the following error will be outputed by syslogd on
an irregular base.
Nov 28 05:43:42 kernel: Erase at 0x00220000 failed immediately: errno -5
Nov 28 05:50:27 kernel: Erase at 0x00440000 failed immediately: errno -5
Nov 28 06:15:27 kernel: Erase at 0x00100000 failed immediately: errno -5
...
If I execute a test shell script to copy files and mmap program
repeatedly,in the end,it will be failed to copy file because of "No space
left on device".The usage rate of JFFS2 area will be 100%!
I debugged the Linux kernel,and found it failed in function
do_erase_chip()
(/drivers/mtd/chips/cfi_cmdset_0002.c)
static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)
{
struct cfi_private *cfi = map->fldrv_priv;
unsigned long timeo = jiffies + HZ;
unsigned long int adr;
DECLARE_WAITQUEUE(wait, current);
int ret = 0;
:::
:::
/* Did we succeed? */
if (!chip_good(map, adr, map_word_ff(map))) {
/* reset on all failures. */
map_write( map, CMD(0xF0), chip->start );
/* FIXME - should have reset delay before continuing */
ret = -EIO; //Fail here occasionally!!!
}
chip->state = FL_READY;
xip_enable(map, chip, adr);
put_chip(map, chip, adr);
spin_unlock(chip->mutex);
return ret;
}
it seems that erase failure occurs if erase process in JFFS2 copy files is
executed while erase process in mmap program is running.
Is it a known problem,and is there a patch to fix it?
Any advice will be appreciated,thank you in advance.
min
reply other threads:[~2008-12-05 15:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='000e01c956eb$3732cff0$0201a8c0@Dell2300' \
--to=min@xj9.so-net.ne.jp \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox