aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerve Codina <Herve.CODINA@celad.com>2014-03-03 12:15:29 +0100
committerJiri Slaby <jslaby@suse.cz>2014-05-15 09:56:10 +0200
commitbf1490bcaaef902ab5fa9451f6087873c0568655 (patch)
treefba8afe1056e8abdf34cff5c92a9d9b855d5a82e
parent80ad3f6cf355495c4c431f18013108e09e071ec2 (diff)
mtd: atmel_nand: Disable subpage NAND write when using Atmel PMECC
commit 90445ff6241e2a13445310803e2efa606c61f276 upstream. 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> Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
-rw-r--r--drivers/mtd/nand/atmel_nand.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 9be07922476..1de054a0775 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -1249,6 +1249,7 @@ static int __init 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;