Skip to contentSkip to conversation

JFFS2 impact when don't have sub page access

DISCUSSION Aníbal Almeida Pinto 3 participants 7 messages Jul 31, 2013 – Aug 2, 2013 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi,

I' am using an OMAP L138 with a NAND SLC (MT29F4G08)

I was making some tests with Ubifs but found some errors due to OMAP don't support sub pages access:

[  128.344667] UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 2:512, read 512 bytes
[  128.883945] UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 1766:512, read 512 bytes
[  128.884072] UBI: run torture test for PEB 1766

The error will continue on loop.

The mtd_tests failed on mtd_supgatetest:

[ 63.870866] mtd_subpagetest: MTD device: 0
[ 63.870929] mtd_subpagetest: MTD device size 262144, eraseblock size 131072, page size 2048, subpage size 512, count of eraseblocks 2, pages per eraseblock 64, OOB size 64
[ 63.871052] mtd_subpagetest: scanning for bad eraseblocks
[ 63.871097] mtd_subpagetest: scanned 2 eraseblocks, 0 are bad
[ 63.871126] mtd_subpagetest: erasing whole device
[ 63.872731] mtd_subpagetest: erased 2 eraseblocks
[ 63.872756] mtd_subpagetest: writing whole device
[ 63.873873] mtd_subpagetest: written up to eraseblock 0
[ 63.874943] mtd_subpagetest: written 2 eraseblocks
[ 63.874969] mtd_subpagetest: verifying all eraseblocks
[ 63.875620] mtd_subpagetest: error: read failed at 0x0
[ 63.875667] mtd_subpagetest: error -74 occurred

and disabling the sub page access enable the use of UBIFS [1].

Is there any impact on jffs2 partitions if sub page write are enable on OMAP L138?

Thanks.

[1] - http://davinci-linux-open-source.1494791.n2.nabble.com/UBI-crashes-fixing-NAND-subpage-writes-td5485828.html (message from 2010/09/29)

Regards,
Aníbal

#1 lore raw

Hello,

Quoted 7 lines

Hi,

I' am using an OMAP L138 with a NAND SLC (MT29F4G08)

I was making some tests with Ubifs but found some errors due to OMAP don't support sub pages access:

TI OMAP2-NAND supports sub-pages for SLC NAND.
http://lists.infradead.org/pipermail/linux-mtd/attachments/20130405/a146567f/attachment.obj

This patch was accepted in mainline linux-3.10,
And tested on AM335x with 2K/64 NAND.

You can follow this patch details here..
http://lists.infradead.org/pipermail/linux-mtd/2013-March/046285.html

with regards, pekon

#2 lore raw
Quoted 9 lines · Pekon

Hello,

Quoted 7 lines

Hi,

I' am using an OMAP L138 with a NAND SLC (MT29F4G08)

I was making some tests with Ubifs but found some errors due to OMAP don't support sub pages access:

Quoted 8 lines

TI OMAP2-NAND supports sub-pages for SLC NAND.
http://lists.infradead.org/pipermail/linux-mtd/attachments/20130405/a146567f/attachment.obj

This patch was accepted in mainline linux-3.10,
And tested on AM335x with 2K/64 NAND.

You can follow this patch details here..
http://lists.infradead.org/pipermail/linux-mtd/2013-March/046285.html

Yes, but Aníbal is talking about OMAP-L138 which is actually a DaVinci part and uses drivers/mtd/nand/davinci_nand.c

May be you can clarify whether absence of subpage support will lead to the kind of errors Aníbal reported?

Also, the subject talks about JFFS2. There is no known affect of absence of subpage support on JFFS2, right?

Thanks,
Sekhar

#3 lore raw

Hi,

Quoted 15 lines · Pekon
Quoted 11 lines

Hello,

Quoted 7 lines

Hi,

I' am using an OMAP L138 with a NAND SLC (MT29F4G08)

I was making some tests with Ubifs but found some errors due to OMAP don't support sub pages access:

TI OMAP2-NAND supports sub-pages for SLC NAND.
http://lists.infradead.org/pipermail/linux-

mtd/attachments/20130405/a146567f/attachment.obj

Quoted 1 line
Quoted 9 lines
Quoted 5 lines

This patch was accepted in mainline linux-3.10,
And tested on AM335x with 2K/64 NAND.

You can follow this patch details here..
http://lists.infradead.org/pipermail/linux-mtd/2013-March/046285.html

Yes, but Aníbal is talking about OMAP-L138 which is actually a DaVinci part and uses drivers/mtd/nand/davinci_nand.c

The patch adds support for subpage-write in generic NAND driver, So it should work directly for davinci_nand.c

Quoted 3 lines

May be you can clarify whether absence of subpage support will lead to the kind of errors Aníbal reported?

I suspect there is some mis-match in options passed while creating UBI image for sub-pages. With subpages the LEB size (-e) passed to
mkfs.ubifs has different calculation. It should be '(n-1) * page size'
where 'n' is number of pages in the erase-block.
This is because when using sub-pages both EraseHeader and VolumeHeader are packed in same page.
I use some personal script to keep that handy, refer [1]
You can also refer to
http://processors.wiki.ti.com/index.php/UBIFS_Support

Quoted 3 lines

Also, the subject talks about JFFS2. There is no known affect of absence of subpage support on JFFS2, right?

There should not be any problem in using either UBIFS or JFFS2.

[1] create_ubi_image.sh
(this script used fixed folder name 'rootfs' as -r option)

#!/bin/sh
#----------------------------------------------------------------------
# Description: generic script to create UBI image for NAND devices
# with different page sizes.
#
# Author: Pekon Gupta ([email protected])
# Usage: create_ubi_image.sh <PAGE_SIZE> <SUBPAGE_SIZE> \
# <PARTITION_SIZE>
# History:

# version 1.1	pekon
#		added calculation of LEB_SIZE while using subpages
#
#---------------------------------------------------------------------- 
#-- remove old files --
rm -v ubi.ubifs  ubi.img ubinize.cfg

#-- user inputs --
PAGE_SIZE=$1
SUBPAGE_SIZE=$2
PARTITION_SIZE=$3

if test -z $1 || test -z $2 || test -z $3
then
echo "Error: incomplete inputs"
echo "Usage: create_ubi_image.sh <PAGE_SIZE> <SUBPAGE_SIZE> <PARTITION_SIZE>" exit
fi

#-- calculate UBI parameter --
PEB_SIZE=$(( 64 * $PAGE_SIZE ))

# LEB size = PEB_SIZE - number_of_pages_used_for_UBI_headers * PAGE_SIZE
# number_of_pages_used_for_UBI_header = 1 if using sub-pages
# number_of_pages_used_for_UBI_header = 2 if not using sub-pages
if test $PAGE_SIZE -ne $SUBPAGE_SIZE
then

	LEB_SIZE=$(( $PEB_SIZE - ( 1 * $PAGE_SIZE )))
else
	LEB_SIZE=$(( $PEB_SIZE - ( 2 * $PAGE_SIZE )))

fi

LEB_COUNT=$(( $PARTITION_SIZE / $LEB_SIZE ))

echo "LOG: PAGE_SIZE = $PAGE_SIZE"
echo "LOG: SUBPAGE_SIZE = $SUBPAGE_SIZE"
echo "LOG: PEB_SIZE = $PEB_SIZE"
echo "LOG: LEB_SIZE = $LEB_SIZE"
echo "LOG: LEB_COUNT = $LEB_COUNT"

#-- generate ubinize.cfg --

echo "[ubifs]"                	>> ubinize.cfg 
echo "mode=ubi"               	>> ubinize.cfg 
echo "image=ubi.ubifs"        	>> ubinize.cfg 
echo "vol_id=0"               	>> ubinize.cfg 

echo "vol_size=$PARTITION_SIZE" >> ubinize.cfg
echo "vol_type=dynamic" >> ubinize.cfg
echo "vol_name=test" >> ubinize.cfg
echo "vol_flags='autoresize'" >> ubinize.cfg
echo "vol_alignment=1" >> ubinize.cfg

#-- generate UBI image --

mkfs.ubifs  -o ubi.ubifs  -m $PAGE_SIZE  -e $LEB_SIZE  -c $LEB_COUNT  -r rootfs
ubinize     -o ubi.img    -m $PAGE_SIZE  -p $PEB_SIZE  -s $SUBPAGE_SIZE  -O $SUBPAGE_SIZE  -v  ubinize.cfg

# ---------------------------------------------

#4 lore raw

Em 02-08-2013 07:25, Gupta, Pekon escreveu:

Quoted 42 lines

Hi,

Quoted 15 lines · Pekon
Quoted 11 lines

Hello,

Quoted 7 lines

Hi,

I' am using an OMAP L138 with a NAND SLC (MT29F4G08)

I was making some tests with Ubifs but found some errors due to OMAP don't support sub pages access:

TI OMAP2-NAND supports sub-pages for SLC NAND.
http://lists.infradead.org/pipermail/linux-

mtd/attachments/20130405/a146567f/attachment.obj

Quoted 1 line
Quoted 9 lines
Quoted 5 lines

This patch was accepted in mainline linux-3.10,
And tested on AM335x with 2K/64 NAND.

You can follow this patch details here..
http://lists.infradead.org/pipermail/linux-mtd/2013-March/046285.html

Yes, but Aníbal is talking about OMAP-L138 which is actually a DaVinci part and uses drivers/mtd/nand/davinci_nand.c

The patch adds support for subpage-write in generic NAND driver, So it should work directly for davinci_nand.c

Quoted 3 lines

May be you can clarify whether absence of subpage support will lead to the kind of errors Aníbal reported?

I suspect there is some mis-match in options passed while creating UBI image for sub-pages. With subpages the LEB size (-e) passed to
mkfs.ubifs has different calculation. It should be '(n-1) * page size'
where 'n' is number of pages in the erase-block.
This is because when using sub-pages both EraseHeader and VolumeHeader are packed in same page.
I use some personal script to keep that handy, refer [1]
You can also refer to
http://processors.wiki.ti.com/index.php/UBIFS_Support

Quoted 4 lines
Quoted 3 lines

Also, the subject talks about JFFS2. There is no known affect of absence of subpage support on JFFS2, right?

There should not be any problem in using either UBIFS or JFFS2.

Please, clarify me with the last statement.

There should be no problem using JFFS2 or UBIFS with the patch that you mention applied or even without the patch ?

With OMAP L138 are some complains about using the ubifs and subpage access, even on uboot [1] so it don't appear to be only a linux [2] problem.

And if the problems appear on ubifs it should affect the jffs2.

[1] - http://lists.denx.de/pipermail/u-boot/2011-April/090072.html
[2] - http://comments.gmane.org/gmane.linux.davinci/23836

Sem o patch há problemas manifestados por várias pessoas ...

Quoted 72 lines

[1] create_ubi_image.sh
(this script used fixed folder name 'rootfs' as -r option)

#!/bin/sh
#----------------------------------------------------------------------
# Description: generic script to create UBI image for NAND devices
# with different page sizes.
#
# Author: Pekon Gupta ([email protected])
# Usage: create_ubi_image.sh <PAGE_SIZE> <SUBPAGE_SIZE> \
# <PARTITION_SIZE>
# History:

# version 1.1	pekon
#		added calculation of LEB_SIZE while using subpages
#
#----------------------------------------------------------------------
#-- remove old files --
rm -v ubi.ubifs  ubi.img ubinize.cfg

#-- user inputs --
PAGE_SIZE=$1
SUBPAGE_SIZE=$2
PARTITION_SIZE=$3

if test -z $1 || test -z $2 || test -z $3
then
echo "Error: incomplete inputs"
echo "Usage: create_ubi_image.sh <PAGE_SIZE> <SUBPAGE_SIZE> <PARTITION_SIZE>" exit
fi

#-- calculate UBI parameter --
PEB_SIZE=$(( 64 * $PAGE_SIZE ))

# LEB size = PEB_SIZE - number_of_pages_used_for_UBI_headers * PAGE_SIZE
# number_of_pages_used_for_UBI_header = 1 if using sub-pages
# number_of_pages_used_for_UBI_header = 2 if not using sub-pages
if test $PAGE_SIZE -ne $SUBPAGE_SIZE
then

	LEB_SIZE=$(( $PEB_SIZE - ( 1 * $PAGE_SIZE )))
else
	LEB_SIZE=$(( $PEB_SIZE - ( 2 * $PAGE_SIZE )))

fi

LEB_COUNT=$(( $PARTITION_SIZE / $LEB_SIZE ))

echo "LOG: PAGE_SIZE = $PAGE_SIZE"
echo "LOG: SUBPAGE_SIZE = $SUBPAGE_SIZE"
echo "LOG: PEB_SIZE = $PEB_SIZE"
echo "LOG: LEB_SIZE = $LEB_SIZE"
echo "LOG: LEB_COUNT = $LEB_COUNT"

#-- generate ubinize.cfg --

echo "[ubifs]"                	>> ubinize.cfg
echo "mode=ubi"               	>> ubinize.cfg
echo "image=ubi.ubifs"        	>> ubinize.cfg
echo "vol_id=0"               	>> ubinize.cfg

echo "vol_size=$PARTITION_SIZE" >> ubinize.cfg
echo "vol_type=dynamic" >> ubinize.cfg
echo "vol_name=test" >> ubinize.cfg
echo "vol_flags='autoresize'" >> ubinize.cfg
echo "vol_alignment=1" >> ubinize.cfg

#-- generate UBI image --

mkfs.ubifs  -o ubi.ubifs  -m $PAGE_SIZE  -e $LEB_SIZE  -c $LEB_COUNT  -r rootfs
ubinize     -o ubi.img    -m $PAGE_SIZE  -p $PEB_SIZE  -s $SUBPAGE_SIZE  -O $SUBPAGE_SIZE  -v  ubinize.cfg

# ---------------------------------------------

#5 lore raw

Hi,

Quoted 11 lines
Quoted 5 lines
Quoted 4 lines

Also, the subject talks about JFFS2. There is no known affect of absence of subpage support on JFFS2, right?

There should not be any problem in using either UBIFS or JFFS2.

Please, clarify me with the last statement.

There should be no problem using JFFS2 or UBIFS with the patch that you mention applied or even without the patch ?

For UBIFS to work,
(1) please check following options passed for mkfs.ubifs
- with this patch
mkfs.ubifs -s 512 -m 2048

- without this patch
mkfs.ubifs -s 2048 -m 2048

(2) Also please check for 'chip->options & NAND_NO_SUBPAGE_WRITE'. This flag is used for explicitely _disabling_ sub-pages in NAND driver.

Quoted 6 lines

With OMAP L138 are some complains about using the ubifs and subpage access, even on uboot [1] so it don't appear to be only a linux [2] problem.

And if the problems appear on ubifs it should affect the jffs2.

[1] - http://lists.denx.de/pipermail/u-boot/2011-April/090072.html

Yes, there is no subpage support in U-Boot.
Also I hope you are using 'ubiformat' to format the NAND partition with UBI.img in kernel ? If that isn't the case, then I'm not sure what can be the problem here.
I have tested omap2-nand with subpage enabled and
using ubiformat. And it works fine.

Quoted 2 lines

[2] - http://comments.gmane.org/gmane.linux.davinci/23836

Also from [2] last post, there seemed to be an issue with mis-match in ECC scheme used between U-Boot and ECC-scheme used in Kernel. (But this has nothing todo with sub-pages)..
Your logs also show ECC errors, so I suggest please make sure you are using same ECC scheme in kernel, as the one with which you flashed the image.
----------------------------------------

Quoted 5 lines
Quoted 5 lines
[  128.344667] UBI error: ubi_io_read: error -74 (ECC error) while 
reading 512 bytes from PEB 2:512, read 512 bytes
[  128.883945] UBI error: ubi_io_read: error -74 (ECC error) while 
reading 512 bytes from PEB 1766:512, read 512 bytes
[  128.884072] UBI: run torture test for PEB 1766

----------------------------------------

with regards, pekon

#6 lore raw

Em 02-08-2013 12:52, Gupta, Pekon escreveu:

Quoted 49 lines

Hi,

Quoted 11 lines
Quoted 5 lines
Quoted 4 lines

Also, the subject talks about JFFS2. There is no known affect of absence of subpage support on JFFS2, right?

There should not be any problem in using either UBIFS or JFFS2.

Please, clarify me with the last statement.

There should be no problem using JFFS2 or UBIFS with the patch that you mention applied or even without the patch ?

For UBIFS to work,
(1) please check following options passed for mkfs.ubifs
- with this patch
mkfs.ubifs -s 512 -m 2048

- without this patch
mkfs.ubifs -s 2048 -m 2048

(2) Also please check for 'chip->options & NAND_NO_SUBPAGE_WRITE'. This flag is used for explicitely _disabling_ sub-pages in NAND driver.

Quoted 6 lines

With OMAP L138 are some complains about using the ubifs and subpage access, even on uboot [1] so it don't appear to be only a linux [2] problem.

And if the problems appear on ubifs it should affect the jffs2.

[1] - http://lists.denx.de/pipermail/u-boot/2011-April/090072.html

Yes, there is no subpage support in U-Boot.
Also I hope you are using 'ubiformat' to format the NAND partition with UBI.img in kernel ? If that isn't the case, then I'm not sure what can be the problem here.
I have tested omap2-nand with subpage enabled and
using ubiformat. And it works fine.

Quoted 2 lines

[2] - http://comments.gmane.org/gmane.linux.davinci/23836

Also from [2] last post, there seemed to be an issue with mis-match in ECC scheme used between U-Boot and ECC-scheme used in Kernel. (But this has nothing todo with sub-pages)..
Your logs also show ECC errors, so I suggest please make sure you are using same ECC scheme in kernel, as the one with which you flashed the image.
----------------------------------------

Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
[  128.344667] UBI error: ubi_io_read: error -74 (ECC error) while
reading 512 bytes from PEB 2:512, read 512 bytes
[  128.883945] UBI error: ubi_io_read: error -74 (ECC error) while
reading 512 bytes from PEB 1766:512, read 512 bytes
[  128.884072] UBI: run torture test for PEB 1766

----------------------------------------

Pekon,

I have verified that disabling the NAND_NO_SUBPAGE_WRITE the images that I have generated work.

Monday I will try test your patch and see the result with subpage.

If is clear on ubifs, we can't have it without disabling the sub page or apply the patch, I don't understand how this influence jffs2 partitions.

On OMAP-L138 with subpage enabled, but not supported by the processor/nand, JFFS2 partitions can be corrupted because of subpage writes ?

Thanks.

Regards,
Aníbal