{"id":278,"url":"http://patchwork.ozlabs.org/api/1.0/patches/278/?format=json","project":{"id":3,"url":"http://patchwork.ozlabs.org/api/1.0/projects/3/?format=json","name":"Linux MTD development","link_name":"linux-mtd","list_id":"linux-mtd.lists.infradead.org","list_email":"linux-mtd@lists.infradead.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<ea2442770809150537p538f5298s9b5b003a1825b09f@mail.gmail.com>","date":"2008-09-15T12:37:29","name":"nand_base.c: reset chip first","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"f929e025d8dccd6def300dc906b2d972fc87ddf1","submitter":{"id":144,"url":"http://patchwork.ozlabs.org/api/1.0/people/144/?format=json","name":"Karl Beldan","email":"karl.beldan@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-mtd/patch/ea2442770809150537p538f5298s9b5b003a1825b09f@mail.gmail.com/mbox/","series":[],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/278/checks/","tags":{},"headers":{"Return-Path":"<linux-mtd-bounces+patchwork=ozlabs.org@lists.infradead.org>","X-Original-To":"patchwork@ozlabs.org","Delivered-To":"patchwork@ozlabs.org","Received":["from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(Client did not present a certificate)\n\tby ozlabs.org (Postfix) with ESMTPS id DF2E6DE66D\n\tfor <patchwork@ozlabs.org>; Mon, 15 Sep 2008 22:37:57 +1000 (EST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux))\n\tid 1KfDKh-0003wc-Ug; Mon, 15 Sep 2008 12:37:35 +0000","from mail-gx0-f12.google.com ([209.85.217.12])\n\tby bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux))\n\tid 1KfDKc-0003vD-EV\n\tfor linux-mtd@lists.infradead.org; Mon, 15 Sep 2008 12:37:30 +0000","by gxk5 with SMTP id 5so23457891gxk.18\n\tfor <linux-mtd@lists.infradead.org>;\n\tMon, 15 Sep 2008 05:37:29 -0700 (PDT)","by 10.100.120.15 with SMTP id s15mr8260536anc.128.1221482249120;\n\tMon, 15 Sep 2008 05:37:29 -0700 (PDT)","by 10.100.142.14 with HTTP; Mon, 15 Sep 2008 05:37:29 -0700 (PDT)"],"Message-ID":"<ea2442770809150537p538f5298s9b5b003a1825b09f@mail.gmail.com>","Date":"Mon, 15 Sep 2008 14:37:29 +0200","From":"\"Karl Beldan\" <karl.beldan@gmail.com>","To":"linux-mtd@lists.infradead.org","Subject":"[PATCH] [MTD] [NAND] nand_base.c: reset chip first","MIME-Version":"1.0","Content-Disposition":"inline","X-Spam-Score":"0.0 (/)","Cc":"David.Woodhouse@intel.com","X-BeenThere":"linux-mtd@lists.infradead.org","X-Mailman-Version":"2.1.9","Precedence":"list","List-Id":"Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-mtd>","List-Post":"<mailto:linux-mtd@lists.infradead.org>","List-Help":"<mailto:linux-mtd-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"linux-mtd-bounces@lists.infradead.org","Errors-To":"linux-mtd-bounces+patchwork=ozlabs.org@lists.infradead.org"},"content":"Some chips require a RESET after power-up (e.g. Micron MT29FxGxxxxx).\nThe first command sent is NAND_CMD_READID.\nIssue a NAND_CMD_RESET in nand_scan_ident before reading the device id.\nTested with an MT29F4G08AAC.\n\nSigned-off-by: Karl Beldan <karl.beldan@gmail.com>","diff":"diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c\nindex d1129ba..2cfac9b 100644\n--- a/drivers/mtd/nand/nand_base.c\n+++ b/drivers/mtd/nand/nand_base.c\n@@ -2318,6 +2318,12 @@ static struct nand_flash_dev\n*nand_get_flash_type(struct mtd_info *mtd,\n \t/* Select the device */\n \tchip->select_chip(mtd, 0);\n\n+\t/*\n+\t * Reset the chip, required by some chips (e.g. Micron MT29FxGxxxxx)\n+\t * after power-up\n+\t */\n+\tchip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1);\n+\n \t/* Send the command for reading device ID */\n \tchip->cmdfunc(mtd, NAND_CMD_READID, 0x00, -1);\n","prefixes":[]}