public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* mtd partitions limited to 4 GB?
@ 2008-06-17  0:04 Mitch Bradley
  2008-06-17  0:22 ` Josh Boyer
  2008-06-17  0:41 ` Charles Manning
  0 siblings, 2 replies; 4+ messages in thread
From: Mitch Bradley @ 2008-06-17  0:04 UTC (permalink / raw)
  To: linux-mtd

In drivers/mtd/mtdpart.c, struct mtd_part has  "u_int32_t offset", thus 
(apparently) limiting the partition start offset to 4 GiB.  Similarly, 
struct mtd_partition in include/linux/mtd/partititions.h has "u_int32_t 
size" and "u_int32_offset".

Now that NAND FLASH device sizes have exceeded that, this appears to be 
a significant limitation.

Is anyone in the mtd community already addressing this?

Fixing the core infrastructure might be as simple as using "loff_t" 
instead of "u_int32_t" for those fields.  However, all of the existing 
partition map parsers appear to have the same 32-bit limitation, so 
partitioning a >4GiB device will require a new or modified partition map 
format.

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

* Re: mtd partitions limited to 4 GB?
  2008-06-17  0:04 mtd partitions limited to 4 GB? Mitch Bradley
@ 2008-06-17  0:22 ` Josh Boyer
  2008-06-17  0:41 ` Charles Manning
  1 sibling, 0 replies; 4+ messages in thread
From: Josh Boyer @ 2008-06-17  0:22 UTC (permalink / raw)
  To: Mitch Bradley; +Cc: linux-mtd

On Mon, 16 Jun 2008 14:04:06 -1000
Mitch Bradley <wmb@firmworks.com> wrote:

> In drivers/mtd/mtdpart.c, struct mtd_part has  "u_int32_t offset", thus 
> (apparently) limiting the partition start offset to 4 GiB.  Similarly, 
> struct mtd_partition in include/linux/mtd/partititions.h has "u_int32_t 
> size" and "u_int32_offset".

This is not limited to partitions.  The entire MTD subsystem is limited
to 4 GiB sized devices.

> Now that NAND FLASH device sizes have exceeded that, this appears to be 
> a significant limitation.
> 
> Is anyone in the mtd community already addressing this?

There have been some that have offered to help in recent weeks.  A
brainstorming session of sorts happened on the list a couple of weeks
ago.  You might check there for what was decided.

> Fixing the core infrastructure might be as simple as using "loff_t" 
> instead of "u_int32_t" for those fields.  However, all of the existing 
> partition map parsers appear to have the same 32-bit limitation, so 
> partitioning a >4GiB device will require a new or modified partition map 
> format.

IIRC, one of the outcomes of the discussion was to introduce a new
interface so that chips are addressed in block+offset mappings.  This
will be better overall, but requires a bit more overhead in the initial
implementation.

josh

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

* Re: mtd partitions limited to 4 GB?
  2008-06-17  0:04 mtd partitions limited to 4 GB? Mitch Bradley
  2008-06-17  0:22 ` Josh Boyer
@ 2008-06-17  0:41 ` Charles Manning
  2008-06-18 17:04   ` Bruce_Leonard
  1 sibling, 1 reply; 4+ messages in thread
From: Charles Manning @ 2008-06-17  0:41 UTC (permalink / raw)
  To: linux-mtd; +Cc: Mitch Bradley

On Tuesday 17 June 2008 12:04:06 Mitch Bradley wrote:
> In drivers/mtd/mtdpart.c, struct mtd_part has  "u_int32_t offset", thus
> (apparently) limiting the partition start offset to 4 GiB.  Similarly,
> struct mtd_partition in include/linux/mtd/partititions.h has "u_int32_t
> size" and "u_int32_offset".

As Josh says it is not just an mtd_part issue, but the whole guts of mtd 
suffer from this. The actual mtd_xxx interface to the kernel is close enough 
for most purposes.

I am aware of people using Linux with >4GB of NAND for a long time now (well 
over a year). They did this by writing their own mtd drivers that just fit 
onto the existing interface.  Many people do that anyway because the nand 
core stuff is slow relative to a tailor made driver.

>
> Now that NAND FLASH device sizes have exceeded that, this appears to be
> a significant limitation.
>
> Is anyone in the mtd community already addressing this?
>
> Fixing the core infrastructure might be as simple as using "loff_t"
> instead of "u_int32_t" for those fields.  However, all of the existing
> partition map parsers appear to have the same 32-bit limitation, so
> partitioning a >4GiB device will require a new or modified partition map
> format.

It is more than just changing the 32 to 64 bit types.

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

* Re: mtd partitions limited to 4 GB?
  2008-06-17  0:41 ` Charles Manning
@ 2008-06-18 17:04   ` Bruce_Leonard
  0 siblings, 0 replies; 4+ messages in thread
From: Bruce_Leonard @ 2008-06-18 17:04 UTC (permalink / raw)
  To: Charles Manning; +Cc: linux-mtd-bounces, Mitch Bradley, linux-mtd

> > In drivers/mtd/mtdpart.c, struct mtd_part has  "u_int32_t offset", 
thus
> > (apparently) limiting the partition start offset to 4 GiB.  Similarly,
> > struct mtd_partition in include/linux/mtd/partititions.h has 
"u_int32_t
> > size" and "u_int32_offset".
> 
> As Josh says it is not just an mtd_part issue, but the whole guts of mtd 

> suffer from this. The actual mtd_xxx interface to the kernel is close 
enough 
> for most purposes.
> 

<snip>

> It is more than just changing the 32 to 64 bit types.
> 

It is indeed more than just a type change, as I'm discovering :\.  I'm 
currently working on a change that will allow greater than 2GiB size, but 
since my project isn't going to have any partitions in it, I wasn't aware 
of any limitations there.  As I go through my work I'll try and keep it in 
mind, but I'm mired in the NAND layer and make no promises.  I'm trying to 
do this in small increments rather than a wholesale change that introduces 
numerous bugs :).

Bruce

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

end of thread, other threads:[~2008-06-18 17:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-17  0:04 mtd partitions limited to 4 GB? Mitch Bradley
2008-06-17  0:22 ` Josh Boyer
2008-06-17  0:41 ` Charles Manning
2008-06-18 17:04   ` Bruce_Leonard

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