From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FD9AC433FE for ; Mon, 13 Dec 2021 09:50:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235653AbhLMJu0 (ORCPT ); Mon, 13 Dec 2021 04:50:26 -0500 Received: from sin.source.kernel.org ([145.40.73.55]:38634 "EHLO sin.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236096AbhLMJqD (ORCPT ); Mon, 13 Dec 2021 04:46:03 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 6D467CE0AE2; Mon, 13 Dec 2021 09:46:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1923DC341C5; Mon, 13 Dec 2021 09:45:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1639388758; bh=agXYGWcwPEAsrO1o53XHEHFx2axEpc30MbfPaN2kDjM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EWsBzAm27Z6nAHDMin7EGtRzO1s4HGt61kXmSShBctLCQjp7ga+1ZhzKLst6xVI3f boz5dK3bikWbAhGC7c2OkADMXeSwD4n9zYB2iPjTxY40sAF0DC1lKz3n82Tfle6vyA Q8ss0fgq1WqL07zj+7SsQvhxcfX/tGc/GGclN0tE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Herve Codina , Miquel Raynal Subject: [PATCH 5.4 54/88] mtd: rawnand: fsmc: Take instruction delay into account Date: Mon, 13 Dec 2021 10:30:24 +0100 Message-Id: <20211213092935.130636806@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211213092933.250314515@linuxfoundation.org> References: <20211213092933.250314515@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Herve Codina commit a4ca0c439f2d5ce9a3dc118d882f9f03449864c8 upstream. 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. Add this waiting delay in the FSMC NAND controller driver. Fixes: 4da712e70294 ("mtd: nand: fsmc: use ->exec_op()") Signed-off-by: Herve Codina Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211119150316.43080-4-herve.codina@bootlin.com Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/raw/fsmc_nand.c | 4 ++++ 1 file changed, 4 insertions(+) --- 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 @@ -650,6 +651,9 @@ static int fsmc_exec_op(struct nand_chip instr->ctx.waitrdy.timeout_ms); break; } + + if (instr->delay_ns) + ndelay(instr->delay_ns); } return ret;