ubi: refuse attaching mtd3 - MLC NAND is not supported

50 views
Skip to first unread message

Mathieu Malaterre

unread,
May 24, 2018, 3:28:33 PM5/24/18
to Richard Weinberger, MIPS Creator CI20 Development, linu...@lists.infradead.org
Hi Richard,

I cannot boot my MIPS Creator CI20 system anymore. Doing a git bisect leads to:

$ git bisect bad
b5094b7f135be34630e3ea8a98fa215715d0f29d is the first bad commit
commit b5094b7f135be34630e3ea8a98fa215715d0f29d
Author: Richard Weinberger <ric...@nod.at>
Date: Sat Mar 3 11:45:54 2018 +0100

ubi: Reject MLC NAND

While UBI and UBIFS seem to work at first sight with MLC NAND, you will
most likely lose all your data upon a power-cut or due to read/write
disturb.
In order to protect users from bad surprises, refuse to attach to MLC
NAND.

Cc: sta...@vger.kernel.org
Signed-off-by: Richard Weinberger <ric...@nod.at>
Acked-by: Boris Brezillon <boris.b...@bootlin.com>
Acked-by: Artem Bityutskiy <dede...@gmail.com>

:040000 040000 715242e81a7386bbc9ec5b10d0eb5138cd41ff3f
a2c894baaef840fc9dce4e87f3370a66731fc770 M drivers


On my system here is what I can see (screen + ttyUSB):

## Booting kernel from Legacy Image at 88000000 ...
Image Name: Linux-4.16.0+
Image Type: MIPS Linux Kernel Image (uncompressed)
Data Size: 5890340 Bytes = 5.6 MiB
Load Address: 80010000
Entry Point: 80401550
Verifying Checksum ... OK
Loading Kernel Image ... OK

Starting kernel [ 0.155993] cacheinfo: Failed to find cpu0 device node
[ 0.238335] ubi: refuse attaching mtd3 - MLC NAND is not supported
[ 0.244827] UBI error: cannot attach mtd3
[ 0.248838] ubi: refuse attaching mtd4 - MLC NAND is not supported
[ 0.255061] UBI error: cannot attach mtd4
[ 0.259413] Kernel panic - not syncing: VFS: Unable to mount root
fs on unknown-block(0,0)
[ 0.267679] Rebooting in 10 seconds..


This has been working great so far. If I understand correctly your
commit, this is a sort of safe code path to avoid corrupted data upon
power-cut. Is there a way for me to continue booting my system as-is
(other than a git revert b5094b7f135be).

For reference, I flashed the NAND using:

https://elinux.org/CI20_Distros#Debian_8_2016-02-02_Beta

Thanks for suggestions,

-M

Richard Weinberger

unread,
May 24, 2018, 3:42:20 PM5/24/18
to Mathieu Malaterre, MIPS Creator CI20 Development, linu...@lists.infradead.org, boris.b...@bootlin.com
Mathieu,
No. MLC is simply not supported and not safe to use.
With that commit we reflect the state of the code and stop giving wrong promises.

I can hardly believe that it has been working great so far, did you
ever do power-cut tests?
Or are there other mechanisms on your board that make MLC usable by UBI?
For example SLC-emulation.

Thanks,
//richard

Mathieu Malaterre

unread,
May 25, 2018, 6:12:23 AM5/25/18
to Richard Weinberger, MIPS Creator CI20 Development, linu...@lists.infradead.org, boris.b...@bootlin.com
ACK. Would you recommend an alternate filesystem then ?

> I can hardly believe that it has been working great so far, did you
> ever do power-cut tests?
> Or are there other mechanisms on your board that make MLC usable by UBI?
> For example SLC-emulation.

Looking quickly at the tech specs:

https://www.elinux.org/CI20_Hardware#ROM.2FNAND

...
Is provided by a single Samsung K9GBG08UOA NAND flash, using an 8bit
data interface to the SoC.
...

So my understanding is that "it just worked" so far. I've tried
contacting some of the people involved with the design of CI20 to get
confirmation.

-M

Richard Weinberger

unread,
May 28, 2018, 4:15:43 PM5/28/18
to Mathieu Malaterre, MIPS Creator CI20 Development, linu...@lists.infradead.org, boris.b...@bootlin.com
Mathieu,

Am Freitag, 25. Mai 2018, 12:12:02 CEST schrieb Mathieu Malaterre:
> > No. MLC is simply not supported and not safe to use.
> > With that commit we reflect the state of the code and stop giving wrong promises.
>
> ACK. Would you recommend an alternate filesystem then ?

There is none.

One option you have is putting the MLC NAND into SLC mode, some support this.
This needs to be achieved by a vendor specific command which is often undocumented.

Boris and I experimented also with software SLC mode in UBI.
If you want you can revive our work.

> > I can hardly believe that it has been working great so far, did you
> > ever do power-cut tests?
> > Or are there other mechanisms on your board that make MLC usable by UBI?
> > For example SLC-emulation.
>
> Looking quickly at the tech specs:
>
> https://www.elinux.org/CI20_Hardware#ROM.2FNAND
>
> ...
> Is provided by a single Samsung K9GBG08UOA NAND flash, using an 8bit
> data interface to the SoC.
> ...
>
> So my understanding is that "it just worked" so far. I've tried
> contacting some of the people involved with the design of CI20 to get
> confirmation.

"just worked" in terms of nobody gave it a decent testing, I fear. ;-\

Thanks,
//richard


z4v4l

unread,
Nov 15, 2018, 6:55:18 PM11/15/18
to MIPS Creator CI20 Development


четвер, 24 травня 2018 р. 22:42:20 UTC+3 користувач Richard Weinberger написав:
No. MLC is simply not supported and not safe to use.
With that commit we reflect the state of the code and stop giving wrong promises.

I can hardly believe that it has been working great so far, did you
ever do power-cut tests?
Or are there other mechanisms on your board that make MLC usable by UBI?
For example SLC-emulation.

Thanks,
//richard

If it is not safe, how is it possible at all to safely use SD cards, eMMC modules, SSDs? They could be even TLC inside! They are not protected from power-cuts too and basically this rejecting to attach MLC by UBI means that those tiny by resources microcontrollers inside of the aforementioned managed NAND based storage devices do a much better job than all this UBI thing, running on the host! I am very happy that I use the old installation, for me linux is just a fat flasher anyway. But it's so weird these explanations. Like MLC is non-reliable?! For what this UBI does exist then? how many boards with SLC do exist? It's so f&cked up. as always. some single board computers put the ext4 FS on the bare NAND (Cubieboards, armbian) and I was always so comfortable with the fact that on CI20, people managed to put the protective layer, so good for them, I thought. And now I find, that that "protective" layer is just a bubble. that finally decided to give up and tell people the truth - they cannot provide anything. turns out that this is MLC which is unrealiable and not safe...
so not cool.
Reply all
Reply to author
Forward
0 new messages