public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Problem: 51MB partition max size on jffs2
@ 2002-12-04 16:54 Ken Offer
  2002-12-04 17:47 ` Thomas Gleixner
  2002-12-04 18:41 ` David Woodhouse
  0 siblings, 2 replies; 15+ messages in thread
From: Ken Offer @ 2002-12-04 16:54 UTC (permalink / raw)
  To: LinuxMTD

Hello all,

I've run into a strange problem and I wonder if any of you have seen 
this and perhaps understand it better.

I've got a Toshiba 128MB Smart Card in my embedded system and I wrote a 
custom nand driver to support it.  I have discovered that I cannot 
mount a jffs2 partition larger than 51MB on the card (so at this point 
I have two 51MB partitions and 1 26MB partition).  Trying to mount a 
larger partition yields a less than helpful error message from mount.  
I've tried adding printk statements to the jffs2 code, but none of them 
get hit during the errant mount process.

So... is 51MB a valid jffs2 limitation?  If so, why?

+-----------------------------------------------------------+
|  Ken Offer        koffer@arlut.utexas.edu         ARL:UT  |
|  Office: 512-835-3859                  Fax: 512-835-3259  |
+-----------------------------------------------------------+

^ permalink raw reply	[flat|nested] 15+ messages in thread
* RE: Problem: 51MB partition max size on jffs2
@ 2002-12-04 18:44 Dave Ellis
  2002-12-04 18:46 ` David Woodhouse
  0 siblings, 1 reply; 15+ messages in thread
From: Dave Ellis @ 2002-12-04 18:44 UTC (permalink / raw)
  To: 'Ken Offer'; +Cc: 'linux-mtd@lists.infradead.org'

On Wednesday 04 December 2002 17:54, Ken Offer wrote:
> I've got a Toshiba 128MB Smart Card in my embedded system and I wrote a 
> custom nand driver to support it.  I have discovered that I cannot 
> mount a jffs2 partition larger than 51MB on the card (so at this point 
> I have two 51MB partitions and 1 26MB partition).  Trying to mount a 
> larger partition yields a less than helpful error message from mount.  

I had the same problem a few weeks ago, and this patch seems
to solve it:

--- dist/fs/jffs2/build.c	Mon Sep  9 12:29:08 2002
+++ curr/fs/jffs2/build.c	Mon Nov 18 14:18:29 2002
@@ -211,7 +211,8 @@
 
 	c->free_size = c->flash_size;
 	c->nr_blocks = c->flash_size / c->sector_size;
-	c->blocks = kmalloc(sizeof(struct jffs2_eraseblock) * c->nr_blocks,
GFP_KERNEL);
+	/* kmalloc fails for large NAND since can't get more than 128K */
+	c->blocks = vmalloc(sizeof(struct jffs2_eraseblock) * c->nr_blocks);
 	if (!c->blocks)
 		return -ENOMEM;
 	for (i=0; i<c->nr_blocks; i++) {

kmalloc() is limited to 128K and the 128MB Flash needs more than twice that,

so I tried vmalloc() and it seems to be OK (at least with PPC 2.4.18 
patched for the new MTD code). Does anyone know if this change is safe?

Dave

^ permalink raw reply	[flat|nested] 15+ messages in thread
* RE: Problem: 51MB partition max size on jffs2
@ 2002-12-04 20:58 Dave Ellis
  0 siblings, 0 replies; 15+ messages in thread
From: Dave Ellis @ 2002-12-04 20:58 UTC (permalink / raw)
  To: 'Thomas Gleixner'; +Cc: 'linux-mtd@lists.infradead.org'

Thomas Gleixner wrote: 
> ... In actual CVS-code this problem is solved by building virtual 
> blocks of 2,4 or 8 physical blocks. 

Thanks! I hadn't checked CVS for a few weeks, so I didn't
realize there was a better solution. I'll drop the vmalloc()
change and use the CVS-code.

Dave
 

^ permalink raw reply	[flat|nested] 15+ messages in thread
* RE: Problem: 51MB partition max size on jffs2
@ 2002-12-06 21:00 Dave Ellis
  0 siblings, 0 replies; 15+ messages in thread
From: Dave Ellis @ 2002-12-06 21:00 UTC (permalink / raw)
  To: 'Ken Offer'; +Cc: LinuxMTD

Ken Offer wrote: 
> Ok, I switched back to the latest CVS and tried to mount the 
> partition. 
>   No luck, even with a 32MB partition.  I get:
> 
> mount -t jffs2 /dev/mtdblock1 /mnt/jffs
> mount: /dev/mtdblock1 is not a valid block device
> 
> I have tried the latest CVS with both the "vmalloc c->blocks" change 
> and without.  In both cases mount fails the same way.  I turned up 
> debugging all the way for jffs2 and mtd but no messages were 
> printed to 
> /var/log/messages.  Guess I need to scour the jffs2 code and add some 
> more printks...

The latest CVS (05-Dec-2002) is working for me with kmalloc()
for c->blocks. 128MB Nand flash, 8MB Nor Flash and slram running
on battery-backed RAM all work. I have only tried copying some
files to them, no extensive testing, but they all mount OK. This
is with PPC 2.4.18.

Dave

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

end of thread, other threads:[~2002-12-06 20:29 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-04 16:54 Problem: 51MB partition max size on jffs2 Ken Offer
2002-12-04 17:47 ` Thomas Gleixner
2002-12-04 22:00   ` Ken Offer
2002-12-04 22:02     ` Thomas Gleixner
2002-12-04 23:08       ` Ken Offer
2002-12-04 23:20         ` Thomas Gleixner
2002-12-05 17:53           ` Ken Offer
2002-12-04 18:41 ` David Woodhouse
  -- strict thread matches above, loose matches on Subject: below --
2002-12-04 18:44 Dave Ellis
2002-12-04 18:46 ` David Woodhouse
2002-12-04 19:01   ` Thomas Gleixner
2002-12-04 19:04     ` Charles Manning
2002-12-04 19:10       ` Thomas Gleixner
2002-12-04 20:58 Dave Ellis
2002-12-06 21:00 Dave Ellis

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