From patchwork Tue Sep 26 03:39:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 114212 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3354612qgf; Mon, 25 Sep 2017 20:40:45 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDkTNoFfuuD4mHNMsRXdQjnh02igtO+CSkgUxSyc1uKZQQ3X8CYS3IbNP+zIVTppkMkMrfT X-Received: by 10.99.96.10 with SMTP id u10mr9867789pgb.370.1506397245225; Mon, 25 Sep 2017 20:40:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506397245; cv=none; d=google.com; s=arc-20160816; b=jxF7dBOqRcXC6sETL9NIg3GphBKJrC/zBKoyxbKjb0S6aID1yytkREP8RyllHM1/1m 4XJGhtW7smQ4ELeWjtA/k0nuAJHqhv7dMgbZ8nK1uIoWrdn9E2zg2dEYPWMhhWe33RJ4 682t7WJL+CcRGyqycf5DtDd93YyXLNZydpp9LEpu3yIn/Jc1zLDPGgnT5dnUJlm6yK5F tN53V7IIh9ESy8naTxrvApQc+JMcho7LNm6GbXpbdeKqwWP3gdwzHBUyEO8tEahU0Nru cHAEo2U0lE8Wp4l7ebPjiV/0TpGu6ZKJPHNpY8P+rwNBPEJWt7UVwnLSdZuxRl5VFAy/ 9NXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from:dkim-signature :dkim-filter:dkim-signature:arc-authentication-results; bh=AWOoY1+qy2KBOeq+bPZD7Pyx6G801EmLvVN+tf1Um+s=; b=SPDA4G4Qo8Ll4MF6rjkCpCp9KRyZM/UfkA6DLvjwoiBuyBrCdcDZ9v0P9ig0B8uSS5 uSL/JN3VvOWhkJxmvxhVua3uHmrT7hXrVbnEaLW2pxH/g5nPqBf9FCB7RmRsiVIZ6A8F DB/1U6MCWIyW6CUO5QEKoy+IWEZ8trxVpGnZArZni4+fwcAOPrZNJGMZkIwbU3NlIJz0 ze9MEgCLWACvXIXeTDOACexVQf3k9zHLj+dGdQfrxqBIjsGygycuO2xax7rd7aLYjtW2 xPYBHqCYIrxuG67Yug/LVhgolmUBGoQyjF+vVmpeIA5iOZWESMGIiAE/1b3OqHFfehlS waLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=sbSJ65Wh; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=t1P5q+1r; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id r63si5013583pfl.60.2017.09.25.20.40.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Sep 2017 20:40:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=sbSJ65Wh; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=t1P5q+1r; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=AWOoY1+qy2KBOeq+bPZD7Pyx6G801EmLvVN+tf1Um+s=; b=sbS J65WhrNbK83ScMqzv26xj5Gt6wiqkBAVh/XLKk8qokw34mIdqRJhvYJoUGaRmlcXFp/bhRMcBN/MV 69AWUAyViqKT6N8iuwBFV5KQ2ikv0QV26Bk4rfxKDpobXRsOMSNMPLEW7Tx9Fs++S+GpMPpXrcxMj 4mJJNMDQoJLJwS3I7CC+Mf8BMjx/Nx0zCRcFX+XOsjgrNCB+i+dqSQiC8NhMT1Q+iv48x1IIYx4h0 QucfWodKfvEkZISAbIzYArPEhj/WE0RuaNylWj6tLv09h7fEhH1qQzQIsLFyvaG+P8dBrewNxPpmd +l/207Z8YTHDGTO6f+qGpUFNVCVQpVQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dwgjV-0001wA-FO; Tue, 26 Sep 2017 03:40:29 +0000 Received: from conuserg-09.nifty.com ([210.131.2.76]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dwgjR-0000Vc-71 for linux-mtd@lists.infradead.org; Tue, 26 Sep 2017 03:40:27 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id v8Q3dRT8030041; Tue, 26 Sep 2017 12:39:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v8Q3dRT8030041 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1506397168; bh=0NhdL9hIpVq+Dw/eEhZGWvv4Q+L6bMwDrmKC0iELeOU=; h=From:To:Cc:Subject:Date:From; b=t1P5q+1r673/QGSeRDBEbcAMivAfwb4VY8/pbEPFm51Jfnxw8L+r/GZtO/lLJ3tUV tkDZGQgZoQxFwplulljE9lCcQZmzQDZ3juzrh0BBxvWHdExFN16+jj1TSzebM1JnW2 cUWzn+iOex4/mEKlkCYb7VPPAP7As3MeE+B04FJBpmBpwgQtdh/lxEqO+fLilyeHOr yo9T2tH/0A/dGcZs/6oWD5ogPC6KilpLXexypysfHfrHn/Yyal3d70AMYgiNAOy+rG d1E0EdGN7h3QQfQ5kbiMB2BbnDafMECVCPeKTTnrmwC2OQJAud+AXaxmWNwtkbHH9Z SSitLqK6qGw3g== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [PATCH] mtd: nand: wait for tWHR after NAND_CMD_STATUS / NAND_CMD_READID Date: Tue, 26 Sep 2017 12:39:24 +0900 Message-Id: <1506397164-3648-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170925_204025_763340_4AEFEADC X-CRM114-Status: UNSURE ( 7.88 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , Marek Vasut , Richard Weinberger , linux-kernel@vger.kernel.org, Masahiro Yamada , Cyrille Pitchen , Brian Norris , David Woodhouse MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org Read Status and Read ID require tWHR before reading the first data. Insert a very short wait to make sure to meet the spec. I have not seen any problem report for now, but nand_command() and nand_command_lP() are generic hooks, so it makes sense to implement fail-safe code here. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/nand_base.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index b1cf32c..55c0ba5 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -742,9 +742,12 @@ static void nand_command(struct mtd_info *mtd, unsigned int command, case NAND_CMD_ERASE1: case NAND_CMD_ERASE2: case NAND_CMD_SEQIN: + case NAND_CMD_SET_FEATURES: + return; + case NAND_CMD_STATUS: case NAND_CMD_READID: - case NAND_CMD_SET_FEATURES: + ndelay(200); /* tWHR */ return; case NAND_CMD_RESET: @@ -871,9 +874,12 @@ static void nand_command_lp(struct mtd_info *mtd, unsigned int command, case NAND_CMD_ERASE1: case NAND_CMD_ERASE2: case NAND_CMD_SEQIN: + case NAND_CMD_SET_FEATURES: + return; + case NAND_CMD_STATUS: case NAND_CMD_READID: - case NAND_CMD_SET_FEATURES: + ndelay(200); /* tWHR */ return; case NAND_CMD_RNDIN: