2015-04-02 17:43:35

by Andrea Scian

[permalink] [raw]
Subject: Re: [PATCH 4/4] UBI: Implement bitrot checking


Richard,

Il 29/03/2015 14:13, Richard Weinberger ha scritto:
> + mutex_lock(&ubi->buf_mutex);
> + err = ubi_io_read(ubi, ubi->peb_buf, e->pnum, 0, ubi->peb_size);
> + mutex_unlock(&ubi->buf_mutex);
> + if (err == UBI_IO_BITFLIPS) {
> + dbg_wl("found bitflips in PEB %d", e->pnum);
> + spin_lock(&ubi->wl_lock);
> +

IIUC you trigger the action as soon as you have a bitflip error, is this
correct?

Isn't this too much conservative? You usually have a RBER on MLC devices
that's between 1E-7 (for brand new devices) and 1E-4 (for devices with
1k-2k P/E cycle after 100k-300k read-without-P/E)

Having a few bitflips on a block read is more that usual and current ECC
can correct more that 16 bit error over 512/1KiB.

WDYT?

Kind Regards,

--

Andrea SCIAN

DAVE Embedded Systems


2015-04-02 17:54:26

by Richard Weinberger

[permalink] [raw]
Subject: Re: [PATCH 4/4] UBI: Implement bitrot checking

Hi!

Am 02.04.2015 um 19:34 schrieb Andrea Scian:
>
> Richard,
>
> Il 29/03/2015 14:13, Richard Weinberger ha scritto:
>> + mutex_lock(&ubi->buf_mutex);
>> + err = ubi_io_read(ubi, ubi->peb_buf, e->pnum, 0, ubi->peb_size);
>> + mutex_unlock(&ubi->buf_mutex);
>> + if (err == UBI_IO_BITFLIPS) {
>> + dbg_wl("found bitflips in PEB %d", e->pnum);
>> + spin_lock(&ubi->wl_lock);
>> +
>
> IIUC you trigger the action as soon as you have a bitflip error, is this
> correct?

I trigger it as soon UBI sees the bitflip. This depends on the configured MTD
bitflip_threshold.

> Isn't this too much conservative? You usually have a RBER on MLC devices
> that's between 1E-7 (for brand new devices) and 1E-4 (for devices with
> 1k-2k P/E cycle after 100k-300k read-without-P/E)
>
> Having a few bitflips on a block read is more that usual and current ECC
> can correct more that 16 bit error over 512/1KiB.

Please see above. :)

Thanks,
//richard

2015-04-02 19:19:29

by Andrea Scian

[permalink] [raw]
Subject: Re: [PATCH 4/4] UBI: Implement bitrot checking

Il 02/04/2015 19:54, Richard Weinberger ha scritto:
> Hi!
>
> Am 02.04.2015 um 19:34 schrieb Andrea Scian:
>> Richard,
>>
>> Il 29/03/2015 14:13, Richard Weinberger ha scritto:
>>> + mutex_lock(&ubi->buf_mutex);
>>> + err = ubi_io_read(ubi, ubi->peb_buf, e->pnum, 0, ubi->peb_size);
>>> + mutex_unlock(&ubi->buf_mutex);
>>> + if (err == UBI_IO_BITFLIPS) {
>>> + dbg_wl("found bitflips in PEB %d", e->pnum);
>>> + spin_lock(&ubi->wl_lock);
>>> +
>> IIUC you trigger the action as soon as you have a bitflip error, is this
>> correct?
> I trigger it as soon UBI sees the bitflip. This depends on the configured MTD
> bitflip_threshold.

ops.. I confused UBI bitflip error with MTD bitflip error ;-)
thanks for point this out and help me understanding the code

now it's clear and it sounds good to me

Kind Regards,

--

Andrea SCIAN

DAVE Embedded Systems

2015-04-08 10:34:51

by Richard Weinberger

[permalink] [raw]
Subject: Re: [PATCH 4/4] UBI: Implement bitrot checking

Am 02.04.2015 um 21:19 schrieb Andrea Scian:
> Il 02/04/2015 19:54, Richard Weinberger ha scritto:
>> Hi!
>>
>> Am 02.04.2015 um 19:34 schrieb Andrea Scian:
>>> Richard,
>>>
>>> Il 29/03/2015 14:13, Richard Weinberger ha scritto:
>>>> + mutex_lock(&ubi->buf_mutex);
>>>> + err = ubi_io_read(ubi, ubi->peb_buf, e->pnum, 0, ubi->peb_size);
>>>> + mutex_unlock(&ubi->buf_mutex);
>>>> + if (err == UBI_IO_BITFLIPS) {
>>>> + dbg_wl("found bitflips in PEB %d", e->pnum);
>>>> + spin_lock(&ubi->wl_lock);
>>>> +
>>> IIUC you trigger the action as soon as you have a bitflip error, is this
>>> correct?
>> I trigger it as soon UBI sees the bitflip. This depends on the configured MTD
>> bitflip_threshold.
>
> ops.. I confused UBI bitflip error with MTD bitflip error ;-)
> thanks for point this out and help me understanding the code
>
> now it's clear and it sounds good to me

Is this an implicit Reviewed-by? :)

Thanks,
//richard

2015-04-08 21:02:36

by Andrea Scian

[permalink] [raw]
Subject: Re: [PATCH 4/4] UBI: Implement bitrot checking

Il 08/04/2015 12:34, Richard Weinberger ha scritto:
> Am 02.04.2015 um 21:19 schrieb Andrea Scian:
>> Il 02/04/2015 19:54, Richard Weinberger ha scritto:
>>> Hi!
>>>
>>> Am 02.04.2015 um 19:34 schrieb Andrea Scian:
>>>> Richard,
>>>>
>>>> Il 29/03/2015 14:13, Richard Weinberger ha scritto:
>>>>> + mutex_lock(&ubi->buf_mutex);
>>>>> + err = ubi_io_read(ubi, ubi->peb_buf, e->pnum, 0, ubi->peb_size);
>>>>> + mutex_unlock(&ubi->buf_mutex);
>>>>> + if (err == UBI_IO_BITFLIPS) {
>>>>> + dbg_wl("found bitflips in PEB %d", e->pnum);
>>>>> + spin_lock(&ubi->wl_lock);
>>>>> +
>>>> IIUC you trigger the action as soon as you have a bitflip error, is this
>>>> correct?
>>> I trigger it as soon UBI sees the bitflip. This depends on the configured MTD
>>> bitflip_threshold.
>>
>> ops.. I confused UBI bitflip error with MTD bitflip error ;-)
>> thanks for point this out and help me understanding the code
>>
>> now it's clear and it sounds good to me
>
> Is this an implicit Reviewed-by? :)

Yes

Reviewed-by: Andrea Scian <[email protected]>

(I have lot to learn about submitting kernel patches ;-) )

Unfortunately I cannot review it from a deep technical point of view
because some part of bitrot_check_worker() are not so clear to me (I'm
not an UBI expert and I need to dig a little bit further to have better
understanding), but the idea IMHO is right and it's worth having into UBI

Kind Regards,

--

Andrea SCIAN

DAVE Embedded Systems