Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2807405imm; Fri, 24 Aug 2018 05:50:22 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb1vk3mqVj3OYb8JhhDAH6CNa0va8+fKP83fZ3hyhz9JlB/Etq+mcwziXP9rJzlA22aAxIL X-Received: by 2002:a63:ed07:: with SMTP id d7-v6mr1603483pgi.429.1535115022452; Fri, 24 Aug 2018 05:50:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535115022; cv=none; d=google.com; s=arc-20160816; b=WhseD/1scZjT/KTr+Gs7OoQb8XpjtaYSOFaO5Kl8DV4JgpsblwYPtJMrroevLKZpEc FMzqxCQLw1V0qkkJqu0GKCreARGUyYZg6k53YzcT4qBk97Fcj7Tof/JBQhxYu8OJzgMJ gOWc3lqyg4cEVi5vKF6Onz2yyTOPrLkLZQiKG9B8C6QxmWLq3y+nYu4ofqwGvO6kqbVC ouyqPTx2+GDPc+rS7Cg8+q2BiJ7tumCoBPwZd2YYRIswEJi69Asg2FlpC2JM+MaK/pc4 hRb6gh+aKZVihqW/VX0vbxaYjs5hjfxrcscIsStHxOfeO+XytpcR/Dztp1H8ywkxEanA wabA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=gXBelp5+04hwYPcPaHX1PgdrZ55ZsAWQZZzGVxvbnx8=; b=I8YV6+v9p+SatET6i3Tg3koaFjw9FCeqkV7i6poE/vUFHgoucM4lWftdmFQvs0pcdL SPwfWfD5njI8VTzaUHPx45SXWm7k++Wf7XwgtUsqzY5gGiIyezAAh1rqPwWHhkY6ELZp lfl3R1Il596NWOUcWa1aPX+H8NYkPwIHeQjaQ+Oql9c9mCJINRncp2BpsPbdBsteJQii n2AJzF4n+z+rDYhhluPQlHvjdpoBvR4ejQYq6htqLblxadiUYPmoZ5tD7GLEPyIoXHaK 1b/FB6iwlm3rwArRaGWZsyaF2i9bwgVC6dqZJceebzOGxL7BxuqoDlRf+pkpURdvSFSp fUvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l18-v6si7737309pfk.78.2018.08.24.05.50.07; Fri, 24 Aug 2018 05:50:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727585AbeHXQWy (ORCPT + 99 others); Fri, 24 Aug 2018 12:22:54 -0400 Received: from mail.bootlin.com ([62.4.15.54]:47885 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726268AbeHXQWx (ORCPT ); Fri, 24 Aug 2018 12:22:53 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 13E7A20728; Fri, 24 Aug 2018 14:48:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (AAubervilliers-681-1-53-19.w90-88.abo.wanadoo.fr [90.88.170.19]) by mail.bootlin.com (Postfix) with ESMTPSA id A0AEE207B1; Fri, 24 Aug 2018 14:48:11 +0200 (CEST) Date: Fri, 24 Aug 2018 14:48:10 +0200 From: Boris Brezillon To: Liang Yang Cc: Yixun Lan , , Rob Herring , Neil Armstrong , Martin Blumenstingl , Richard Weinberger , , Marek Vasut , Jian Hu , Kevin Hilman , Carlo Caione , , Brian Norris , David Woodhouse , , Jerome Brunet Subject: Re: [RFC PATCH v2 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller Message-ID: <20180824144810.31c929a5@bbrezillon> In-Reply-To: <96e538a5-1232-11f2-8b9e-5ddb09dcc2de@amlogic.com> References: <20180719094612.5833-1-yixun.lan@amlogic.com> <20180719094612.5833-3-yixun.lan@amlogic.com> <20180801235045.5b4d8211@bbrezillon> <42877a0d-9830-0626-3f64-e49a326eaa3c@amlogic.com> <20180817155608.5929b37a@bbrezillon> <96e538a5-1232-11f2-8b9e-5ddb09dcc2de@amlogic.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 22 Aug 2018 22:08:42 +0800 Liang Yang wrote: > > You have to wait tWB, that's for sure. > > > we have a maximum 32 commands fifo. when command is written into > NFC_REG_CMD, it doesn't mean that command is executing right now, maybe > it is buffering on the queue.Assume one ERASE operation, when 2nd > command(0xd0) is written into NFC_REG_CMD and then come into > NAND_OP_WAITRDY_INSTR, if I read the RB status by register, it may be > wrong because 0xd0 may not being executed. it is unusual unless > buffering two many command. You should flush the queue and wait for it to empty at the end of ->exec_op(). > so it seems that i still need to use nand_soft_waitrdy or wait cmd is > executed somewhere. Don't you have a WAIT_FOR_RB instruction? What is NFC_CMD_RB for? Also, NFC_CMD_IDLE seems to allow you to add an arbitrary delay, and that's probably what you should use for tWB.