From patchwork Wed Apr 18 10:20:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Hecht X-Patchwork-Id: 153465 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A34E9B70A2 for ; Wed, 18 Apr 2012 20:21:37 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SKRzp-0006h0-MN; Wed, 18 Apr 2012 10:20:21 +0000 Received: from mail-wg0-f41.google.com ([74.125.82.41]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SKRzg-0006bG-Tq for linux-mtd@lists.infradead.org; Wed, 18 Apr 2012 10:20:17 +0000 Received: by wgbds1 with SMTP id ds1so423951wgb.0 for ; Wed, 18 Apr 2012 03:20:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=XybOEhoSruV7In5YZgxqw2qZIuznCeDA1RWWMn0Ycik=; b=PMPYLPITA5m6Gsc9EPYBwFwDHXLYtkq1VXWwaScmDDfWvZ9k3RGmGWELizF83VR/rb mq0X6lqg62qwX2HKFjNAA9aij3LVr0nR0t6+9/Oy3HcwDu4JN2GNCsKAd/axnCaIxYkH Z1dz+nt9FM1kFEYtBiAzhwG+1VxpjidnfIA5PNZoM3HQj1/mJOEsdrfWlvF/8rVZLlte uV3HmdRFWWZ3TYwipfMp/azK64V2o10DQSePueACffMe41TczZELTW+dnQB50aH/c3OG /twvWrx9Yr3Rg3ujvm5Mg/7v2suOZ0bwdQL4F0gSmAKQUP7K1a8Tc+fE/Yxvj9zGYJoW CGTA== Received: by 10.216.205.35 with SMTP id i35mr1170243weo.17.1334744410896; Wed, 18 Apr 2012 03:20:10 -0700 (PDT) Received: from localhost.localdomain ([176.74.57.22]) by mx.google.com with ESMTPS id fl2sm53844759wib.2.2012.04.18.03.20.09 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 Apr 2012 03:20:10 -0700 (PDT) From: Bastian Hecht To: linux-mtd@lists.infradead.org Subject: [RFC] mtd: nand: Add a STATUS CMD after write verification Date: Wed, 18 Apr 2012 12:20:04 +0200 Message-Id: <1334744404-721-1-git-send-email-hechtb@gmail.com> X-Mailer: git-send-email 1.7.5.4 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (hechtb[at]googlemail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.41 listed in list.dnswl.org] Cc: Bastian Hecht X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org When using CONFIG_MTD_NAND_VERIFY_WRITE=y an extra read command is sent to the NAND chip after writing a page. We need an extra status command to avoid hick-ups that lead to page write failures. --- Hello all, I'm experiencing problems with my current setup and CONFIG_MTD_NAND_VERIFY_WRITE=y. Usually the command sequence is like 0x70 Status read 0x80 0x10 Page prog 0x70 0x80 0x10 Page prog 0x70 ... When activating write verification there is a read command before the page prog. 0x80 0x10 0x70 0x0 read 0x80 0x10 0x70 ... This makes my chip write garbage, while the patch fixes it. Now I wonder if this problem is caused by my NAND chip only, or if this is a general problem that should be adressed. --- drivers/mtd/nand/nand_base.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 8a393f9..62d6691 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -2101,6 +2101,8 @@ static int nand_write_page(struct mtd_info *mtd, struct nand_chip *chip, if (chip->verify_buf(mtd, buf, mtd->writesize)) return -EIO; + + chip->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1); #endif return 0; }