Merge tag 'mtd/for-4.18' of git://git.infradead.org/linux-mtd
[muen/linux.git] / drivers / mtd / nand / raw / nand_base.c
index 327c60b06f87c8f2c9292bce538bd7599ea32d6e..10c4f9919850c3e7b56ed6bdb083a0fc35a0b7f5 100644 (file)
@@ -706,12 +706,17 @@ static void nand_wait_status_ready(struct mtd_info *mtd, unsigned long timeo)
  */
 int nand_soft_waitrdy(struct nand_chip *chip, unsigned long timeout_ms)
 {
+       const struct nand_sdr_timings *timings;
        u8 status = 0;
        int ret;
 
        if (!chip->exec_op)
                return -ENOTSUPP;
 
+       /* Wait tWB before polling the STATUS reg. */
+       timings = nand_get_sdr_timings(&chip->data_interface);
+       ndelay(PSEC_TO_NSEC(timings->tWB_max));
+
        ret = nand_status_op(chip, NULL);
        if (ret)
                return ret;