Question about the size field of mtd_info

Jörn Engel joern at
Tue Feb 26 02:10:10 EST 2008

On Mon, 25 February 2008 20:55:58 -0800, Bruce_Leonard at wrote:
> 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?

It is either a bug or a design limitation, depending on your mood.
Patches to change this are welcome, in particular when the submitter is
willing to work on them until they are merge-worthy.


This above all: to thine own self be true.
-- Shakespeare

More information about the linux-mtd mailing list