提交 993447b7 编写于 作者: M Miquel Raynal 提交者: Boris Brezillon

mtd: rawnand: handle differently chip/controller errors about timings

Usually, the source of the error when setting/getting features does not
matter (if the controller does not support sending the command or if
the chip does not support the operation).

When it comes to timings, if the controller fails it is an error while
if the chip does not support the operation, it can be silently supposed
that it already works with the maximum supported timings.

Introduce some logic in nand_setup_data_interface() to handle that
difference.
Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
上级 97baea1e
...@@ -1272,11 +1272,13 @@ static int nand_setup_data_interface(struct nand_chip *chip, int chipnr) ...@@ -1272,11 +1272,13 @@ static int nand_setup_data_interface(struct nand_chip *chip, int chipnr)
if (!chip->setup_data_interface) if (!chip->setup_data_interface)
return 0; return 0;
/* Change the mode on the chip side */ /* Change the mode on the chip side (if supported by the NAND chip) */
ret = nand_set_features(chip, ONFI_FEATURE_ADDR_TIMING_MODE, if (nand_supports_set_get_features(chip)) {
tmode_param); ret = nand_set_features(chip, ONFI_FEATURE_ADDR_TIMING_MODE,
if (ret) tmode_param);
return ret; if (ret)
return ret;
}
/* Change the mode on the controller side */ /* Change the mode on the controller side */
return chip->setup_data_interface(mtd, chipnr, &chip->data_interface); return chip->setup_data_interface(mtd, chipnr, &chip->data_interface);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册