Re: Pass -EUCLEN to userspace?

Boris Brezillon
2016-04-22T15:25:26Z

Hi Sascha,

On Wed, 20 Apr 2016 15:25:16 +0200
Sascha Hauer <s.hauer@pengutronix.de> wrote:

> Hi All,
>
> I am currently working on a program similar to ubihealthd, just for raw
> mtd pages, not UBI. Basically I want to find out in userspace if my Nand needs
> scrubbing. Is it possible somehow to get this information in userspace?

Actually we discussed that a year ago with Richard. I told him that we
should put the read/write/erase statistics at the MTD level so that
other MTD users (including userspace programs) could use the same infra
for non-UBI partitions (I need that for the UBOOT and SPL partitions).

My suggestion was to store those information at the MTD level, and let
UBI implement its own scrubbing layer on top of that, but Richard
decided to go for a simpler approach for its first implementation.

>
> So far I can count the number of bitflips corrected using the
> ECCGETSTATS ioctl. Also I can read the bitflip_threshold from
> /sys/class/mtdx/bitflip_threshold. The problem is now that I can only
> read full pages, but the bitflip threshold is per ecc_step_size. Simply
> dividing by the number of ecc_steps is not accurate. Any way to solve
> this?

Hm, you're right, then we'll need to expose those information through a
different ioctl.

Regards,

Boris

--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering