[PATCH 5/7] mtd: nand: read_page() returns max_bitflips

Scott Wood scottwood at freescale.com
Tue Apr 24 15:45:44 EDT 2012


On 04/24/2012 02:18 PM, Mike Dunn wrote:
> diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
> index 872cc96..df36037 100644
> --- a/drivers/mtd/nand/fsl_ifc_nand.c
> +++ b/drivers/mtd/nand/fsl_ifc_nand.c
> @@ -63,6 +63,7 @@ struct fsl_ifc_nand_ctrl {
>  	unsigned int oob;	/* Non zero if operating on OOB data	*/
>  	unsigned int eccread;	/* Non zero for a full-page ECC read	*/
>  	unsigned int counter;	/* counter for the initializations	*/
> +	unsigned int max_bitflips;  /* Saved during READ0 cmd		*/
>  };
>  
>  static struct fsl_ifc_nand_ctrl *ifc_nand_ctrl;
> @@ -268,6 +269,8 @@ static void fsl_ifc_run_command(struct mtd_info *mtd)
>  		int sector = bufnum * chip->ecc.steps;
>  		int sector_end = sector + chip->ecc.steps - 1;
>  
> +		nctrl->max_bitflips = 0;
> +
>  		for (i = sector / 4; i <= sector_end / 4; i++)
>  			eccstat[i] = in_be32(&ifc->ifc_nand.nand_eccstat[i]);
>  

I'd prefer to clear max_bitflips before this if-block, so that we can
rely on max_bitflips being zero when ECC wasn't requested.

Otherwise ACK the eLBC and IFC changes.

-Scott




More information about the linux-mtd mailing list