From patchwork Sat Nov 26 18:05:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 84288 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp787238obn; Sat, 26 Nov 2016 10:12:02 -0800 (PST) X-Received: by 10.84.135.34 with SMTP id 31mr30664217pli.50.1480183922884; Sat, 26 Nov 2016 10:12:02 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b34si20811365pld.128.2016.11.26.10.12.02; Sat, 26 Nov 2016 10:12:02 -0800 (PST) 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; dkim=pass header.i=@nifty.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 S1753835AbcKZSLq (ORCPT + 25 others); Sat, 26 Nov 2016 13:11:46 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:48224 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753257AbcKZSI3 (ORCPT ); Sat, 26 Nov 2016 13:08:29 -0500 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-11.nifty.com with ESMTP id uAQI6Ued018512; Sun, 27 Nov 2016 03:06:38 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com uAQI6Ued018512 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1480183599; bh=FbxEQeVFzBHduCS2OMAayIfa3bQhtZfaSCjZpRUkZdc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YAas+Vq3fLeb9bklnqO+9qcQptYFYiZdoHoYp9JYKU66sGO2y3bnQmSsgvu0aCuSC gxyGyx4EGTbUvtPzrefyQRFvP7u55VimSjDgGlBYcazvJPBr4yOYJgBr5k8nNyDy7u MVmrMomwX09X4mYr3yPZdOXJbhE/SPOD+x6C653zsVusWAfvMHc0IiTQ+8bMS6e9wQ CosmM5QZI0+23bC+zMZFaB3BPDdv615s4BsrbF7RCd2rDsi0vMsDRozrU9jvbgnGr5 KTjNm1C+PkXePDk/zrprHa+SM4v4lu99aALdcWvz4WWfMyfnxTQ4vUakFQMxKa8YND 4dtr8GexfU8cQ== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org, Boris Brezillon , Marek Vasut , Brian Norris , Richard Weinberger , David Woodhouse , Cyrille Pitchen Subject: [PATCH 07/39] mtd: nand: denali: transfer OOB only when oob_required is set Date: Sun, 27 Nov 2016 03:05:53 +0900 Message-Id: <1480183585-592-8-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480183585-592-1-git-send-email-yamada.masahiro@socionext.com> References: <1480183585-592-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, the denali_read_page_raw() always transfers the OOB and copy the data to chip->oob_poi, ignoring the oob_required argument. Respect the oob_required argument. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/denali.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index b2b050b..cbc7f75 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -1182,7 +1182,7 @@ static int denali_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip, BUG(); } - setup_ecc_for_xfer(denali, false, true); + setup_ecc_for_xfer(denali, false, oob_required ? true : false); denali_enable_dma(denali, true); dma_sync_single_for_device(denali->dev, addr, size, DMA_FROM_DEVICE); @@ -1198,7 +1198,9 @@ static int denali_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip, denali_enable_dma(denali, false); memcpy(buf, denali->buf.buf, mtd->writesize); - memcpy(chip->oob_poi, denali->buf.buf + mtd->writesize, mtd->oobsize); + if (oob_required) + memcpy(chip->oob_poi, denali->buf.buf + mtd->writesize, + mtd->oobsize); return 0; }