public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: pl353: make sure optimal timings are applied
@ 2026-03-04 21:18 Olivier Sobrie
  2026-03-16  8:46 ` Miquel Raynal
  0 siblings, 1 reply; 5+ messages in thread
From: Olivier Sobrie @ 2026-03-04 21:18 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Michal Simek, Richard Weinberger, Vignesh Raghavendra, linux-mtd,
	linux-kernel

Timings of the nand are adjusted by pl35x_nfc_setup_interface() but
actually applied by the pl35x_nand_select_target() function.
If there is only one nand chip, the pl35x_nand_select_target() will only
apply the timings once since the test at its beginning will always be true
after the first call to this function. As a result, the hardware will
keep using the default timings set at boot to detect the nand chip, not
the optimal ones.

With this patch, we program directly the new timings when
pl35x_nfc_setup_interface() is called.

Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
---
 drivers/mtd/nand/raw/pl35x-nand-controller.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mtd/nand/raw/pl35x-nand-controller.c b/drivers/mtd/nand/raw/pl35x-nand-controller.c
index 947fd86ac5fa..f2c65eb7a8d9 100644
--- a/drivers/mtd/nand/raw/pl35x-nand-controller.c
+++ b/drivers/mtd/nand/raw/pl35x-nand-controller.c
@@ -862,6 +862,9 @@ static int pl35x_nfc_setup_interface(struct nand_chip *chip, int cs,
 			  PL35X_SMC_NAND_TAR_CYCLES(tmgs.t_ar) |
 			  PL35X_SMC_NAND_TRR_CYCLES(tmgs.t_rr);
 
+	writel(plnand->timings, nfc->conf_regs + PL35X_SMC_CYCLES);
+	pl35x_smc_update_regs(nfc);
+
 	return 0;
 }
 
-- 
2.53.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-19 11:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-04 21:18 [PATCH] mtd: rawnand: pl353: make sure optimal timings are applied Olivier Sobrie
2026-03-16  8:46 ` Miquel Raynal
2026-03-17  7:05   ` Olivier Sobrie
2026-03-17  8:57     ` Miquel Raynal
2026-03-19 11:35   ` Andrea Scian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox