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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1b72edfc-e1fb-4987-b874-7fe977ff56a3@kontron.de>
Date: Mon, 12 Aug 2024 09:26:23 +0200
From: Frieder Schrempf <frieder.schrempf@...tron.de>
To: Daniel Golle <daniel@...rotopia.org>,
 Miquel Raynal <miquel.raynal@...tlin.com>,
 Richard Weinberger <richard@....at>, Vignesh Raghavendra <vigneshr@...com>,
 Tudor Ambarus <tudor.ambarus@...aro.org>,
 Mika Westerberg <mika.westerberg@...ux.intel.com>,
 Chia-Lin Kao <acelan.kao@...onical.com>,
 Martin Kurbanov <mmkurbanov@...utedevices.com>,
 linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mtd: spinand: set bitflip_threshold to 75% of ECC
 strength

Hi Daniel,

On 12.08.24 3:56 AM, Daniel Golle wrote:
> Reporting an unclean read from SPI-NAND only when the maximum number
> of correctable bitflip errors has been hit seems a bit late.
> UBI LEB scrubbing, which depends on the lower MTD device reporting
> correctable bitflips, then only kicks in when it's almost too late.
> 
> Set bitflip_threshold to 75% of the ECC strength, which is also the
> default for raw NAND.
> 
> Signed-off-by: Daniel Golle <daniel@...rotopia.org>
> ---
>  drivers/mtd/nand/spi/core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> index e0b6715e5dfed..018c854d06193 100644
> --- a/drivers/mtd/nand/spi/core.c
> +++ b/drivers/mtd/nand/spi/core.c
> @@ -1287,6 +1287,7 @@ static int spinand_init(struct spinand_device *spinand)
>  	/* Propagate ECC information to mtd_info */
>  	mtd->ecc_strength = nanddev_get_ecc_conf(nand)->strength;
>  	mtd->ecc_step_size = nanddev_get_ecc_conf(nand)->step_size;
> +	mtd->bitflip_threshold = DIV_ROUND_UP(mtd->ecc_strength * 3, 4);

Is this just a theoretical adjustment or did you encounter any issues on
a real device? If the latter, could you add a sentence about your
use-case to the commit message?

In general the change looks good to me, so feel free to add:

Reviewed-by: Frieder Schrempf <frieder.schrempf@...tron.de>

But it would still be good to hear further opinions.

Thanks
Frieder

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ