* Re: DataFlash & writesize
2006-06-26 20:33 ` David Brownell
@ 2006-06-26 21:42 ` Josh Boyer
2006-06-26 22:27 ` David Brownell
2006-06-27 7:02 ` Artem B. Bityutskiy
2006-06-27 7:05 ` Artem B. Bityutskiy
2 siblings, 1 reply; 10+ messages in thread
From: Josh Boyer @ 2006-06-26 21:42 UTC (permalink / raw)
To: David Brownell; +Cc: Artem B. Bityutskiy, Linux MTD
On 6/26/06, David Brownell <david-b@pacbell.net> wrote:
> On Friday 23 June 2006 3:43 am, Artem B. Bityutskiy wrote:
> > On Fri, 2006-06-23 at 12:27 +0200, Andrew Victor wrote:
> > > Since the writesize change is now in mainline git, here is a trivial
> > > patch to set mtd->writesize for DataFlash.
> > > [writesize = erasesize = pagesize]
> > >
> >
> > Andrew,
> >
> > I made the same yesterday and it is in GIT, but thank you anyway!
>
> What are the intended semantics for "writesize" by the way?
>
> I noticed I was getting that first BUG_ON in mtdcore:add_mtd_device
> since, with NOR CFI cmdset 1 flash, with current GIT. Seems like
> writesie should have been set up already.
Which git tree and when? That was a bug that should have been fixed
last week in the mtd-2.6.git tree. And it should also go to Linus
ASAP.
josh
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: DataFlash & writesize
2006-06-26 21:42 ` Josh Boyer
@ 2006-06-26 22:27 ` David Brownell
2006-06-26 22:32 ` Thomas Gleixner
0 siblings, 1 reply; 10+ messages in thread
From: David Brownell @ 2006-06-26 22:27 UTC (permalink / raw)
To: Josh Boyer; +Cc: Artem B. Bityutskiy, Linux MTD
On Monday 26 June 2006 2:42 pm, Josh Boyer wrote:
> On 6/26/06, David Brownell <david-b@pacbell.net> wrote:
> > On Friday 23 June 2006 3:43 am, Artem B. Bityutskiy wrote:
> > > On Fri, 2006-06-23 at 12:27 +0200, Andrew Victor wrote:
> > > > Since the writesize change is now in mainline git, here is a trivial
> > > > patch to set mtd->writesize for DataFlash.
> > > > [writesize = erasesize = pagesize]
> > > >
> > >
> > > Andrew,
> > >
> > > I made the same yesterday and it is in GIT, but thank you anyway!
> >
> > What are the intended semantics for "writesize" by the way?
?
> > I noticed I was getting that first BUG_ON in mtdcore:add_mtd_device
> > since, with NOR CFI cmdset 1 flash, with current GIT. Seems like
> > writesie should have been set up already.
>
> Which git tree and when?
Kernel.org GIT tree, pulled yesterday.
> That was a bug that should have been fixed
> last week in the mtd-2.6.git tree. And it should also go to Linus
> ASAP.
>
> josh
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: DataFlash & writesize
2006-06-26 20:33 ` David Brownell
2006-06-26 21:42 ` Josh Boyer
@ 2006-06-27 7:02 ` Artem B. Bityutskiy
2006-06-27 7:05 ` Artem B. Bityutskiy
2 siblings, 0 replies; 10+ messages in thread
From: Artem B. Bityutskiy @ 2006-06-27 7:02 UTC (permalink / raw)
To: David Brownell; +Cc: Linux MTD
Hello David,
David Brownell wrote:
> What are the intended semantics for "writesize" by the way?
Design-wise, it an attempt to generalize MTD. Different flashes have
different minimal I/O unit size, like 1 byte in case of NOR, 16 bytes in
case of ECCed NOR, 512/2K in case of NAND, etc. There were no such a
field before and we had to do ugly things like
switch (mtd->type) {
case MTD_NORFLASH:
blah();
break;
case MTD_NANDFLASH:
blah1();
etc.
Here is a comment from include/linux/mtd.h:
/* Minimal writable flash unit size. In case of NOR flash it is 1 (even
* though individual bits can be cleared), in case of NAND flash it is
* one NAND page (or half, or one-fourths of it), in case of ECC-ed NOR
* it is of ECC block size, etc. It is illegal to have writesize = 0.
* Any driver registering a struct mtd_info must ensure a writesize of
* 1 or larger.
*/
>
> I noticed I was getting that first BUG_ON in mtdcore:add_mtd_device
> since, with NOR CFI cmdset 1 flash, with current GIT. Seems like
> writesie should have been set up already.
We fixed all drivers and now it should be fine - see commit
17ffc7ba6d7ea68b8d5f55a5ca1b87163e69720d
--
Best Regards,
Artem B. Bityutskiy,
St.-Petersburg, Russia.
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: DataFlash & writesize
2006-06-26 20:33 ` David Brownell
2006-06-26 21:42 ` Josh Boyer
2006-06-27 7:02 ` Artem B. Bityutskiy
@ 2006-06-27 7:05 ` Artem B. Bityutskiy
2006-06-27 8:10 ` David Brownell
2 siblings, 1 reply; 10+ messages in thread
From: Artem B. Bityutskiy @ 2006-06-27 7:05 UTC (permalink / raw)
To: David Brownell; +Cc: Linux MTD
David,
David Brownell wrote:
> What are the intended semantics for "writesize" by the way?
Design-wise, it an attempt to generalize MTD. Different flashes have
different minimal I/O unit size, like 1 byte in case of NOR, 16 bytes in
case of ECCed NOR, 512/2K in case of NAND, etc. There were no such a
field before and we had to do ugly things like
switch (mtd->type) {
case MTD_NORFLASH:
blah();
break;
case MTD_NANDFLASH:
blah1();
etc.
Here is a comment from include/linux/mtd.h:
/* Minimal writable flash unit size. In case of NOR flash it is 1 (even
* though individual bits can be cleared), in case of NAND flash it is
* one NAND page (or half, or one-fourths of it), in case of ECC-ed NOR
* it is of ECC block size, etc. It is illegal to have writesize = 0.
* Any driver registering a struct mtd_info must ensure a writesize of
* 1 or larger.
*/
> I noticed I was getting that first BUG_ON in mtdcore:add_mtd_device
> since, with NOR CFI cmdset 1 flash, with current GIT. Seems like
> writesie should have been set up already.
We fixed all drivers and now it should be fine - see commit
17ffc7ba6d7ea68b8d5f55a5ca1b87163e69720d
--
Best Regards,
Artem B. Bityutskiy,
St.-Petersburg, Russia.
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: DataFlash & writesize
2006-06-27 7:05 ` Artem B. Bityutskiy
@ 2006-06-27 8:10 ` David Brownell
0 siblings, 0 replies; 10+ messages in thread
From: David Brownell @ 2006-06-27 8:10 UTC (permalink / raw)
To: Artem B. Bityutskiy; +Cc: Linux MTD
On Tuesday 27 June 2006 12:05 am, Artem B. Bityutskiy wrote:
> David,
>
> David Brownell wrote:
> > What are the intended semantics for "writesize" by the way?
>
> Design-wise, it an attempt to generalize MTD. Different flashes have
> different minimal I/O unit size, like 1 byte in case of NOR, 16 bytes in
> case of ECCed NOR, 512/2K in case of NAND, etc.
OK, thanks. For some reason the "writesize" I found didn't include
the <linux/mtd/mtd.h> comment you mentioned... I guess that was the
one in mtd-abi.h instead.
> > I noticed I was getting that first BUG_ON in mtdcore:add_mtd_device
> > since, with NOR CFI cmdset 1 flash, with current GIT. Seems like
> > writesie should have been set up already.
>
> We fixed all drivers and now it should be fine - see commit
> 17ffc7ba6d7ea68b8d5f55a5ca1b87163e69720d
It's not fixed upstream yet.
- Dave
^ permalink raw reply [flat|nested] 10+ messages in thread