Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933009AbbD1Do2 (ORCPT ); Mon, 27 Apr 2015 23:44:28 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:33862 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752850AbbD1Do1 (ORCPT ); Mon, 27 Apr 2015 23:44:27 -0400 MIME-Version: 1.0 In-Reply-To: <20150428032213.GI19571@brian-ubuntu> References: <1427292151-3835-1-git-send-email-richard@nod.at> <1427292151-3835-2-git-send-email-richard@nod.at> <20150427213558.GA22780@bshelton-desktop> <553EB5E4.3050309@nod.at> <20150427232353.GD32500@ld-irv-0074> <20150428032213.GI19571@brian-ubuntu> Date: Tue, 28 Apr 2015 09:14:26 +0530 X-Google-Sender-Auth: VlurYiFuu2Vp3SHBDajqCmKG0so Message-ID: Subject: Re: [PATCH 1/3] mtd: nand: Add on-die ECC support From: punnaiah choudary kalluri To: Brian Norris Cc: Richard Weinberger , Ben Shelton , "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" , David Woodhouse , Punnaiah Choudary Kalluri , Boris Brezillon Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3297 Lines: 83 On Tue, Apr 28, 2015 at 8:52 AM, Brian Norris wrote: > On Tue, Apr 28, 2015 at 08:18:12AM +0530, punnaiah choudary kalluri wrote: >> On Tue, Apr 28, 2015 at 4:53 AM, Brian Norris >> wrote: >> > On Tue, Apr 28, 2015 at 12:19:16AM +0200, Richard Weinberger wrote: >> >> Oh, I thought every driver has to implement that function. ;-\ >> > >> > Nope. >> > >> >> But you're right there is a corner case. >> > >> > And it's not the only one! Right now, there's no guarantee even that >> > read_buf() returns raw data, unmodified by the SoC's controller. Plenty >> > of drivers actually have HW-enabled ECC turned on by default, and so >> > they override the chip->ecc.read_page() (and sometimes >> > chip->ecc.read_page_raw() functions, if we're lucky) with something >> > that pokes the appropriate hardware instead. I expect anything >> > comprehensive here is probably going to have to utilize >> > chip->ecc.read_page_raw(), at least if it's provided by the hardware >> > driver. >> >> Yes, overriding the chip->ecc.read_page_raw would solve this. > > I'm actually suggesting that (in this patch set, for on-die ECC > support), maybe we *shouldn't* override chip->ecc.read_page_raw() and > leave that to be defined by the driver, and then on-die ECC support > should be added in a way that just calls chip->ecc.read_page_raw(). This > should work for any driver that already properly supports the raw > callbacks. Ok. Understood. > >> Agree that >> read_buf need not be returning raw data always including my new driver for >> arasan nand flash controller. > > I agree with that. At the moment, chip->read_buf() really has very > driver-specific meaning. Not sure if that's really a good thing, but > it's the way things are... > >> http://lkml.iu.edu/hypermail/linux/kernel/1504.2/00313.html > > In the half a minute I just spent looking at this (I may review it > properly later), I noted a few things: > > 1. you don't implement ecc.read_page_raw(); this means we'll probably > have trouble supporting on-die ECC with your driver, among other things On-die ECC is optional as long as the controller has better ecc coverage. The arasan controller supports up to 24 bit ecc. There is no point to use on-die ECC and will always use hw ecc even for On-die ecc devices. This version of driver will not have the support for ecc.read_page_raw but I will add based on the need in future. > > 2. your patch is all white-space mangled. Please use your favorite > search engine to figure out how to get that right. git-send-email is > your friend. Oh sorry. Looks that was the web link issue. Here is the new one. https://lkml.org/lkml/2015/4/16/311 Also request your time for reviewing this driver. Thanks, Punnaiah > > Thanks, > 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/ -- 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/