Skip to contentSkip to conversation

mtd: nand: brcmnand: Disable prefetch by default

PATCH In review Kamal Dasu 3 participants 5 messages Jan 8, 2018 – Jan 21, 2018

Subsystems (3)
lore
Share & tools
lore

Kamal Dasu

author
#0 lore raw

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

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

Fixes 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller")
---
 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
#2 lore raw
In reply to Kamal Dasu
Quoted 7 lines · Kamal Dasu

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

Fixes 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller")

Boris, is there a reason this is not in your v4.16 pull request? If not, could you take that fix?

Thank you

Signature · 1 line
Florian
#3 lore raw
Quoted 10 lines · On Sat, 20 Jan 2018 15:13:35 -0800 Florian Fainelli <[email protected]>…
Quoted 7 lines · Kamal Dasu

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

Fixes 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller")

Boris, is there a reason this is not in your v4.16 pull request?

Look carefully, it is there ;-).

"
Kamal Dasu (1):
mtd: nand: brcmnand: Disable prefetch by default
"

Quoted 3 lines

If not, could you take that fix?

Thank you

#4 lore raw
Quoted 8 lines · Boris Brezillon
Quoted 5 lines · On Sat, 20 Jan 2018 15:13:35 -0800 Florian Fainelli <[email protected]>…
Quoted 4 lines · Kamal Dasu

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

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Fixes 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller")

Boris, is there a reason this is not in your v4.16 pull request?

Look carefully, it is there ;-).

Indeed, I can't read, my bad.

Signature · 1 line
Florian