[PATCH] mtd: rawnand: Skip timing mode readback check for GigaDevice NAND

From: Teng Wu

Date: Tue Nov 24 2026 - 08:06:58 EST


GigaDevice raw NAND chips (manufacturer ID 0xC8) support the timing
modes advertised in their ONFI parameter page, so there is no need to
verify or enforce the timing mode switch on them. The supported set
depends on the supply voltage: 3.3V parts (e.g. GD9FU2G8F3A, DID DAh)
report modes 0-5 (3Fh in byte 129-130 of the parameter page), while
1.8V parts (e.g. GD9FS2G8F3A, DID AAh) report modes 0-4 (1Fh). The
highest supported mode is already picked automatically from the
parameter page by nand_choose_best_sdr_timings(), so the only thing
getting in the way is the readback check.

The GET_FEATURE timing mode readback on these chips does not reflect
the mode selected through SET_FEATURE. The strict check in
nand_setup_interface() therefore misdetects the chip as not
acknowledging the requested timing mode, printing "timing mode N not
acknowledged by the NAND chip" and falling back to a slower mode for
no reason.

Skip the readback check for GigaDevice chips while keeping it for all
other vendors, and go straight to updating the interface
configuration.

Signed-off-by: Teng Wu <gigadevice2025@xxxxxxxxx>
---
drivers/mtd/nand/raw/nand_base.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index a225b10f8145..8d77ebac4939 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -890,6 +890,15 @@ static int nand_setup_interface(struct nand_chip *chip, int chipnr)
goto err_reset_chip;

if (request != tmode_param[0]) {
+ /*
+ * GigaDevice raw NAND chips (manufacturer ID 0xC8) support
+ * the timing modes advertised in their ONFI parameter page.
+ * Skip the strict ack check; keep it for other vendors.
+ */
+ if (chip->id.data[0] == 0xC8) {
+ goto update_interface_config;
+ }
+
pr_warn("%s timing mode %d not acknowledged by the NAND chip\n",
nand_interface_is_nvddr(chip->best_interface_config) ? "NV-DDR" : "SDR",
chip->best_interface_config->timings.mode);
--
2.43.0