mtd: atmel_nand: Disable subpage NAND write when using Atmel PMECC
authorHerve Codina <Herve.CODINA@celad.com>
Mon, 3 Mar 2014 11:15:29 +0000 (12:15 +0100)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 11 Mar 2014 05:42:31 +0000 (22:42 -0700)
Crash detected on sam5d35 and its pmecc nand ecc controller.

The problem was a call to chip->ecc.hwctl from nand_write_subpage_hwecc
(nand_base.c) when we write a sub page.
chip->ecc.hwctl function is not set when we are using PMECC controller.
As a workaround, set NAND_NO_SUBPAGE_WRITE for PMECC controller in
order to disable sub page access in nand_write_page.

Signed-off-by: Herve Codina <Herve.CODINA@celad.com>
Acked-by: Josh Wu <josh.wu@atmel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/atmel_nand.c

index 1f719e03c073a2b6c744e274c209702bdb6213e7..4ce181a35bcd3eedf39c8fd3a5c617306278ef58 100644 (file)
@@ -1220,6 +1220,7 @@ static int atmel_pmecc_nand_init_params(struct platform_device *pdev,
                goto err;
        }
 
+       nand_chip->options |= NAND_NO_SUBPAGE_WRITE;
        nand_chip->ecc.read_page = atmel_nand_pmecc_read_page;
        nand_chip->ecc.write_page = atmel_nand_pmecc_write_page;