linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Which way to store log in flash on mpc8xx?
@ 2005-09-19  9:55 David Jander
  2005-09-19 15:09 ` Frank
  2005-09-19 15:37 ` Wolfgang Denk
  0 siblings, 2 replies; 14+ messages in thread
From: David Jander @ 2005-09-19  9:55 UTC (permalink / raw)
  To: linuxppc-embedded


Hi all,

I am looking for a reliable way to store logfiles in flash. The logfiles are 
written by syslogd.
The problem is that I am running on a MPC8xx processor, and kernel 2.6 is not 
quite there yet for that processor, so I have to stick with 2.4.
Kernel of choice seems to be denx linuxppc_2_4_devel, but I cannot trust the 
version of jffs2 used in that kernel anymore. Somtimes gc.c crashes with a 
BUG() in line 139, and sometimes processes are frozen for a looong time 
waiting for GC. I have debugged that problem a little bit, and definitely, 
the FLASH access works ok, and the chip is new. No CRC- or read-errors, but 
still gc.c crashes.
The version of mtd/jffs2 drivers in that kernel seem to be from march/2005 cvs 
code, but when I read the following, I get even more scared:
http://www.linux-mtd.infradead.org/source.html#kernelversions

So, I need something different. jffs (1) maybe ?
This must be a very common task (to store logfiles in flash), but I just can't 
seem to find the right way to do it.

Any advice is highly appreciated.

Sincerely,

-- 
David Jander
Protonic Holland.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: Which way to store log in flash on mpc8xx?
@ 2005-09-20 20:25 Eli Brin
  0 siblings, 0 replies; 14+ messages in thread
From: Eli Brin @ 2005-09-20 20:25 UTC (permalink / raw)
  To: David Jander; +Cc: linuxppc-embedded

Hello David,

Wolfgang wrote:
>Yes, there is. Run the system with root file system mounted over NFS,
>and then put some load on the system, like  by  compiling  the  linux
>kernel  on  the  target.

If you want to have some fun, and stress the platform, compile and run (via
NFS) Crafty, an open source Linux chess porgram.

We did so on our 8xx target and it plays very well...

Best regards,
Eli Brin

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: Which way to store log in flash on mpc8xx?
@ 2005-11-29 15:37 Fillod Stephane
  0 siblings, 0 replies; 14+ messages in thread
From: Fillod Stephane @ 2005-11-29 15:37 UTC (permalink / raw)
  To: David Jander; +Cc: linux-mtd, linuxppc-embedded

David Jander wrote:
[..]
>After getting some advice from peoble at mtd-list, I switched to 2.6.14
for=20
>our new developments, and jffs2 seems a lot more stable now. I can only

>recommend you to consider switching. Besides consuming a little more
RAM and=20
>Flash, 2.6.14 is miles ahead in terms of almost anything else, plus
it's a=20
>bit faster on 8xx than 2.4.25!!

Strange. I heard a different song here[1], but haven't checked the fact=20
myself. From what I've seen, mtd/jffs2 is faster on 2.6.x than 2.4.x.

[1] http://www.denx.de/wiki/Know/Linux24vs26

>I have to warn you though, that it still seems not to be as rock-solid
as one=20
>might want for an embedded system: We have a stress test running for a
few=20
>weeks now simulating power-failures during writes to files on jffs2,
and mtd=20
>has some occasional hick-ups. Those hick-ups seem to be far less
serious than=20
>gc.c crashing, but we will have to take them into account in our
application.
>This is the situation: Sometimes the test application crashes giving a=20
>write-error on the mtd device, preceded by an error message from the=20
>mtd-driver (and jffs2, but the problem seems to come from mtd). The
error=20
>message is like "MTD do_write_buffer(): software timeout", which
normally=20

See the patch past my sig. It changes the timeout from couple ms to 1
second.
RTAI & Xenomai users should need it. IMHO, the WANT_SHORT_WTIMEOUT
embraced code should simply go away, or get a decent explanation.

>means a flash programming error, most probably due to sector beeing
worn out,=20
>but I don't think that is the case, since those problems began
appearing=20
>quite early and went away all by them selves. Flash doesn't magically
"fix"=20
itself over time, does it?
>Maybe it's a problem in the AMD flash driver (our device is a Spansion=20
Mirror-bit S29GL256M11)

Regards,
--=20
Stephane


--- drivers/mtd/chips/cfi_cmdset_0002.c	12 Sep 2005 09:27:29 -0000
+++ drivers/mtd/chips/cfi_cmdset_0002.c	29 Nov 2005 15:30:30 -0000
@@ -935,6 +935,12 @@
 	struct cfi_private *cfi =3D map->fldrv_priv;
 	unsigned long timeo =3D jiffies + HZ;
 	/*
+	 * Hardware errors should be infrequent,
+	 * so a short timeout is of no benefit.
+	 * And it just hurts with RTAI.
+	 */
+#ifdef WANT_SHORT_WTIMEOUT
+	/*
 	 * We use a 1ms + 1 jiffies generic timeout for writes (most
devices
 	 * have a max write time of a few hundreds usec). However, we
should
 	 * use the maximum timeout value given by the chip at probe time
@@ -944,6 +950,7 @@
 	 * timeout of 0 jiffies if HZ is smaller than 1000.
 	 */
 	unsigned long uWriteTimeout =3D ( HZ / 1000 ) + 1;
+#endif
 	int ret =3D 0;
 	map_word oldd;
 	int retry_cnt =3D 0;
@@ -987,8 +994,10 @@
 				adr, map_bankwidth(map),
 				chip->word_write_time);
=20
+#ifdef WANT_SHORT_WTIMEOUT
 	/* See comment above for timeout value. */
 	timeo =3D jiffies + uWriteTimeout;=20
+#endif
 	for (;;) {
 		if (chip->state !=3D FL_WRITING) {
 			/* Someone's suspended the write. Sleep */
@@ -1189,8 +1198,15 @@
 {
 	struct cfi_private *cfi =3D map->fldrv_priv;
 	unsigned long timeo =3D jiffies + HZ;
+	/*
+	 * Hardware errors should be infrequent,
+	 * so a short timeout is of no benefit.
+	 * And it just hurts with RTAI.
+	 */
+#ifdef WANT_SHORT_WTIMEOUT
 	/* see comments in do_write_oneword() regarding uWriteTimeo. */
 	unsigned long uWriteTimeout =3D ( HZ / 1000 ) + 1;
+#endif
 	int ret =3D -EIO;
 	unsigned long cmd_adr;
 	int z, words;
@@ -1248,7 +1264,9 @@
 				adr, map_bankwidth(map),
 				chip->word_write_time);
=20
+#ifdef WANT_SHORT_WTIMEOUT
 	timeo =3D jiffies + uWriteTimeout;=20
+#endif
 	=09
 	for (;;) {
 		if (chip->state !=3D FL_WRITING) {

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-11-29 16:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-19  9:55 Which way to store log in flash on mpc8xx? David Jander
2005-09-19 15:09 ` Frank
2005-09-19 15:37 ` Wolfgang Denk
2005-09-19 17:26   ` David Jander
2005-09-19 19:21     ` Wolfgang Denk
2005-09-20  9:17       ` David Jander
2005-09-20 18:07         ` Wolfgang Denk
2005-11-29  1:06           ` David Ho
2005-11-29 14:17             ` David Jander
2005-09-19 18:40   ` Shawn Jin
2005-09-19 19:07     ` Jörn Engel
2005-09-19 19:29     ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2005-09-20 20:25 Eli Brin
2005-11-29 15:37 Fillod Stephane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).