[v3,2/2] mtd: rawnand: marvell: don't set the NAND frequency select

Message ID 20230525003154.2303012-2-chris.packham@alliedtelesis.co.nz
State New
Headers
Series [v3,1/2] mtd: rawnand: marvell: ensure timing values are written |

Commit Message

Chris Packham May 25, 2023, 12:31 a.m. UTC
  marvell_nfc_setup_interface() uses the frequency retrieved from the
clock associated with the nand interface to determine the timings that
will be used. By changing the NAND frequency select without reflecting
this in the clock configuration this means that the timings calculated
don't correctly meet the requirements of the NAND chip. This hasn't been
an issue up to now because of a different bug that was stopping the
timings being updated after they were initially set.

Fixes: b25251414f6e ("mtd: rawnand: marvell: Stop implementing ->select_chip()")
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---

Notes:
    I've set the fixes tag to b25251414f6e. The problem probably existed
    prior to that but without the other fix in this series it wouldn't be
    noticeable.
    
    With the two fixes from this series in place I get a tWC of 32ns which
    seems just about ideal.
    
    Changes in v3:
    - new

 drivers/mtd/nand/raw/marvell_nand.c | 4 ----
 1 file changed, 4 deletions(-)
  

Comments

Miquel Raynal May 26, 2023, 6:02 p.m. UTC | #1
On Thu, 2023-05-25 at 00:31:53 UTC, Chris Packham wrote:
> marvell_nfc_setup_interface() uses the frequency retrieved from the
> clock associated with the nand interface to determine the timings that
> will be used. By changing the NAND frequency select without reflecting
> this in the clock configuration this means that the timings calculated
> don't correctly meet the requirements of the NAND chip. This hasn't been
> an issue up to now because of a different bug that was stopping the
> timings being updated after they were initially set.
> 
> Fixes: b25251414f6e ("mtd: rawnand: marvell: Stop implementing ->select_chip()")
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/fixes, thanks.

Miquel
  

Patch

diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
index f1fcf136ad03..30c15e4e1cc0 100644
--- a/drivers/mtd/nand/raw/marvell_nand.c
+++ b/drivers/mtd/nand/raw/marvell_nand.c
@@ -2900,10 +2900,6 @@  static int marvell_nfc_init(struct marvell_nfc *nfc)
 		regmap_update_bits(sysctrl_base, GENCONF_CLK_GATING_CTRL,
 				   GENCONF_CLK_GATING_CTRL_ND_GATE,
 				   GENCONF_CLK_GATING_CTRL_ND_GATE);
-
-		regmap_update_bits(sysctrl_base, GENCONF_ND_CLK_CTRL,
-				   GENCONF_ND_CLK_CTRL_EN,
-				   GENCONF_ND_CLK_CTRL_EN);
 	}
 
 	/* Configure the DMA if appropriate */