Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a11bf5ed authored by Boris Brezillon's avatar Boris Brezillon
Browse files

mtd: nand: Fix timing setup for NANDs that do not support SET FEATURES



Some ONFI NANDs do not support the SET/GET FEATURES commands, which,
according to the spec, is perfectly valid.

On these NANDs we can't set a specific timing mode using the "timing
mode" feature, and we should assume the NAND does not require any setup
to enter a specific timing mode.

Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Fixes: d8e725dd ("mtd: nand: automate NAND timings selection")
Reported-by: default avatarAlexander Dahl <ada@thorsis.com>
Cc: <stable@vger.kernel.org>
Tested-by: default avatarAlexander Dahl <ada@thorsis.com>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent cb25fae1
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1131,7 +1131,9 @@ static int nand_setup_data_interface(struct nand_chip *chip, int chipnr)
	 * Ensure the timing mode has been changed on the chip side
	 * before changing timings on the controller side.
	 */
	if (chip->onfi_version) {
	if (chip->onfi_version &&
	    (le16_to_cpu(chip->onfi_params.opt_cmd) &
	     ONFI_OPT_CMD_SET_GET_FEATURES)) {
		u8 tmode_param[ONFI_SUBFEATURE_PARAM_LEN] = {
			chip->onfi_timing_mode_default,
		};