Skip to contentSkip to conversation

mtd: nand: raw: atmel: Fix comment in timings preparation

PATCH Applied Alexander Dahl 3 participants 3 messages Feb 26, 2024 – Mar 7, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: nand: raw: atmel: Fix comment in timings preparation

Looks like a copy'n'paste mistake introduced when initially adding the dynamic timings feature with commit f9ce2eddf176 ("mtd: nand: atmel: Add ->setup_data_interface() hooks"). The context around this and especially the code itself suggests 'read' is meant instead of write.

---
 drivers/mtd/nand/raw/atmel/nand-controller.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/atmel/nand-controller.c +1 -1
index 4cb478bbee4a..dc75d50d52e8 100644
@@ -1370,23 +1370,23 @@ static int atmel_smc_nand_prepare_smcconf(struct atmel_nand *nand,
 	 *
 	 * NRD_PULSE = tRP
 	 */
 	ncycles = DIV_ROUND_UP(conf->timings.sdr.tRP_min, mckperiodps);
 	totalcycles += ncycles;
 	ret = atmel_smc_cs_conf_set_pulse(smcconf, ATMEL_SMC_NRD_SHIFT,
 					  ncycles);
 	if (ret)
 		return ret;
 
 	/*
-	 * The write cycle timing is directly matching tWC, but is also
+	 * The read cycle timing is directly matching tRC, but is also
 	 * dependent on the setup and hold timings we calculated earlier,
 	 * which gives:
 	 *
 	 * NRD_CYCLE = max(tRC, NRD_PULSE + NRD_HOLD)
 	 *
 	 * NRD_SETUP is always 0.
 	 */
 	ncycles = DIV_ROUND_UP(conf->timings.sdr.tRC_min, mckperiodps);
 	ncycles = max(totalcycles, ncycles);
 	ret = atmel_smc_cs_conf_set_cycle(smcconf, ATMEL_SMC_NRD_SHIFT,
 					  ncycles);

base-commit: d206a76d7d2726f3b096037f2079ce0bd3ba329b

Signature · 6 lines
2.39.2


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Alexander Dahl

Looks like a copy'n'paste mistake introduced when initially adding the dynamic timings feature with commit f9ce2eddf176 ("mtd: nand: atmel: Add ->setup_data_interface() hooks"). The context around this and especially the code itself suggests 'read' is meant instead of write.

Looks indeed valid:

Thanks Alexander. Best regards,
Nicolas

Quoted 38 lines
---
  drivers/mtd/nand/raw/atmel/nand-controller.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/atmel/nand-controller.c +1 -1
index 4cb478bbee4a..dc75d50d52e8 100644
@@ -1370,23 +1370,23 @@ static int atmel_smc_nand_prepare_smcconf(struct atmel_nand *nand,
          *
          * NRD_PULSE = tRP
          */
         ncycles = DIV_ROUND_UP(conf->timings.sdr.tRP_min, mckperiodps);
         totalcycles += ncycles;
         ret = atmel_smc_cs_conf_set_pulse(smcconf, ATMEL_SMC_NRD_SHIFT,
                                           ncycles);
         if (ret)
                 return ret;
 
         /*
-        * The write cycle timing is directly matching tWC, but is also
+        * The read cycle timing is directly matching tRC, but is also
          * dependent on the setup and hold timings we calculated earlier,
          * which gives:
          *
          * NRD_CYCLE = max(tRC, NRD_PULSE + NRD_HOLD)
          *
          * NRD_SETUP is always 0.
          */
         ncycles = DIV_ROUND_UP(conf->timings.sdr.tRC_min, mckperiodps);
         ncycles = max(totalcycles, ncycles);
         ret = atmel_smc_cs_conf_set_cycle(smcconf, ATMEL_SMC_NRD_SHIFT,
                                           ncycles);

base-commit: d206a76d7d2726f3b096037f2079ce0bd3ba329b --
2.39.2

maintainer Applied
#2 lore raw
In reply to Alexander Dahl
Quoted 7 lines · Alexander Dahl

Looks like a copy'n'paste mistake introduced when initially adding the dynamic timings feature with commit f9ce2eddf176 ("mtd: nand: atmel: Add ->setup_data_interface() hooks"). The context around this and especially the code itself suggests 'read' is meant instead of write.

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

Miquel