lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87h60dmn86.fsf@bootlin.com>
Date: Wed, 18 Jun 2025 11:07:53 +0200
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: David Regan <dregan@...adcom.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
  linux-mtd@...ts.infradead.org,  bcm-kernel-feedback-list@...adcom.com,
  William Zhang <william.zhang@...adcom.com>,  Anand Gore
 <anand.gore@...adcom.com>,  Florian Fainelli
 <florian.fainelli@...adcom.com>,  Kamal Dasu <kamal.dasu@...adcom.com>,
  Dan Beygelman <dan.beygelman@...adcom.com>,  Álvaro Fernández Rojas
 <noltari@...il.com>,  rafal@...ecki.pl,  computersforpeace@...il.com,
  frieder.schrempf@...tron.de,  Vignesh Raghavendra <vigneshr@...com>,
  Richard Weinberger <richard@....at>,  Boris Brezillon
 <bbrezillon@...nel.org>,  kdasu.kdev@...il.com,  JaimeLiao
 <jaimeliao.tw@...il.com>,  Adam Borowski <kilobyte@...band.pl>,  Jonas
 Gorski <jonas.gorski@...il.com>,  dgcbueu@...il.com,  dregan@...l.com
Subject: Re: [PATCH v2] mtd: nand: brcmnand: fix mtd corrected bits stat

Hello David,

> I'm not familiar with nandbiterrs but here's the results from
> mtd_nandbiterrs.ko on my NAND set to BCH8:
>
> # insmod mtd_nandbiterrs.ko dev=0
> [  676.097190]
> [  676.098760] ==================================================
> [  676.104609] mtd_nandbiterrs: MTD device: 0
> [  676.108732] mtd_nandbiterrs: MTD device size 2097152,
> eraseblock=262144, page=4096, oob=216
> [  676.117089] mtd_nandbiterrs: Device uses 1 subpages of 4096 bytes
> [  676.123188] mtd_nandbiterrs: Using page=0, offset=0, eraseblock=0
> [  676.130863] mtd_nandbiterrs: incremental biterrors test
> [  676.136154] mtd_nandbiterrs: write_page
> [  676.140761] mtd_nandbiterrs: rewrite page
> [  676.145473] mtd_nandbiterrs: read_page
> [  676.149621] mtd_nandbiterrs: verify_page
> [  676.153625] mtd_nandbiterrs: Successfully corrected 0 bit errors per subpage
> [  676.160678] mtd_nandbiterrs: Inserted biterror @ 0/5
> [  676.165647] mtd_nandbiterrs: rewrite page
> [  676.170363] mtd_nandbiterrs: read_page
> [  676.174508] mtd_nandbiterrs: Read reported 1 corrected bit errors
> [  676.180606] mtd_nandbiterrs: verify_page
> [  676.184609] mtd_nandbiterrs: Successfully corrected 1 bit errors per subpage
> [  676.191662] mtd_nandbiterrs: Inserted biterror @ 0/2
> [  676.196631] mtd_nandbiterrs: rewrite page
> [  676.201342] mtd_nandbiterrs: read_page
> [  676.205487] mtd_nandbiterrs: Read reported 2 corrected bit errors
> [  676.211586] mtd_nandbiterrs: verify_page
> [  676.215588] mtd_nandbiterrs: Successfully corrected 2 bit errors per subpage
> [  676.222641] mtd_nandbiterrs: Inserted biterror @ 0/0
> [  676.227608] mtd_nandbiterrs: rewrite page
> [  676.228356] mtd_nandbiterrs: read_page
> [  676.228749] mtd_nandbiterrs: Read reported 3 corrected bit errors
> [  676.228751] mtd_nandbiterrs: verify_page
> [  676.228829] mtd_nandbiterrs: Successfully corrected 3 bit errors per subpage
> [  676.228831] mtd_nandbiterrs: Inserted biterror @ 1/7
> [  676.228833] mtd_nandbiterrs: rewrite page
> [  676.229530] mtd_nandbiterrs: read_page
> [  676.229922] mtd_nandbiterrs: Read reported 4 corrected bit errors
> [  676.229924] mtd_nandbiterrs: verify_page
> [  676.230001] mtd_nandbiterrs: Successfully corrected 4 bit errors per subpage
> [  676.230003] mtd_nandbiterrs: Inserted biterror @ 1/5
> [  676.230005] mtd_nandbiterrs: rewrite page
> [  676.294177] mtd_nandbiterrs: read_page
> [  676.298337] mtd_nandbiterrs: Read reported 5 corrected bit errors
> [  676.304436] mtd_nandbiterrs: verify_page
> [  676.308441] mtd_nandbiterrs: Successfully corrected 5 bit errors per subpage
> [  676.315494] mtd_nandbiterrs: Inserted biterror @ 1/2
> [  676.320464] mtd_nandbiterrs: rewrite page
> [  676.325174] mtd_nandbiterrs: read_page
> [  676.329327] mtd_nandbiterrs: Read reported 6 corrected bit errors
> [  676.335426] mtd_nandbiterrs: verify_page
> [  676.339429] mtd_nandbiterrs: Successfully corrected 6 bit errors per subpage
> [  676.346483] mtd_nandbiterrs: Inserted biterror @ 1/0
> [  676.351452] mtd_nandbiterrs: rewrite page
> [  676.356162] mtd_nandbiterrs: read_page
> [  676.360308] mtd_nandbiterrs: Read reported 7 corrected bit errors
> [  676.366407] mtd_nandbiterrs: verify_page
> [  676.370409] mtd_nandbiterrs: Successfully corrected 7 bit errors per subpage
> [  676.377462] mtd_nandbiterrs: Inserted biterror @ 2/6
> [  676.382432] mtd_nandbiterrs: rewrite page
> [  676.387142] mtd_nandbiterrs: read_page
> [  676.391287] mtd_nandbiterrs: Read reported 8 corrected bit errors
> [  676.397385] mtd_nandbiterrs: verify_page
> [  676.401388] mtd_nandbiterrs: Successfully corrected 8 bit errors
> per subpage

So far the reporting looks good (and the nandflipbits output looks
correct as well).

> [  676.408441] mtd_nandbiterrs: Inserted biterror @ 2/5
> [  676.413411] mtd_nandbiterrs: rewrite page
> [  676.418122] mtd_nandbiterrs: read_page
> [  676.422267] mtd_nandbiterrs: verify_page
> [  676.426194] mtd_nandbiterrs: Error: page offset 0, expected 25, got 00
> [  676.432727] mtd_nandbiterrs: Error: page offset 1, expected a5, got 00
> [  676.439260] mtd_nandbiterrs: Error: page offset 2, expected 65, got 05
> [  676.445868] mtd_nandbiterrs: ECC failure, read data is incorrect
> despite read success

Here however there is something wrong. We do expect a read failure,
instead of returning wrong data. There is still a problem, I do not know
if this problem was there before though, but this must be fixed.

Hello Florian, if you have time, I'd welcome you opinion on this patch :)

Cheers,
Miquèl

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ