From: Greg Kroah-Hartman Date: Tue, 28 Jul 2015 17:40:26 +0000 (-0700) Subject: 3.14-stable patches X-Git-Tag: v4.1.4~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ffb579bb702ad5e4f5122d7abcfab4b8b7de572;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: mtd-nand-don-t-use-read_buf-for-8-bit-onfi-transfers.patch mtd-nand-fix-erroneous-read_buf-call-in-nand_write_page_raw_syndrome.patch --- diff --git a/queue-3.14/mtd-nand-don-t-use-read_buf-for-8-bit-onfi-transfers.patch b/queue-3.14/mtd-nand-don-t-use-read_buf-for-8-bit-onfi-transfers.patch new file mode 100644 index 00000000000..d7741325fdf --- /dev/null +++ b/queue-3.14/mtd-nand-don-t-use-read_buf-for-8-bit-onfi-transfers.patch @@ -0,0 +1,69 @@ +From bd9c6e99b58255b9de1982711ac9487c9a2f18be Mon Sep 17 00:00:00 2001 +From: Brian Norris +Date: Fri, 29 Nov 2013 22:04:28 -0800 +Subject: mtd: nand: don't use read_buf for 8-bit ONFI transfers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Brian Norris + +commit bd9c6e99b58255b9de1982711ac9487c9a2f18be upstream. + +Use a repeated read_byte() instead of read_buf(), since for x16 buswidth +devices, we need to avoid the upper I/O[16:9] bits. See the following +commit for reference: + +commit 05f7835975dad6b3b517f9e23415985e648fb875 +Author: Uwe Kleine-König +Date: Thu Dec 5 22:22:04 2013 +0100 + + mtd: nand: don't use {read,write}_buf for 8-bit transfers + +Now, I think that all barriers to probing ONFI on x16 devices are +removed, so remove the check from nand_flash_detect_onfi(). + +Tested on 8-bit ONFI NAND (Micron MT29F32G08CBADAWP). + +Signed-off-by: Brian Norris +Tested-by: Ezequiel Garcia +Tested-By: Pekon Gupta +Cc: Mason +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mtd/nand/nand_base.c | 14 +++----------- + 1 file changed, 3 insertions(+), 11 deletions(-) + +--- a/drivers/mtd/nand/nand_base.c ++++ b/drivers/mtd/nand/nand_base.c +@@ -3063,7 +3063,7 @@ static int nand_flash_detect_onfi(struct + int *busw) + { + struct nand_onfi_params *p = &chip->onfi_params; +- int i; ++ int i, j; + int val; + + /* Try ONFI for unknown chip or LP */ +@@ -3072,18 +3072,10 @@ static int nand_flash_detect_onfi(struct + chip->read_byte(mtd) != 'F' || chip->read_byte(mtd) != 'I') + return 0; + +- /* +- * ONFI must be probed in 8-bit mode or with NAND_BUSWIDTH_AUTO, not +- * with NAND_BUSWIDTH_16 +- */ +- if (chip->options & NAND_BUSWIDTH_16) { +- pr_err("ONFI cannot be probed in 16-bit mode; aborting\n"); +- return 0; +- } +- + chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1); + for (i = 0; i < 3; i++) { +- chip->read_buf(mtd, (uint8_t *)p, sizeof(*p)); ++ for (j = 0; j < sizeof(*p); j++) ++ ((uint8_t *)p)[j] = chip->read_byte(mtd); + if (onfi_crc16(ONFI_CRC_BASE, (uint8_t *)p, 254) == + le16_to_cpu(p->crc)) { + break; diff --git a/queue-3.14/mtd-nand-fix-erroneous-read_buf-call-in-nand_write_page_raw_syndrome.patch b/queue-3.14/mtd-nand-fix-erroneous-read_buf-call-in-nand_write_page_raw_syndrome.patch new file mode 100644 index 00000000000..e571679f3c1 --- /dev/null +++ b/queue-3.14/mtd-nand-fix-erroneous-read_buf-call-in-nand_write_page_raw_syndrome.patch @@ -0,0 +1,32 @@ +From 60c3bc1fd6f1fa40b415ef5b83e2948a89a3d79c Mon Sep 17 00:00:00 2001 +From: Boris BREZILLON +Date: Sat, 1 Feb 2014 19:10:28 +0100 +Subject: mtd: nand: fix erroneous read_buf call in nand_write_page_raw_syndrome + +From: Boris BREZILLON + +commit 60c3bc1fd6f1fa40b415ef5b83e2948a89a3d79c upstream. + +read_buf is called in place of write_buf in the +nand_write_page_raw_syndrome function. + +Signed-off-by: Boris BREZILLON +Signed-off-by: Brian Norris +Cc: Mason +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mtd/nand/nand_base.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mtd/nand/nand_base.c ++++ b/drivers/mtd/nand/nand_base.c +@@ -2000,7 +2000,7 @@ static int nand_write_page_raw_syndrome( + oob += chip->ecc.prepad; + } + +- chip->read_buf(mtd, oob, eccbytes); ++ chip->write_buf(mtd, oob, eccbytes); + oob += eccbytes; + + if (chip->ecc.postpad) { diff --git a/queue-3.14/series b/queue-3.14/series index 2d0fd620aef..ab353a4ad8f 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -25,3 +25,5 @@ pinctrl-mvebu-armada-370-fix-spi0-pin-description.patch pinctrl-mvebu-armada-xp-remove-non-existing-nand-pins.patch pinctrl-mvebu-armada-xp-remove-non-existing-vdd-cpu_pd-functions.patch pinctrl-mvebu-armada-xp-fix-functions-of-mpp48.patch +mtd-nand-don-t-use-read_buf-for-8-bit-onfi-transfers.patch +mtd-nand-fix-erroneous-read_buf-call-in-nand_write_page_raw_syndrome.patch