[PATCH] mtd: nand: brcmnand: fix mtd corrected bits stat
David Regan
dregan at broadcom.com
Wed Jun 4 18:51:06 PDT 2025
Hi Miquèl,
On Mon, Jun 2, 2025 at 7:19 AM Miquel Raynal <miquel.raynal at bootlin.com> wrote:
>
> On 29/05/2025 at 20:46:59 -07, David Regan <dregan at broadcom.com> wrote:
>
> > Currently we attempt to get the amount of flipped bits from a hardware
> > location which is reset on every subpage. Instead obtain total flipped
> > bits stat from hardware accumulator. In addition identify the correct
> > maximum subpage corrected bits.
>
> This change does not feel correct. We gather two statistics:
> - the maximum number of bitflips corrected in a single ECC chunk
> - the total number of bitflips among the whole page
>
> The most important one is the former, because it may trigger wear
> levelling from the top layer (UBI, usually). It feels like you are
> breaking this, am I wrong? Would you mind to be more explicit otherwise?
Detecting the maximum number of bitflips corrected in a single subpage
(ECC chunk) doesn't work correctly, however the code will still
trigger an EUCLEAN since we return max(mtd->bitflip_threshold,
corrected) . My fix is to accurately report the maximum number of bit
flips per subpage, in addition to counting the total bit flips per
whole page to update the mtd corrected bits stat.
>
> Thanks,
> Miquèl
-Dave
More information about the linux-mtd
mailing list