From patchwork Sat Apr 28 01:29:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 155616 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 B3A1EB6FD3 for ; Sat, 28 Apr 2012 11:34:53 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SNwX7-0003ET-UV; Sat, 28 Apr 2012 01:33:10 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SNwX2-00038V-QH for linux-mtd@lists.infradead.org; Sat, 28 Apr 2012 01:33:05 +0000 Received: by mail-pb0-f49.google.com with SMTP id rq13so1739571pbb.36 for ; Fri, 27 Apr 2012 18:33:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=lW4aNrSwtahR6Mg4g43jBDO2IC4o/juojdH5HYiUx7E=; b=wY0h6R/5I5su9KAal+BWoh0TMDYDSt1gc/n13x+sL4ar0tzU9Z46mLpC9Q4v7W6rQ+ dR+OwyzDyjcB07dmWOEUH2eJCvQneChjcyY/zWL5kfq5GT5B+oTaOqAnWaiZ/3DYjRdp 4fzAxmTvPiVGNxVI66PdWPUsHKf+YS0EIkG5saf/QwjTEgu0ByADvZqMnXJxE7wFVi/c Z4kcIyqNqVkc5hvOrZBZixU0GKP0VxABa0JRepRa7fJLn4wcYr5x/J4oqgxaMJFp5EHY s/cEZqFBQEnf60kyG4PPBVSsBkptzzuxs8CAJ/iAWEIxXZTvQFSh9UAqzuRT1f2ME24U n3BQ== Received: by 10.68.239.99 with SMTP id vr3mr1869628pbc.10.1335576784438; Fri, 27 Apr 2012 18:33:04 -0700 (PDT) Received: from localhost.localdomain (5520-maca-inet1-outside.broadcom.com. [216.31.211.11]) by mx.google.com with ESMTPS id 2sm8068633pbw.57.2012.04.27.18.33.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Apr 2012 18:33:03 -0700 (PDT) From: Brian Norris To: Subject: [PATCH v3 07/10] mtd: IFC NAND: utilize oob_required parameter Date: Fri, 27 Apr 2012 18:29:51 -0700 Message-Id: <1335576594-25267-8-git-send-email-computersforpeace@gmail.com> X-Mailer: git-send-email 1.7.5.4.2.g519b1 In-Reply-To: <1335576594-25267-1-git-send-email-computersforpeace@gmail.com> References: <1335576594-25267-1-git-send-email-computersforpeace@gmail.com> 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.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (computersforpeace[at]gmail.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 Cc: Li Yang , Artem Bityutskiy , Scott Wood , Brian Norris , David Woodhouse , Prabhakar Kushwaha 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 Don't read/write OOB if the caller doesn't requre it. Signed-off-by: Brian Norris --- drivers/mtd/nand/fsl_ifc_nand.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c index a8d1e87..2bbb9d5 100644 --- a/drivers/mtd/nand/fsl_ifc_nand.c +++ b/drivers/mtd/nand/fsl_ifc_nand.c @@ -699,7 +699,8 @@ static int fsl_ifc_read_page(struct mtd_info *mtd, struct nand_chip *chip, struct fsl_ifc_ctrl *ctrl = priv->ctrl; fsl_ifc_read_buf(mtd, buf, mtd->writesize); - fsl_ifc_read_buf(mtd, chip->oob_poi, mtd->oobsize); + if (oob_required) + fsl_ifc_read_buf(mtd, chip->oob_poi, mtd->oobsize); if (ctrl->nand_stat & IFC_NAND_EVTER_STAT_ECCER) dev_err(priv->dev, "NAND Flash ECC Uncorrectable Error\n"); @@ -717,7 +718,8 @@ static void fsl_ifc_write_page(struct mtd_info *mtd, struct nand_chip *chip, const uint8_t *buf, int oob_required) { fsl_ifc_write_buf(mtd, buf, mtd->writesize); - fsl_ifc_write_buf(mtd, chip->oob_poi, mtd->oobsize); + if (oob_required) + fsl_ifc_write_buf(mtd, chip->oob_poi, mtd->oobsize); } static int fsl_ifc_chip_init_tail(struct mtd_info *mtd)