* UBI/UBIFS on NAND with PEB 4MB
@ 2016-12-13 19:40 Matthias Auchmann
2016-12-13 19:52 ` Matthias Auchmann
2016-12-14 7:43 ` Boris Brezillon
0 siblings, 2 replies; 6+ messages in thread
From: Matthias Auchmann @ 2016-12-13 19:40 UTC (permalink / raw)
To: linux-mtd
Hi guys!
I'm trying to use UBI and UBIFS on a Micron MT29F32G08ABCDBJ4 SLC NAND with an erase block size 4MB.
First of all, mkfs.ubifs wouldn't support a LEB larger than UBIFS_MAX_LEB_SZ being (2*1024*1024).
When I use ubiattach though, it seems to be quite happy, giving me that on a 128MB partition:
UBI device number 0, total 32 LEBs (133169152 bytes, 127.0 MiB), available 8 LEBs (33292288 bytes, 31.8 MiB), LEB size 4161536 bytes (4.0 MiB)
Anyway, when I detach and reattach, it won't work. Details are in the bottom of that mail, but since I haven't thoroughly looked into it myself yet, this is only for those who care... I don't want to ask preliminary questions.
Anyway, my questions I guess then are:
-) Are there any patches/branches that enable UBIFS to be run with a LEB of 4161536?
-) Are there any known limitations with using a 4MiB PEB with UBI itself, or shall I assume for now that the problem is on my board/NAND driver regarding the above ubiattach errors upon the second attach?
Thanks!
BR,
Matthias
*** Please only read this if you care: ***
Details about attach/detach/attach problem.
Upon first attaching, dmesg says:
[ 117.483503] ubi0: attaching mtd5
[ 117.502347] ubi0: scanning is finished
[ 117.502353] ubi0: empty MTD device detected
[ 117.513280] ubi0: attached mtd5 (name "rootfs01", size 128 MiB)
[ 117.513288] ubi0: PEB size: 4194304 bytes (4096 KiB), LEB size: 4161536 bytes
[ 117.513293] ubi0: min./max. I/O unit sizes: 16384/16384, sub-page size 16384
[ 117.513299] ubi0: VID header offset: 16384 (aligned 16384), data offset: 32768
[ 117.513304] ubi0: good PEBs: 32, bad PEBs: 0, corrupted PEBs: 0
[ 117.513309] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
[ 117.513314] ubi0: max/mean erase counter: 0/0, WL threshold: 4096, image sequence number: 34480849
[ 117.513320] ubi0: available PEBs: 8, total reserved PEBs: 24, PEBs reserved for bad PEB handling: 20
[ 117.513333] ubi0: background thread "ubi_bgt0d" started, PID 1637
Anyway, when I detach and reattach, I get this:
ubiattach: error!: cannot attach "/dev/mtd5"
error 22 (Invalid argument)
dmesg says:
[ 359.282384] ubi0: attaching mtd5
[ 359.319433] ubi0: scanning is finished
[ 359.321747] ubi0 error: vtbl_check: bad CRC at record 0: 0x2b4f6dd5, not 0x000000
[ 359.321753] Volume table record 0 dump:
[ 359.321757] reserved_pebs -16777216
[ 359.321760] alignment 0
[ 359.321763] data_pad 0
[ 359.321766] vol_type 0
[ 359.321770] upd_marker 0
[ 359.321773] name_len 0
[ 359.321776] name NULL
[ 359.321784] ubi0 error: vtbl_check: bad CRC at record 0: 0x2b4f6dd5, not 0x000000
[ 359.321788] Volume table record 0 dump:
[ 359.321791] reserved_pebs -16777216
[ 359.321794] alignment 0
[ 359.321797] data_pad 0
[ 359.321800] vol_type 0
[ 359.321803] upd_marker 0
[ 359.321807] name_len 0
[ 359.321809] name NULL
[ 359.321816] ubi0 error: ubi_read_volume_table: both volume tables are corrupted
[ 359.321836] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd5, error -22
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: UBI/UBIFS on NAND with PEB 4MB
2016-12-13 19:40 UBI/UBIFS on NAND with PEB 4MB Matthias Auchmann
@ 2016-12-13 19:52 ` Matthias Auchmann
2016-12-14 7:43 ` Boris Brezillon
1 sibling, 0 replies; 6+ messages in thread
From: Matthias Auchmann @ 2016-12-13 19:52 UTC (permalink / raw)
To: linux-mtd
Oh please forgive me, I forgot to mention: I'm on Kernel 4.6.
-----Original Message-----
From: linux-mtd [mailto:linux-mtd-bounces@lists.infradead.org] On Behalf Of Matthias Auchmann
Sent: Tuesday, December 13, 2016 8:41 PM
To: linux-mtd@lists.infradead.org
Subject: UBI/UBIFS on NAND with PEB 4MB
Hi guys!
I'm trying to use UBI and UBIFS on a Micron MT29F32G08ABCDBJ4 SLC NAND with an erase block size 4MB.
First of all, mkfs.ubifs wouldn't support a LEB larger than UBIFS_MAX_LEB_SZ being (2*1024*1024).
When I use ubiattach though, it seems to be quite happy, giving me that on a 128MB partition:
UBI device number 0, total 32 LEBs (133169152 bytes, 127.0 MiB), available 8 LEBs (33292288 bytes, 31.8 MiB), LEB size 4161536 bytes (4.0 MiB)
Anyway, when I detach and reattach, it won't work. Details are in the bottom of that mail, but since I haven't thoroughly looked into it myself yet, this is only for those who care... I don't want to ask preliminary questions.
Anyway, my questions I guess then are:
-) Are there any patches/branches that enable UBIFS to be run with a LEB of 4161536?
-) Are there any known limitations with using a 4MiB PEB with UBI itself, or shall I assume for now that the problem is on my board/NAND driver regarding the above ubiattach errors upon the second attach?
Thanks!
BR,
Matthias
*** Please only read this if you care: *** Details about attach/detach/attach problem.
Upon first attaching, dmesg says:
[ 117.483503] ubi0: attaching mtd5
[ 117.502347] ubi0: scanning is finished [ 117.502353] ubi0: empty MTD device detected [ 117.513280] ubi0: attached mtd5 (name "rootfs01", size 128 MiB) [ 117.513288] ubi0: PEB size: 4194304 bytes (4096 KiB), LEB size: 4161536 bytes [ 117.513293] ubi0: min./max. I/O unit sizes: 16384/16384, sub-page size 16384 [ 117.513299] ubi0: VID header offset: 16384 (aligned 16384), data offset: 32768 [ 117.513304] ubi0: good PEBs: 32, bad PEBs: 0, corrupted PEBs: 0 [ 117.513309] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128 [ 117.513314] ubi0: max/mean erase counter: 0/0, WL threshold: 4096, image sequence number: 34480849 [ 117.513320] ubi0: available PEBs: 8, total reserved PEBs: 24, PEBs reserved for bad PEB handling: 20 [ 117.513333] ubi0: background thread "ubi_bgt0d" started, PID 1637
Anyway, when I detach and reattach, I get this:
ubiattach: error!: cannot attach "/dev/mtd5"
error 22 (Invalid argument)
dmesg says:
[ 359.282384] ubi0: attaching mtd5
[ 359.319433] ubi0: scanning is finished [ 359.321747] ubi0 error: vtbl_check: bad CRC at record 0: 0x2b4f6dd5, not 0x000000 [ 359.321753] Volume table record 0 dump:
[ 359.321757] reserved_pebs -16777216
[ 359.321760] alignment 0
[ 359.321763] data_pad 0
[ 359.321766] vol_type 0
[ 359.321770] upd_marker 0
[ 359.321773] name_len 0
[ 359.321776] name NULL
[ 359.321784] ubi0 error: vtbl_check: bad CRC at record 0: 0x2b4f6dd5, not 0x000000 [ 359.321788] Volume table record 0 dump:
[ 359.321791] reserved_pebs -16777216
[ 359.321794] alignment 0
[ 359.321797] data_pad 0
[ 359.321800] vol_type 0
[ 359.321803] upd_marker 0
[ 359.321807] name_len 0
[ 359.321809] name NULL
[ 359.321816] ubi0 error: ubi_read_volume_table: both volume tables are corrupted [ 359.321836] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd5, error -22
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UBI/UBIFS on NAND with PEB 4MB
2016-12-13 19:40 UBI/UBIFS on NAND with PEB 4MB Matthias Auchmann
2016-12-13 19:52 ` Matthias Auchmann
@ 2016-12-14 7:43 ` Boris Brezillon
2016-12-14 8:59 ` Matthias Auchmann
1 sibling, 1 reply; 6+ messages in thread
From: Boris Brezillon @ 2016-12-14 7:43 UTC (permalink / raw)
To: Matthias Auchmann; +Cc: linux-mtd
Hi Matthias,
On Tue, 13 Dec 2016 20:40:59 +0100
Matthias Auchmann <m.auchmann@artech.at> wrote:
> Hi guys!
>
> I'm trying to use UBI and UBIFS on a Micron MT29F32G08ABCDBJ4 SLC NAND with an erase block size 4MB.
Woh! an SLC NAND with 4MB eraseblocks, that's surprizing.
>
> First of all, mkfs.ubifs wouldn't support a LEB larger than UBIFS_MAX_LEB_SZ being (2*1024*1024).
This is the easy part ;). We already have patches to increase the limit
in different ubi utils (IIRC, it's also needed in ubinize).
>
> When I use ubiattach though, it seems to be quite happy, giving me that on a 128MB partition:
>
> UBI device number 0, total 32 LEBs (133169152 bytes, 127.0 MiB), available 8 LEBs (33292288 bytes, 31.8 MiB), LEB size 4161536 bytes (4.0 MiB)
>
> Anyway, when I detach and reattach, it won't work. Details are in the bottom of that mail, but since I haven't thoroughly looked into it myself yet, this is only for those who care... I don't want to ask preliminary questions.
>
> Anyway, my questions I guess then are:
> -) Are there any patches/branches that enable UBIFS to be run with a LEB of 4161536?
> -) Are there any known limitations with using a 4MiB PEB with UBI itself, or shall I assume for now that the problem is on my board/NAND driver regarding the above ubiattach errors upon the second attach?
I don't think so. We did several tests on different MLC NANDs exposing
4MB blocks, and the UBI/UBIFS layers were not complaining about that
(we had other problems related to the MLC constraints).
What's your controller?
Regards,
Boris
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: UBI/UBIFS on NAND with PEB 4MB
2016-12-14 7:43 ` Boris Brezillon
@ 2016-12-14 8:59 ` Matthias Auchmann
2017-04-11 9:26 ` Matthias Auchmann
0 siblings, 1 reply; 6+ messages in thread
From: Matthias Auchmann @ 2016-12-14 8:59 UTC (permalink / raw)
To: Boris Brezillon; +Cc: linux-mtd
Hi Boris!
Thanks for your reply. Just now I found out that when I disable the DMA of my NAND driver, ubiattach/detach works. So it must be a problem with the DMA and/or cache coherency on this brand-new cache coherent interconnect or whatever. I will investigate it later! Sorry for having bothered you guys with that, but as I said yesterday night it was kind of preliminary ;-)
On the patches for the UBIFS_MAX_LEB_SZ, can you tell me where I can find those patches? That would be great ;-)
BR,
Matthias
-----Original Message-----
From: Boris Brezillon [mailto:boris.brezillon@free-electrons.com]
Sent: Wednesday, December 14, 2016 8:43 AM
To: Matthias Auchmann
Cc: linux-mtd@lists.infradead.org
Subject: Re: UBI/UBIFS on NAND with PEB 4MB
Hi Matthias,
On Tue, 13 Dec 2016 20:40:59 +0100
Matthias Auchmann <m.auchmann@artech.at> wrote:
> Hi guys!
>
> I'm trying to use UBI and UBIFS on a Micron MT29F32G08ABCDBJ4 SLC NAND with an erase block size 4MB.
Woh! an SLC NAND with 4MB eraseblocks, that's surprizing.
>
> First of all, mkfs.ubifs wouldn't support a LEB larger than UBIFS_MAX_LEB_SZ being (2*1024*1024).
This is the easy part ;). We already have patches to increase the limit in different ubi utils (IIRC, it's also needed in ubinize).
>
> When I use ubiattach though, it seems to be quite happy, giving me that on a 128MB partition:
>
> UBI device number 0, total 32 LEBs (133169152 bytes, 127.0 MiB),
> available 8 LEBs (33292288 bytes, 31.8 MiB), LEB size 4161536 bytes
> (4.0 MiB)
>
> Anyway, when I detach and reattach, it won't work. Details are in the bottom of that mail, but since I haven't thoroughly looked into it myself yet, this is only for those who care... I don't want to ask preliminary questions.
>
> Anyway, my questions I guess then are:
> -) Are there any patches/branches that enable UBIFS to be run with a LEB of 4161536?
> -) Are there any known limitations with using a 4MiB PEB with UBI itself, or shall I assume for now that the problem is on my board/NAND driver regarding the above ubiattach errors upon the second attach?
I don't think so. We did several tests on different MLC NANDs exposing 4MB blocks, and the UBI/UBIFS layers were not complaining about that (we had other problems related to the MLC constraints).
What's your controller?
Regards,
Boris
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: UBI/UBIFS on NAND with PEB 4MB
2016-12-14 8:59 ` Matthias Auchmann
@ 2017-04-11 9:26 ` Matthias Auchmann
2017-04-11 11:25 ` AW: " Markus Macsek
0 siblings, 1 reply; 6+ messages in thread
From: Matthias Auchmann @ 2017-04-11 9:26 UTC (permalink / raw)
To: linux-mtd; +Cc: Markus Macsek
Hi guys!
Sorry that not much happened for such a long time. My colleague Markus has now picked up the investigation!
BR,
Matthias
-----Original Message-----
From: linux-mtd [mailto:linux-mtd-bounces@lists.infradead.org] On Behalf Of Matthias Auchmann
Sent: Wednesday, December 14, 2016 9:59 AM
To: Boris Brezillon
Cc: linux-mtd@lists.infradead.org
Subject: RE: UBI/UBIFS on NAND with PEB 4MB
Hi Boris!
Thanks for your reply. Just now I found out that when I disable the DMA of my NAND driver, ubiattach/detach works. So it must be a problem with the DMA and/or cache coherency on this brand-new cache coherent interconnect or whatever. I will investigate it later! Sorry for having bothered you guys with that, but as I said yesterday night it was kind of preliminary ;-)
On the patches for the UBIFS_MAX_LEB_SZ, can you tell me where I can find those patches? That would be great ;-)
BR,
Matthias
-----Original Message-----
From: Boris Brezillon [mailto:boris.brezillon@free-electrons.com]
Sent: Wednesday, December 14, 2016 8:43 AM
To: Matthias Auchmann
Cc: linux-mtd@lists.infradead.org
Subject: Re: UBI/UBIFS on NAND with PEB 4MB
Hi Matthias,
On Tue, 13 Dec 2016 20:40:59 +0100
Matthias Auchmann <m.auchmann@artech.at> wrote:
> Hi guys!
>
> I'm trying to use UBI and UBIFS on a Micron MT29F32G08ABCDBJ4 SLC NAND with an erase block size 4MB.
Woh! an SLC NAND with 4MB eraseblocks, that's surprizing.
>
> First of all, mkfs.ubifs wouldn't support a LEB larger than UBIFS_MAX_LEB_SZ being (2*1024*1024).
This is the easy part ;). We already have patches to increase the limit in different ubi utils (IIRC, it's also needed in ubinize).
>
> When I use ubiattach though, it seems to be quite happy, giving me that on a 128MB partition:
>
> UBI device number 0, total 32 LEBs (133169152 bytes, 127.0 MiB),
> available 8 LEBs (33292288 bytes, 31.8 MiB), LEB size 4161536 bytes
> (4.0 MiB)
>
> Anyway, when I detach and reattach, it won't work. Details are in the bottom of that mail, but since I haven't thoroughly looked into it myself yet, this is only for those who care... I don't want to ask preliminary questions.
>
> Anyway, my questions I guess then are:
> -) Are there any patches/branches that enable UBIFS to be run with a LEB of 4161536?
> -) Are there any known limitations with using a 4MiB PEB with UBI itself, or shall I assume for now that the problem is on my board/NAND driver regarding the above ubiattach errors upon the second attach?
I don't think so. We did several tests on different MLC NANDs exposing 4MB blocks, and the UBI/UBIFS layers were not complaining about that (we had other problems related to the MLC constraints).
What's your controller?
Regards,
Boris
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 6+ messages in thread
* AW: UBI/UBIFS on NAND with PEB 4MB
2017-04-11 9:26 ` Matthias Auchmann
@ 2017-04-11 11:25 ` Markus Macsek
0 siblings, 0 replies; 6+ messages in thread
From: Markus Macsek @ 2017-04-11 11:25 UTC (permalink / raw)
To: Matthias Auchmann; +Cc: linux-mtd
[-- Attachment #1: Type: text/plain, Size: 4137 bytes --]
Hi,
we updated now to Linux kernel 4.9 and use mtd-utils 2.0. Unfortunately the
UBIFS problems remain the same.
Thus, I did comprehensive tests concerning our NAND and UBIFS (cp. attached
log files).
After all, I conclude that there is most probable an issue with the arasan nand
driver ([linux-xlnx.git]/drivers/mtd/nand/arasan_nand.c) regarding ECC. When
mounting the filesystem a corruption in the empty space at LEB 1:16384 is found
(cp. mount.log). I guess the problem is due to ECC changing a couple of "ff"
into "ef" (cp. nanddump2.log vs. nanddump3.log):
http://linux-mtd.infradead.narkive.com/Uvx5vHZc/ubifs-and-hardware-ecc-of-all-ff-pages-of-mlc-nand
Do you agree or are there other reasons for this behavior?
Note: In order to make mkfs.ubifs support the NANDs erase block size of 4M we
simply increased UBIFS_MAX_PEB_SZ and UBIFS_MAX_LEB_SZ from (2*1024*1024) to
(4*1024*1024), respectively (cp. increase-LEB-PEB-max-size-to-4M).
Best regards,
Markus
-----Ursprüngliche Nachricht-----
Von: Matthias Auchmann
Gesendet: Dienstag, 11. April 2017 11:27
An: linux-mtd@lists.infradead.org
Cc: Markus Macsek
Betreff: RE: UBI/UBIFS on NAND with PEB 4MB
Hi guys!
Sorry that not much happened for such a long time. My colleague Markus has now picked up the investigation!
BR,
Matthias
-----Original Message-----
From: linux-mtd [mailto:linux-mtd-bounces@lists.infradead.org] On Behalf Of Matthias Auchmann
Sent: Wednesday, December 14, 2016 9:59 AM
To: Boris Brezillon
Cc: linux-mtd@lists.infradead.org
Subject: RE: UBI/UBIFS on NAND with PEB 4MB
Hi Boris!
Thanks for your reply. Just now I found out that when I disable the DMA of my NAND driver, ubiattach/detach works. So it must be a problem with the DMA and/or cache coherency on this brand-new cache coherent interconnect or whatever. I will investigate it later! Sorry for having bothered you guys with that, but as I said yesterday night it was kind of preliminary ;-)
On the patches for the UBIFS_MAX_LEB_SZ, can you tell me where I can find those patches? That would be great ;-)
BR,
Matthias
-----Original Message-----
From: Boris Brezillon [mailto:boris.brezillon@free-electrons.com]
Sent: Wednesday, December 14, 2016 8:43 AM
To: Matthias Auchmann
Cc: linux-mtd@lists.infradead.org
Subject: Re: UBI/UBIFS on NAND with PEB 4MB
Hi Matthias,
On Tue, 13 Dec 2016 20:40:59 +0100
Matthias Auchmann <m.auchmann@artech.at> wrote:
> Hi guys!
>
> I'm trying to use UBI and UBIFS on a Micron MT29F32G08ABCDBJ4 SLC NAND with an erase block size 4MB.
Woh! an SLC NAND with 4MB eraseblocks, that's surprizing.
>
> First of all, mkfs.ubifs wouldn't support a LEB larger than UBIFS_MAX_LEB_SZ being (2*1024*1024).
This is the easy part ;). We already have patches to increase the limit in different ubi utils (IIRC, it's also needed in ubinize).
>
> When I use ubiattach though, it seems to be quite happy, giving me that on a 128MB partition:
>
> UBI device number 0, total 32 LEBs (133169152 bytes, 127.0 MiB),
> available 8 LEBs (33292288 bytes, 31.8 MiB), LEB size 4161536 bytes
> (4.0 MiB)
>
> Anyway, when I detach and reattach, it won't work. Details are in the bottom of that mail, but since I haven't thoroughly looked into it myself yet, this is only for those who care... I don't want to ask preliminary questions.
>
> Anyway, my questions I guess then are:
> -) Are there any patches/branches that enable UBIFS to be run with a LEB of 4161536?
> -) Are there any known limitations with using a 4MiB PEB with UBI itself, or shall I assume for now that the problem is on my board/NAND driver regarding the above ubiattach errors upon the second attach?
I don't think so. We did several tests on different MLC NANDs exposing 4MB blocks, and the UBI/UBIFS layers were not complaining about that (we had other problems related to the MLC constraints).
What's your controller?
Regards,
Boris
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
[-- Attachment #2: nandubi.tar.gz --]
[-- Type: application/x-gzip, Size: 26110 bytes --]
[-- Attachment #3: increase-LEB-PEB-max-size-to-4M.PATCH --]
[-- Type: application/octet-stream, Size: 826 bytes --]
diff --git a/include/libubi.h b/include/libubi.h
index 4d6a7ee..201f4c2 100644
--- a/include/libubi.h
+++ b/include/libubi.h
@@ -36,7 +36,7 @@ extern "C" {
#define LIBUBI_UBI_VERSION 1
/* Maximum physical eraseblock size in bytes */
-#define UBI_MAX_PEB_SZ (2*1024*1024)
+#define UBI_MAX_PEB_SZ (4*1024*1024)
/* UBI library descriptor */
typedef void * libubi_t;
diff --git a/ubifs-utils/mkfs.ubifs/ubifs.h b/ubifs-utils/mkfs.ubifs/ubifs.h
index 2f080a8..33e0818 100644
--- a/ubifs-utils/mkfs.ubifs/ubifs.h
+++ b/ubifs-utils/mkfs.ubifs/ubifs.h
@@ -26,7 +26,7 @@
#define __UBIFS_H__
/* Maximum logical eraseblock size in bytes */
-#define UBIFS_MAX_LEB_SZ (2*1024*1024)
+#define UBIFS_MAX_LEB_SZ (4*1024*1024)
/* Minimum amount of data UBIFS writes to the flash */
#define MIN_WRITE_SZ (UBIFS_DATA_NODE_SZ + 8)
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-04-11 11:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-13 19:40 UBI/UBIFS on NAND with PEB 4MB Matthias Auchmann
2016-12-13 19:52 ` Matthias Auchmann
2016-12-14 7:43 ` Boris Brezillon
2016-12-14 8:59 ` Matthias Auchmann
2017-04-11 9:26 ` Matthias Auchmann
2017-04-11 11:25 ` AW: " Markus Macsek
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.