public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* The magic bitmask question - again
@ 2005-10-31 12:31 Fredrik Jönsson B (AL/EAB)
  2005-10-31 13:03 ` Artem B. Bityutskiy
  2005-10-31 13:15 ` David Jander
  0 siblings, 2 replies; 4+ messages in thread
From: Fredrik Jönsson B (AL/EAB) @ 2005-10-31 12:31 UTC (permalink / raw)
  To: linux-mtd


This may be a stupid question, but I still need to ask.

We have a system with a 128Mb NOR-flash of which 3Mb is used as a keep-off area for the kernel and the rest for a JFFS2 root file system. The system boots and mounts properly and everything seems fine, but during mounting a number of messages such as the one below are shown for each of the first four erase-blocks of the mtd partition.

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x4800 instead

Is this the expected behaviour? I've been fiddling with the padding option to mkfs.jffs2 in order to make the message go away without success. I've noted in the JFFS paper that four free flash sectors is "required" for garbage collection to work properly. Is it some sort of spare four sectors that mkfs.jffs2 creates for this purpose or what?

I've seen this question a number of times on the web, but have not seen it properly answered anywhere. 

Grateful for any help on the matter,

	/Fredrik Jönsson

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

* Re: The magic bitmask question - again
  2005-10-31 12:31 The magic bitmask question - again Fredrik Jönsson B (AL/EAB)
@ 2005-10-31 13:03 ` Artem B. Bityutskiy
  2005-10-31 13:15 ` David Jander
  1 sibling, 0 replies; 4+ messages in thread
From: Artem B. Bityutskiy @ 2005-10-31 13:03 UTC (permalink / raw)
  To: "Fredrik Jönsson B (AL/EAB)"; +Cc: linux-mtd

Fredrik Jönsson B (AL/EAB) wrote:
> This may be a stupid question, but I still need to ask.
> 
> We have a system with a 128Mb NOR-flash of which 3Mb is used as a
> keep-off area for the kernel and the rest for a JFFS2 root file
> system.
128 Megabit?

> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at
> 0x00000000: 0x4800 instead
This message says that there is something unexpected at the offset 
0x00000000 of the JFFS2 partition. JFFS2 expects there is either a node 
there (most likely a clean marker node) or the block contains all 0xFF.

How can this garbage get into the beginning of an eraseblock? No idea. 
May be this is an effect of an unclean reboot? But if it happens often 
it is strange and looks like something not normal. Or the other 
possibility is that you did not erase your flash properly before putting 
the JFFS2 image there. And also it may be the result of hardware/driver 
problems.

Try to play with this. Try to erase the partition, check that it 
actually contain all 0xFFs, flash your image, compare with the original, 
mount and see is there are such messages.

-- 
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.

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

* Re: The magic bitmask question - again
  2005-10-31 12:31 The magic bitmask question - again Fredrik Jönsson B (AL/EAB)
  2005-10-31 13:03 ` Artem B. Bityutskiy
@ 2005-10-31 13:15 ` David Jander
  1 sibling, 0 replies; 4+ messages in thread
From: David Jander @ 2005-10-31 13:15 UTC (permalink / raw)
  To: linux-mtd

On Monday 31 October 2005 13:31, Fredrik Jönsson B wrote:
>[...]
> We have a system with a 128Mb NOR-flash of which 3Mb is used as a keep-off 
> area for the kernel and the rest for a JFFS2 root file system. The system
> boots and mounts properly and everything seems fine, but during mounting a
> number of messages such as the one below are shown for each of the first
> four erase-blocks of the mtd partition.

How do you define your partition layout?
Are you sure that the beginning of the first jffs2 partition of MTD is not 
overlapping with your "keep-off" region? Eventually you could be trying to 
interpret parts of the kernel image as jffs2 filesystem. In that case you 
will get such messages.

Greetings,

-- 
David Jander

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

* RE: The magic bitmask question - again
@ 2005-10-31 15:52 Fredrik Jönsson B (AL/EAB)
  0 siblings, 0 replies; 4+ messages in thread
From: Fredrik Jönsson B (AL/EAB) @ 2005-10-31 15:52 UTC (permalink / raw)
  To: linux-mtd


> How do you define your partition layout?

mtd1: 00300000 00040000 "kernel"
mtd2: 07d00000 00040000 "jffs"

> Are you sure that the beginning of the first jffs2 partition 
> of MTD is not overlapping with your "keep-off" region? 

Yes, and studying the data on the partition confirms this.

> Eventually you could be trying to interpret parts of the 
> kernel image as jffs2 filesystem. In that case you will get 
> such messages.

That came to my mind, but this is unfortunately not the case, unless the scanning algorithm starts at wrong adress, i.e, at adress 0x0, and not the beginning of the /dev/mtd/2 (I'm using devfs) partition, at address 0x00300000. 

I just realized that this would be consistent with the output since the actual kernel spans four erase blocks after which the flash is empty up to the jffs partition. An inspection of the kernel partition confirms that the scan is starting from the 0x0 address.

The relevant bit of the command line for the kernel at boot is:
root=/dev/mtdblock/2 rootfstype=jffs2 mtdparts=USERFLASH:3072k(kernel),-(jffs)

I would have expected the jffs2 scan to start att the /dev/mtd/2 device when the file system is mounted at boot, but this is obviously not the case. However, if I boot from something else and mount the partition afterwards it works just fine, with no error output from the scan.

I'm not quite sure what I am missing here.

Regards,

	/Fredrik Jönsson Norrström

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

end of thread, other threads:[~2005-10-31 16:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-31 12:31 The magic bitmask question - again Fredrik Jönsson B (AL/EAB)
2005-10-31 13:03 ` Artem B. Bityutskiy
2005-10-31 13:15 ` David Jander
  -- strict thread matches above, loose matches on Subject: below --
2005-10-31 15:52 Fredrik Jönsson B (AL/EAB)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox