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-next>] [day] [month] [year] [list]
Date:	Tue, 15 Jan 2013 13:51:19 +0100
From:	Andrew Lunn <andrew@...n.ch>
To:	Stefan Peter <s.peter@....ch>
Cc:	devicetree-discuss@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-mtd@...ts.infradead.org, grant.likely@...retlab.ca,
	rob.herring@...xeda.com, rob@...dley.net, linux@....linux.org.uk,
	jason@...edaemon.net, andrew@...n.ch, dwmw2@...radead.org,
	jm@...tin.co.uk, arnd@...db.de,
	sebastian.hesselbarth@...glemail.com, iwamatsu@...auri.org,
	artem.bityutskiy@...ux.intel.com, wfp5p@...ginia.edu,
	gregkh@...uxfoundation.org, broonie@...nsource.wolfsonmicro.com,
	mchehab@...hat.com, nico@...aro.org
Subject: Re: [PATCH 3/4] Enable ecc-mode selection in the driver

On Tue, Jan 15, 2013 at 01:13:12PM +0100, Stefan Peter wrote:
> In order to be able to use the ecc-mode, add the bch module to the default
> settings for the kirwood boards and enable the activation in orin-nand.c
> 
> Signed-off-by: Stefan Peter <s.peter@....ch>
> ---
> diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
> index 93f3794..4a9d3f7 100644
> --- a/arch/arm/configs/kirkwood_defconfig
> +++ b/arch/arm/configs/kirkwood_defconfig
> @@ -84,6 +84,7 @@ CONFIG_MTD_CFI_STAA=y
>  CONFIG_MTD_PHYSMAP=y
>  CONFIG_MTD_M25P80=y
>  CONFIG_MTD_NAND=y
> +CONFIG_MTD_NAND_ECC_BCH=y
>  CONFIG_MTD_NAND_ORION=y
>  CONFIG_BLK_DEV_LOOP=y
>  # CONFIG_SCSI_PROC_FS is not set
> diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
> index cd72b92..1a35257 100644
> --- a/drivers/mtd/nand/orion_nand.c
> +++ b/drivers/mtd/nand/orion_nand.c
> @@ -14,6 +14,7 @@
>  #include <linux/module.h>
>  #include <linux/platform_device.h>
>  #include <linux/of.h>
> +#include <linux/of_mtd.h>
>  #include <linux/mtd/mtd.h>
>  #include <linux/mtd/nand.h>
>  #include <linux/mtd/partitions.h>
> @@ -130,6 +131,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)
>  		if (!of_property_read_u32(pdev->dev.of_node,
>  						"chip-delay", &val))
>  			board->chip_delay = (u8)val;
> +		board->ecc_mode = of_get_nand_ecc_mode(pdev->dev.of_node);

>  	} else
>  		board = pdev->dev.platform_data;
>  
> @@ -140,7 +142,8 @@ static int __init orion_nand_probe(struct platform_device *pdev)
>  	nc->IO_ADDR_R = nc->IO_ADDR_W = io_base;
>  	nc->cmd_ctrl = orion_nand_cmd_ctrl;
>  	nc->read_buf = orion_nand_read_buf;
> -	nc->ecc.mode = NAND_ECC_SOFT;
> +	nc->ecc.mode = board->ecc_mode == NAND_ECC_SOFT_BCH ?
> +		NAND_ECC_SOFT_BCH : NAND_ECC_SOFT;

Hi Stefan

What about a user that wants one of the other valid values?
NAND_ECC_OOB_FIRST, NAND_ECC_HW_SYNDROME, etc.

Would:

	if (IS_ERR(board->ecc_mode)) {
		nc->ecc.mode = NAND_ECC_SOFT;
		dev_info(&pdev->dev, "Defaulting to NAND_ECC_SOFT");
	} else
		nc->ecc.mode = board->ecc_mode

be better?

   Andrew
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ