Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1731099

[PATCH 4.9 02/14] mtd: nand: qcom: fix read failure without complete bootchain

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.9 02/14] mtd: nand: qcom: fix read failure without complete bootchain
Date 2017-09-12 19:20 +0200
Message-ID <uoX0V-48V-49@gated-at.bofh.it> (permalink)
References <uoWHv-3KO-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Abhishek Sahu <absahu@codeaurora.org>

commit d8a9b320a26c1ea28e51e4f3ecfb593d5aac2910 upstream.

The NAND page read fails without complete boot chain since
NAND_DEV_CMD_VLD value is not proper. The default power on reset
value for this register is

    0xe - ERASE_START_VALID | WRITE_START_VALID | READ_STOP_VALID

The READ_START_VALID should be enabled for sending PAGE_READ
command. READ_STOP_VALID should be cleared since normal NAND
page read does not require READ_STOP command.

Fixes: c76b78d8ec05a ("mtd: nand: Qualcomm NAND controller driver")
Reviewed-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mtd/nand/qcom_nandc.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

--- a/drivers/mtd/nand/qcom_nandc.c
+++ b/drivers/mtd/nand/qcom_nandc.c
@@ -109,7 +109,11 @@
 #define	READ_ADDR			0
 
 /* NAND_DEV_CMD_VLD bits */
-#define	READ_START_VLD			0
+#define	READ_START_VLD			BIT(0)
+#define	READ_STOP_VLD			BIT(1)
+#define	WRITE_START_VLD			BIT(2)
+#define	ERASE_START_VLD			BIT(3)
+#define	SEQ_READ_START_VLD		BIT(4)
 
 /* NAND_EBI2_ECC_BUF_CFG bits */
 #define	NUM_STEPS			0
@@ -148,6 +152,10 @@
 #define	FETCH_ID			0xb
 #define	RESET_DEVICE			0xd
 
+/* Default Value for NAND_DEV_CMD_VLD */
+#define NAND_DEV_CMD_VLD_VAL		(READ_START_VLD | WRITE_START_VLD | \
+					 ERASE_START_VLD | SEQ_READ_START_VLD)
+
 /*
  * the NAND controller performs reads/writes with ECC in 516 byte chunks.
  * the driver calls the chunks 'step' or 'codeword' interchangeably
@@ -672,8 +680,7 @@ static int nandc_param(struct qcom_nand_
 
 	/* configure CMD1 and VLD for ONFI param probing */
 	nandc_set_reg(nandc, NAND_DEV_CMD_VLD,
-		      (nandc->vld & ~(1 << READ_START_VLD))
-		      | 0 << READ_START_VLD);
+		      (nandc->vld & ~READ_START_VLD));
 	nandc_set_reg(nandc, NAND_DEV_CMD1,
 		      (nandc->cmd1 & ~(0xFF << READ_ADDR))
 		      | NAND_CMD_PARAM << READ_ADDR);
@@ -1972,13 +1979,14 @@ static int qcom_nandc_setup(struct qcom_
 {
 	/* kill onenand */
 	nandc_write(nandc, SFLASHC_BURST_CFG, 0);
+	nandc_write(nandc, NAND_DEV_CMD_VLD, NAND_DEV_CMD_VLD_VAL);
 
 	/* enable ADM DMA */
 	nandc_write(nandc, NAND_FLASH_CHIP_SELECT, DM_EN);
 
 	/* save the original values of these registers */
 	nandc->cmd1 = nandc_read(nandc, NAND_DEV_CMD1);
-	nandc->vld = nandc_read(nandc, NAND_DEV_CMD_VLD);
+	nandc->vld = NAND_DEV_CMD_VLD_VAL;
 
 	return 0;
 }

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.9 00/14] 4.9.50-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-12 19:20 +0200
  [PATCH 4.9 10/14] Bluetooth: Properly check L2CAP config option output buffer length Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-12 19:20 +0200
  [PATCH 4.9 02/14] mtd: nand: qcom: fix read failure without complete bootchain Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-12 19:20 +0200
  [PATCH 4.9 14/14] NFS: Sync the correct byte range during synchronous writes Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-12 19:20 +0200
  Re: [PATCH 4.9 00/14] 4.9.50-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-09-13 02:20 +0200
  Re: [PATCH 4.9 00/14] 4.9.50-stable review Tom Gall <tom.gall@linaro.org> - 2017-09-13 04:30 +0200
    Re: [PATCH 4.9 00/14] 4.9.50-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-13 05:50 +0200
      Re: [PATCH 4.9 00/14] 4.9.50-stable review Tom Gall <tom.gall@linaro.org> - 2017-09-13 17:10 +0200
        Re: [PATCH 4.9 00/14] 4.9.50-stable review Guenter Roeck <linux@roeck-us.net> - 2017-09-13 17:30 +0200
          Re: [PATCH 4.9 00/14] 4.9.50-stable review Mark Brown <broonie@kernel.org> - 2017-09-13 19:10 +0200
            Re: [PATCH 4.9 00/14] 4.9.50-stable review Guenter Roeck <linux@roeck-us.net> - 2017-09-13 20:40 +0200
              Re: [PATCH 4.9 00/14] 4.9.50-stable review Mark Brown <broonie@kernel.org> - 2017-09-13 21:00 +0200
            Re: [PATCH 4.9 00/14] 4.9.50-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-13 21:00 +0200
              Re: [PATCH 4.9 00/14] 4.9.50-stable review Guenter Roeck <linux@roeck-us.net> - 2017-09-13 21:20 +0200
                Re: [PATCH 4.9 00/14] 4.9.50-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-13 23:40 +0200
                Re: [PATCH 4.9 00/14] 4.9.50-stable review Mark Brown <broonie@kernel.org> - 2017-09-14 00:10 +0200
                Re: [PATCH 4.9 00/14] 4.9.50-stable review Willy Tarreau <w@1wt.eu> - 2017-09-14 04:20 +0200
                Re: [PATCH 4.9 00/14] 4.9.50-stable review Guenter Roeck <linux@roeck-us.net> - 2017-09-14 07:40 +0200
                Re: [PATCH 4.9 00/14] 4.9.50-stable review Kevin Hilman <khilman@baylibre.com> - 2017-09-15 01:00 +0200
              Re: [PATCH 4.9 00/14] 4.9.50-stable review Mark Brown <broonie@kernel.org> - 2017-09-13 21:20 +0200
  Re: [PATCH 4.9 00/14] 4.9.50-stable review Guenter Roeck <linux@roeck-us.net> - 2017-09-13 16:40 +0200

csiph-web