Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754837AbbGaXr1 (ORCPT ); Fri, 31 Jul 2015 19:47:27 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:32966 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752596AbbGaXrZ (ORCPT ); Fri, 31 Jul 2015 19:47:25 -0400 Date: Fri, 31 Jul 2015 16:47:18 -0700 From: Brian Norris To: Stefan Agner Cc: dwmw2@infradead.org, sebastian@breakpoint.cc, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, shawn.guo@linaro.org, kernel@pengutronix.de, boris.brezillon@free-electrons.com, marb@ixxat.de, aaron@tastycactus.com, bpringlemeir@gmail.com, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, albert.aribaud@3adev.fr, Bill Pringlemeir Subject: Re: [PATCH v9 2/5] mtd: nand: vf610_nfc: add hardware BCH-ECC support Message-ID: <20150731234718.GO10676@google.com> References: <1438361581-2702-1-git-send-email-stefan@agner.ch> <1438361581-2702-3-git-send-email-stefan@agner.ch> <20150731230901.GK10676@google.com> <9dd7975072cf16dd6ea1947bd4ae830a@agner.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9dd7975072cf16dd6ea1947bd4ae830a@agner.ch> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1466 Lines: 43 On Sat, Aug 01, 2015 at 01:35:52AM +0200, Stefan Agner wrote: > On 2015-08-01 01:09, Brian Norris wrote: > >> +static int vf610_nfc_read_page(struct mtd_info *mtd, struct nand_chip *chip, > >> + uint8_t *buf, int oob_required, int page) > >> +{ > >> + int eccsize = chip->ecc.size; > >> + int stat; > >> + > >> + vf610_nfc_read_buf(mtd, buf, eccsize); > >> + > >> + if (oob_required) > >> + vf610_nfc_read_buf(mtd, chip->oob_poi, mtd->oobsize); > > > > To fix the bitflips issue above, you'll just want to unconditionally > > read the OOB (it's fine to ignore 'oob_required') and... > > > >> + > >> + stat = vf610_nfc_correct_data(mtd, buf); > > > > ...pass in chip->oob_poi as a third argument. > > > > Hm, this probably will have an effect on performance, since we usually > omit the OOB if not requested. You could test :) I don't really like performance claims without tests. (I say this because I added the oob_required flag myself, but just for functional purposes, not performance. Many drivers got by just fine by always copying the OOB data.) > I could fetch the OOB from the NAND > controllers SRAM only if necessary (if HW ECC status is not ok...). Does > this sound reasonable? That does. Brian -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/