[PATCH] powerpc/85xx: fix NAND_CMD_READID read bytes number

Bryan Hundven bryanhundven at gmail.com
Fri Jun 17 13:58:53 EDT 2011


On Sun, Jun 12, 2011 at 7:23 PM, Shaohui Xie <Shaohui.Xie at freescale.com> wrote:
> when nand_get_flash_type() is called, it will read 8 bytes of ID instead of 5,
> but the driver only read 5 bytes, so kernel will dump error messages like:
>
> fsl-lbc ffe124000.localbus: read_byte beyond end of buffer
> fsl-lbc ffe124000.localbus: read_byte beyond end of buffer
> fsl-lbc ffe124000.localbus: read_byte beyond end of buffer
>
> Signed-off-by: Shaohui Xie <Shaohui.Xie at freescale.com>
> Acked-by: Scott Wood <scottwood at freescale.com>
> ---
>  drivers/mtd/nand/fsl_elbc_nand.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
> index 0bb254c..33d8aad 100644
> --- a/drivers/mtd/nand/fsl_elbc_nand.c
> +++ b/drivers/mtd/nand/fsl_elbc_nand.c
> @@ -339,9 +339,9 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command,
>                                    (FIR_OP_UA  << FIR_OP1_SHIFT) |
>                                    (FIR_OP_RBW << FIR_OP2_SHIFT));
>                out_be32(&lbc->fcr, NAND_CMD_READID << FCR_CMD0_SHIFT);
> -               /* 5 bytes for manuf, device and exts */
> -               out_be32(&lbc->fbcr, 5);
> -               elbc_fcm_ctrl->read_bytes = 5;
> +               /* nand_get_flash_type() reads 8 bytes of entire ID string */
> +               out_be32(&lbc->fbcr, 8);
> +               elbc_fcm_ctrl->read_bytes = 8;
>                elbc_fcm_ctrl->use_mdr = 1;
>                elbc_fcm_ctrl->mdr = 0;
>
> --
> 1.6.4
>
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>

Shaohui,

I have tested this on p1011rdb, p1020rdb, and p2020rdb on 2.6.35.13
and 2.6.39.1.
Thank you for fixing this :-)

-Bryan



More information about the linux-mtd mailing list