Skip to contentSkip to conversation

mtd: brcmnand: Disable prefetch by default

PATCH Superseded Kamal Dasu 2 participants 2 messages Jan 2, 2018 – Jan 6, 2018

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Kamal Dasu

author
#0 lore raw

PATCH 1/1 mtd: brcmnand: Disable prefetch by default

Brcm nand controller prefetch feature needs to be disabled by default. Enabling effects performance on random reads as well as dma reads.

---
 drivers/mtd/nand/brcmnand/brcmnand.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
drivers/mtd/nand/brcmnand/brcmnand.c +3 -10
index dd56a67..2a978d9 100644
@@ -2193,16 +2193,9 @@ static int brcmnand_setup_dev(struct brcmnand_host *host)
 	if (ctrl->nand_version >= 0x0702)
 		tmp |= ACC_CONTROL_RD_ERASED;
 	tmp &= ~ACC_CONTROL_FAST_PGM_RDIN;
-	if (ctrl->features & BRCMNAND_HAS_PREFETCH) {
-		/*
-		 * FIXME: Flash DMA + prefetch may see spurious erased-page ECC
-		 * errors
-		 */
-		if (has_flash_dma(ctrl))
-			tmp &= ~ACC_CONTROL_PREFETCH;
-		else
-			tmp |= ACC_CONTROL_PREFETCH;
-	}
+	if (ctrl->features & BRCMNAND_HAS_PREFETCH)
+		tmp &= ~ACC_CONTROL_PREFETCH;
+
 	nand_writereg(ctrl, offs, tmp);
 
 	return 0;
Signature · 1 line
2.7.4
#1 lore raw

Hi Kamal,

The prefix should be "mtd: nand: brcmnand: ".

Quoted 2 lines · On Tue, 2 Jan 2018 15:14:57 -0500 Kamal Dasu <[email protected]> wrote:

Brcm nand controller prefetch feature needs to be disabled by default. Enabling effects performance on random reads as

^ affects ?

Quoted 3 lines

well as dma reads.

Maybe Fixes and CC-stable tags would be relevant here, unless you don't consider this patch as a fix and don't want to backport it to stable kernels.

Quoted 28 lines
---
 drivers/mtd/nand/brcmnand/brcmnand.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
drivers/mtd/nand/brcmnand/brcmnand.c +3 -10
index dd56a67..2a978d9 100644
@@ -2193,16 +2193,9 @@ static int brcmnand_setup_dev(struct brcmnand_host *host)
 	if (ctrl->nand_version >= 0x0702)
 		tmp |= ACC_CONTROL_RD_ERASED;
 	tmp &= ~ACC_CONTROL_FAST_PGM_RDIN;
-	if (ctrl->features & BRCMNAND_HAS_PREFETCH) {
-		/*
-		 * FIXME: Flash DMA + prefetch may see spurious erased-page ECC
-		 * errors
-		 */
-		if (has_flash_dma(ctrl))
-			tmp &= ~ACC_CONTROL_PREFETCH;
-		else
-			tmp |= ACC_CONTROL_PREFETCH;
-	}
+	if (ctrl->features & BRCMNAND_HAS_PREFETCH)
+		tmp &= ~ACC_CONTROL_PREFETCH;
+
 	nand_writereg(ctrl, offs, tmp);
 
 	return 0;