aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mvebu/patches-3.10/0162-mtd-nand-pxa3xx-Clear-need_wait-flag-when-starting-a.patch
diff options
context:
space:
mode:
authorLuka Perkov <luka@openwrt.org>2014-02-11 02:07:44 +0000
committerLuka Perkov <luka@openwrt.org>2014-02-11 02:07:44 +0000
commit5b5ad5ba01cebe6a749bcf5c9fc9637876fe0b1f (patch)
tree8b031a68c4ff6c7457830843adc41d49f0ab2d5f /target/linux/mvebu/patches-3.10/0162-mtd-nand-pxa3xx-Clear-need_wait-flag-when-starting-a.patch
parent608ad4b6932f72995144bc72a31b1e0843a5bb28 (diff)
downloadmaster-187ad058-5b5ad5ba01cebe6a749bcf5c9fc9637876fe0b1f.tar.gz
master-187ad058-5b5ad5ba01cebe6a749bcf5c9fc9637876fe0b1f.tar.bz2
master-187ad058-5b5ad5ba01cebe6a749bcf5c9fc9637876fe0b1f.zip
mvebu: backport mainline patches from kernel 3.13
This is a backport of the patches accepted to the Linux mainline related to mvebu SoC (Armada XP and Armada 370) between Linux v3.12, and Linux v3.13. This work mainly covers: * Finishes work for sharing the pxa nand driver(drivers/mtd/nand/pxa3xx_nand.c) between the PXA family, and the Armada family. * timer initialization update, and access function for the Armada family. * Generic IRQ handling backporting. * Some bug fixes. Signed-off-by: Seif Mazareeb <seif.mazareeb@gmail.com> CC: Luka Perkov <luka@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39566 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/mvebu/patches-3.10/0162-mtd-nand-pxa3xx-Clear-need_wait-flag-when-starting-a.patch')
-rw-r--r--target/linux/mvebu/patches-3.10/0162-mtd-nand-pxa3xx-Clear-need_wait-flag-when-starting-a.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/target/linux/mvebu/patches-3.10/0162-mtd-nand-pxa3xx-Clear-need_wait-flag-when-starting-a.patch b/target/linux/mvebu/patches-3.10/0162-mtd-nand-pxa3xx-Clear-need_wait-flag-when-starting-a.patch
new file mode 100644
index 0000000000..5665ca13e6
--- /dev/null
+++ b/target/linux/mvebu/patches-3.10/0162-mtd-nand-pxa3xx-Clear-need_wait-flag-when-starting-a.patch
@@ -0,0 +1,50 @@
+From 7efaa8677ffd07d54d0122b5e92f29b74a36ad39 Mon Sep 17 00:00:00 2001
+From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
+Date: Thu, 19 Dec 2013 06:08:03 -0300
+Subject: [PATCH 162/203] mtd: nand: pxa3xx: Clear need_wait flag when starting
+ a command
+
+Currently the driver assumes all commands will eventually trigger a RnB
+transition, and thus a "device is ready" IRQ.
+
+This assumption means that on every issued command, the dev_ready completion
+handler is init'ed and the need_wait flag is set.
+
+However this is incorrect: some commands (such as NAND_CMD_STATUS) don't
+make the device 'busy' and thus a RnB transition never occurs.
+Given, the NAND core never calls waitfunc() after such commands, this
+is not a problem.
+
+Therefore, it's possible to only clear the need_wait flag on every command
+that is started.
+
+This fixes a current bug that can be reproduced on PXA boards by writing
+blank (all 0xff'ed) to a page:
+
+ 1. The kernel issues NAND_CMD_STATUS and sets need_wait=1. The flag
+ won't be cleared for this command since no RnB transition is
+ involved.
+
+ 2. NAND_CMD_PAGEPROG is issued but since the data is blank, the driver
+ decides not to execute the command (and no IRQ activity is
+ involved).
+
+ 3. The NAND core calls waitfunc() and waits for the dev_ready
+ completion, which will never end since the device _is_ already ready.
+
+Tested-by: Arnaud Ebalard <arno@natisbad.org>
+Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
+---
+ drivers/mtd/nand/pxa3xx_nand.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/mtd/nand/pxa3xx_nand.c
++++ b/drivers/mtd/nand/pxa3xx_nand.c
+@@ -694,6 +694,7 @@ static void prepare_start_command(struct
+ info->retcode = ERR_NONE;
+ info->ecc_err_cnt = 0;
+ info->ndcb3 = 0;
++ info->need_wait = 0;
+
+ switch (command) {
+ case NAND_CMD_READ0: