Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 536E4C433F5 for ; Fri, 12 Nov 2021 14:39:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3EF0660F39 for ; Fri, 12 Nov 2021 14:39:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235264AbhKLOm1 (ORCPT ); Fri, 12 Nov 2021 09:42:27 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:46075 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235228AbhKLOmZ (ORCPT ); Fri, 12 Nov 2021 09:42:25 -0500 Received: (Authenticated sender: herve.codina@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPA id 7EC804000F; Fri, 12 Nov 2021 14:39:33 +0000 (UTC) From: Herve Codina To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Herve Codina , Thomas Petazzoni Subject: [PATCH 3/4] mtd: rawnand: fsmc: Take instruction delay into account Date: Fri, 12 Nov 2021 15:38:54 +0100 Message-Id: <20211112143855.2678989-4-herve.codina@bootlin.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211112143855.2678989-1-herve.codina@bootlin.com> References: <20211112143855.2678989-1-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The FSMC nand controller should apply a delay after the instruction has been issued on the bus. The FSMC nand controller driver did not handle this delay. This patch adds this waiting delay in the FSMC nand controller driver. Signed-off-by: Herve Codina --- drivers/mtd/nand/raw/fsmc_nand.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mtd/nand/raw/fsmc_nand.c b/drivers/mtd/nand/raw/fsmc_nand.c index 7f057cfee6c4..bff09219ce3a 100644 --- a/drivers/mtd/nand/raw/fsmc_nand.c +++ b/drivers/mtd/nand/raw/fsmc_nand.c @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -667,6 +668,9 @@ static int fsmc_exec_op(struct nand_chip *chip, const struct nand_operation *op, instr->ctx.waitrdy.timeout_ms); break; } + + if (instr->delay_ns) + ndelay(instr->delay_ns); } return ret; -- 2.31.1