Question about the size field of mtd_info

Bruce_Leonard at selinc.com Bruce_Leonard at selinc.com
Mon Feb 25 23:55:58 EST 2008


I'm new to MTD (and writting drivers for Linux :-/ ), and I'm not sure 
about a result I'm seeing in mtd_info->size.  I'm putting together a NAND 
flash driver that ultimately will have 8G of flash attached to it in 2G, 
4G, and 8G stuffing options.  When I'm working with the 2G board 
everything looks fine, but when I jumped to the 4G board I found something 
interesting.  (I don't want to call it a bug, because I don't know how 
things work yet, so I'll stick with "interesting".)  With the 2G board 
mtd_info->size = 0x80000000, which is resonable, however, on the 4G board 
mtd_info->size = 0x0.  That makes sense because 4G= 0x100000000, one bit 
more than can be held in a 32-bit value which is how big mtd_info->size 
is, but it sure makes a mess of the calculations that use mtd_info->size. 
My question is, is this a bug or am I doing something wrong?

Thanks.

Bruce



More information about the linux-mtd mailing list