All of lore.kernel.org
 help / color / mirror / Atom feed
* mtd utilities work but ubi utilities do not?
@ 2019-02-13 23:41 Matt Schepers
  2019-02-14  2:41 ` David Oberhollenzer
  0 siblings, 1 reply; 6+ messages in thread
From: Matt Schepers @ 2019-02-13 23:41 UTC (permalink / raw)
  To: linux-mtd

Hello,

I have a curious issue that I cannot explain: I am able to read and write to my NAND (MT29F8G08ABABAWP) with "flash_erase /dev/mtd7 0 2048" and "nandtest /dev/mtd7" but "ubiformat /dev/mtd7" and "ubiattach -p /dev/mtd7" do not work for me.

So my basic question is why would the mdt utilities work and the ubi utilities not?

Even though nandtest seems to work fine I have included its output. As you can see it even finds and corrects the occasional ECC error. What I find interesting however is that the there are several thousand ECC errors that occurred before nandtest was run(due to ubiformat and ubiattach), but not a single one was correctable.

Output of "nandtest /dev/mtd7":
ECC corrections: 0
ECC failures   : 4041
Bad blocks     : 0
BBT blocks     : 0
06100000: reading (1 of 1)...
 1 bit(s) ECC corrected at 06100000
0b900000: reading (1 of 1)...

Also here is the output of "mtdinfo /dev/mtd7":
mtd7
Name:                           rootfs_data
Type:                           nand
Eraseblock size:                524288 bytes, 512.0 KiB
Amount of eraseblocks:          2048 (1073741824 bytes, 1024.0 MiB)
Minimum input/output unit size: 4096 bytes
Sub-page size:                  1024 bytes
OOB size:                       224 bytes
Character device major/minor:   90:14
Bad blocks are allowed:         true
Device is writable:             true


Here is where the trouble begins...

When I "ubiformat /dev/mtd7" it works the first time with no errors, but the same command generates "[  276.517513] ecc unrecoverable erro" on dmesg for all subsequent runs of "ubiformat /dev/mtd7". Further when I try "ubiattach -p /dev/mtd7" I get the following error for every PEB in the device.

dmesg output of "ubiformat /dev/mtd7"(2nd, 3rd run etc):
[  276.517513] ecc unrecoverable erro

Output of "ubiattach -p /dev/mtd7":
Errors begin with first PEB.
...
...
...
[  419.917998] ubi0 warning: ubi_io_read: error -77 (ECC error) while reading 64 bytes from PEB 2047:0, read only 64 bytes, retry
[  419.919060] ecc unrecoverable error
[  419.922696] ubi0 warning: ubi_io_read: error -77 (ECC error) while reading 64 bytes from PEB 2047:1024, read only 64 bytes, retry
[  419.923107] ubi0: scanning is finished
[  419.954179] ubi0: attached mtd7 (name "rootfs_data", size 1024 MiB)
[  419.954205] ubi0: PEB size: 524288 bytes (512 KiB), LEB size: 520192 bytes
[  419.954217] ubi0: min./max. I/O unit sizes: 4096/4096, sub-page size 1024
[  419.954229] ubi0: VID header offset: 1024 (aligned 1024), data offset: 4096
[  419.954240] ubi0: good PEBs: 2048, bad PEBs: 0, corrupted PEBs: 0
[  419.954252] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
[  419.954268] ubi0: max/mean erase counter: 1/1, WL threshold: 4096, image sequence number: 1850455827
[  419.954282] ubi0: available PEBs: 2004, total reserved PEBs: 44, PEBs reserved for bad PEB handling: 40
[  419.958108] ubi0: background thread "ubi_bgt0d" started, PID 74

Why would the mtd utilities work and the UBI utilities not?

Respectfully,
Matt Schepers

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: mtd utilities work but ubi utilities do not?
  2019-02-13 23:41 mtd utilities work but ubi utilities do not? Matt Schepers
@ 2019-02-14  2:41 ` David Oberhollenzer
  2019-02-14  3:09   ` Matt Schepers
  0 siblings, 1 reply; 6+ messages in thread
From: David Oberhollenzer @ 2019-02-14  2:41 UTC (permalink / raw)
  To: Matt Schepers, linux-mtd

Hello,


there are unfortunately some historical obscurities hidden in the tooling and some things might
not be too obvious at first.

You don't need to use ubiformat, unless you want to flash an existing UBI image (generated
by ubinize). The ubiformat also tool won't generate a warning or an error if you don't specify
an image file and simply march on.


The work flow for what you want to do would look something like this:

# flash_erase /dev/mtd7 0 0
# ubiattach -p /dev/mtd7
# ubimkvol /dev/ubi0 -s 100MiB -N rootfs_data
# ubimkvol /dev/ubi0 -s 40MiB -N config_data
# ....


Sincerely, 

David


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: mtd utilities work but ubi utilities do not?
  2019-02-14  2:41 ` David Oberhollenzer
@ 2019-02-14  3:09   ` Matt Schepers
  2019-02-14  7:31     ` Richard Weinberger
  0 siblings, 1 reply; 6+ messages in thread
From: Matt Schepers @ 2019-02-14  3:09 UTC (permalink / raw)
  To: David Oberhollenzer, linux-mtd

David, thank you for that information. However the following sequence of commands produces an uncorrectable ECC error where I think it shouldn't:

command sequence:
flash_erase /dev/mtd7 0 2048
ubiattach -p /dev/mtd7
ubidetach -p /dev/mtd7
ubiattach -p /dev/mtd7

dmesg:
[  362.807750] ubi0 warning: ubi_io_read: error -77 (ECC error) while reading 64 bytes from PEB 2044:0, read only 64 bytes, retry
[  362.808328] __nand_correct_data: uncorrectable ECC error
...

This error is present for every PEB in the ubi device.

Can you confirm that this should work?

________________________________________
From: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Sent: Wednesday, February 13, 2019 7:41 PM
To: Matt Schepers; linux-mtd@lists.infradead.org
Subject: Re: mtd utilities work but ubi utilities do not?

Hello,


there are unfortunately some historical obscurities hidden in the tooling and some things might
not be too obvious at first.

You don't need to use ubiformat, unless you want to flash an existing UBI image (generated
by ubinize). The ubiformat also tool won't generate a warning or an error if you don't specify
an image file and simply march on.


The work flow for what you want to do would look something like this:

# flash_erase /dev/mtd7 0 0
# ubiattach -p /dev/mtd7
# ubimkvol /dev/ubi0 -s 100MiB -N rootfs_data
# ubimkvol /dev/ubi0 -s 40MiB -N config_data
# ....


Sincerely,

David


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: mtd utilities work but ubi utilities do not?
  2019-02-14  3:09   ` Matt Schepers
@ 2019-02-14  7:31     ` Richard Weinberger
  2019-02-14 15:56       ` Matt Schepers
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Weinberger @ 2019-02-14  7:31 UTC (permalink / raw)
  To: Matt Schepers; +Cc: linux-mtd, David Oberhollenzer

On Thu, Feb 14, 2019 at 4:09 AM Matt Schepers <mschepers@telspandata.com> wrote:
>
> David, thank you for that information. However the following sequence of commands produces an uncorrectable ECC error where I think it shouldn't:
>
> command sequence:
> flash_erase /dev/mtd7 0 2048
> ubiattach -p /dev/mtd7
> ubidetach -p /dev/mtd7
> ubiattach -p /dev/mtd7
>
> dmesg:
> [  362.807750] ubi0 warning: ubi_io_read: error -77 (ECC error) while reading 64 bytes from PEB 2044:0, read only 64 bytes, retry
> [  362.808328] __nand_correct_data: uncorrectable ECC error

Looks more like your NAND driver is buggy.
Maybe subpage support.

-- 
Thanks,
//richard

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: mtd utilities work but ubi utilities do not?
  2019-02-14  7:31     ` Richard Weinberger
@ 2019-02-14 15:56       ` Matt Schepers
  2019-02-14 16:19         ` Richard Weinberger
  0 siblings, 1 reply; 6+ messages in thread
From: Matt Schepers @ 2019-02-14 15:56 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: linux-mtd, David Oberhollenzer

Richard, 

It could be the case that it is a problem with partial page/reads writes in the driver. Is there a quick way to completely disable this and see? I have already tried setting the VID offset in ubiattach but I get the same error described before.

If there is not a way to quickly disable partial page reads/writes how do you recommend that I troubleshoot this?

Respectfully,
Matt Schepers

________________________________________
From: Richard Weinberger <richard.weinberger@gmail.com>
Sent: Thursday, February 14, 2019 12:31 AM
To: Matt Schepers
Cc: David Oberhollenzer; linux-mtd@lists.infradead.org
Subject: Re: mtd utilities work but ubi utilities do not?

On Thu, Feb 14, 2019 at 4:09 AM Matt Schepers <mschepers@telspandata.com> wrote:
>
> David, thank you for that information. However the following sequence of commands produces an uncorrectable ECC error where I think it shouldn't:
>
> command sequence:
> flash_erase /dev/mtd7 0 2048
> ubiattach -p /dev/mtd7
> ubidetach -p /dev/mtd7
> ubiattach -p /dev/mtd7
>
> dmesg:
> [  362.807750] ubi0 warning: ubi_io_read: error -77 (ECC error) while reading 64 bytes from PEB 2044:0, read only 64 bytes, retry
> [  362.808328] __nand_correct_data: uncorrectable ECC error

Looks more like your NAND driver is buggy.
Maybe subpage support.

--
Thanks,
//richard

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: mtd utilities work but ubi utilities do not?
  2019-02-14 15:56       ` Matt Schepers
@ 2019-02-14 16:19         ` Richard Weinberger
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Weinberger @ 2019-02-14 16:19 UTC (permalink / raw)
  To: Matt Schepers, David Oberhollenzer; +Cc: linux-mtd

Matt,

Am Donnerstag, 14. Februar 2019, 16:56:32 CET schrieb Matt Schepers:
> Richard, 
> 
> It could be the case that it is a problem with partial page/reads writes in the driver. Is there a quick way to completely disable this and see? I have already tried setting the VID offset in ubiattach but I get the same error described before.

Yes, set NAND_NO_SUBPAGE_WRITE and make sure that NAND_SUBPAGE_READ is not set.

Thanks,
//richard



______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2019-02-14 16:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-13 23:41 mtd utilities work but ubi utilities do not? Matt Schepers
2019-02-14  2:41 ` David Oberhollenzer
2019-02-14  3:09   ` Matt Schepers
2019-02-14  7:31     ` Richard Weinberger
2019-02-14 15:56       ` Matt Schepers
2019-02-14 16:19         ` Richard Weinberger

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.