Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3717096ybd; Tue, 25 Jun 2019 07:19:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXFmR3e91Xt2eukZOK1gRu3BaGVJMQwwgTEX5OdmfaGi7YHF1KwB5ktWrO+wyWzivzsQjk X-Received: by 2002:a63:d512:: with SMTP id c18mr40577051pgg.239.1561472362217; Tue, 25 Jun 2019 07:19:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561472362; cv=none; d=google.com; s=arc-20160816; b=ZZucGa/01ls93Q0DVnO/T2DOOIJJzYaxNVZpgfJV/A/amougNTcEc3odM3LfOQ60fN 2HNrPbJRwq6yEEXQQ34kZ0cu4KZs+5hh5jI1Dq5YuF/XjkcSgpWgJjo6c1B9AiYnB+8S dRAH2AxU6lIGyiMu+itYiD+rcrBJ+rM17qKoXtxfCPTGwukWea4BsFpjnVEp0oyvvdXj qEvAraghsgBdVrOSEbndy0cJUTj1cF/ghXe7TP6qBja6Dm7eF7gkh0w4DMEglU07cLb1 To+wbtfcGoqWUoU4vHfAWo3RjhUz4XdRbpH8qtLvwaOkaDbotUzJZsCO2OQOu9m+S6n2 7UBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=0LXqnefS6ua7gqL9kD/KCf39EJ+ezxI8Okybp4/Vr+o=; b=f6aQKwo8BhN59FQMpbvhYUPtWEI0c4p/9twW1ccqx07jnHQtXbzFMyOHavuAluEJ3J bSntsFkNRJgJL88L1LeBQpndN5tcFk6j62mPClBWy+t3pEgilB7OJK77auwa8uJ40xRc vNJDXkbfYqhrrtOXUL5+3eTPa+CEHFCEEaZ92JPSJg404t6uzsSELv+egRUbEC/NlS4n X03oT7jEEUM4u+JAdycsN0cxETiFjq5TMiuTuyccH0EmQa7uYmPKbz/bR0AK/4F6jLmb tm8okdQnFayr/c0q0zyPgh4fAXeJcSAX27GhxizXj7h97fBzZIU3cUjVf8hz6pQROmBQ jiIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intenta.de header.s=dkim1 header.b=GQXVa9j2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intenta.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q2si13445769pgh.177.2019.06.25.07.19.05; Tue, 25 Jun 2019 07:19:22 -0700 (PDT) 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=@intenta.de header.s=dkim1 header.b=GQXVa9j2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intenta.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729727AbfFYORE (ORCPT + 99 others); Tue, 25 Jun 2019 10:17:04 -0400 Received: from mail.intenta.de ([178.249.25.132]:28391 "EHLO mail.intenta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727070AbfFYORD (ORCPT ); Tue, 25 Jun 2019 10:17:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=intenta.de; s=dkim1; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:CC:To:From:Date; bh=0LXqnefS6ua7gqL9kD/KCf39EJ+ezxI8Okybp4/Vr+o=; b=GQXVa9j2NkuaRh3mroxMOkZV8AXHK22v8Lj314GNO/ChsPvS33P9Pzv/VrBU21g7Fnbt1V7HewaCrDHncVS+RMe0NaDPdrQapJEbyKttQypFLMjvVIRZ7R1owYz3tl43s+Zg+Nar+Jj4/Ayf2mT5qCeq2UKePxsiVj+pVNZEJnaR/n3ZrnQfo1nZ6jFNHzN81yuwcyOnD4kKqH/YCZvItcMoQ3k/+Rpv2iLFyyX+hLwRvQazeho7fxZx2reN+/6eIox4h7ZdYaYgWISGZY2Vflx6oUG0djzC4ZS+hmqj9NGqpeVfs84F9/64ghcbTLexjualZ/WKTfu1b1gFnhrmUA==; X-CTCH-RefID: str=0001.0A0C020D.5D122B8D.0069,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Date: Tue, 25 Jun 2019 16:11:25 +0200 From: Helmut Grohne To: Naga Sureshkumar Relli CC: "miquel.raynal@bootlin.com" , "richard@nod.at" , "dwmw2@infradead.org" , "computersforpeace@gmail.com" , "marek.vasut@gmail.com" , "vigneshr@ti.com" , "bbrezillon@kernel.org" , "yamada.masahiro@socionext.com" , "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [LINUX PATCH v17 1/2] mtd: rawnand: nand_micron: Do not over write driver's read_page()/write_page() Message-ID: <20190625141125.a4umdey6ejxjxap4@laureti-dev> References: <20190625044630.31717-1-naga.sureshkumar.relli@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190625044630.31717-1-naga.sureshkumar.relli@xilinx.com> User-Agent: NeoMutt/20170113 (1.7.2) X-ClientProxiedBy: ICSMA002.intenta.de (10.10.16.48) To ICSMA002.intenta.de (10.10.16.48) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 25, 2019 at 06:46:29AM +0200, Naga Sureshkumar Relli wrote: > --- a/drivers/mtd/nand/raw/nand_micron.c > +++ b/drivers/mtd/nand/raw/nand_micron.c > @@ -500,8 +500,11 @@ static int micron_nand_init(struct nand_chip *chip) > chip->ecc.size = 512; > chip->ecc.strength = chip->base.eccreq.strength; > chip->ecc.algo = NAND_ECC_BCH; > - chip->ecc.read_page = micron_nand_read_page_on_die_ecc; > - chip->ecc.write_page = micron_nand_write_page_on_die_ecc; > + if (!chip->ecc.read_page) > + chip->ecc.read_page = micron_nand_read_page_on_die_ecc; > + > + if (!chip->ecc.write_page) > + chip->ecc.write_page = micron_nand_write_page_on_die_ecc; When used with pl353_nand.c, this change prioritizes the pl353_nand_read_page_raw/pl353_nand_write_page_raw implementations over micron_nand_read_page_on_die_ecc/micron_nand_write_page_on_die_ecc. The pl353 implementations don't check the status register of the flash for NAND_ECC_STATUS_WRITE_RECOMMENDED nor do they update ecc_stats.failed in any way. Unless I am mistaken, this implies that bitflips cannot be detected at all anymore. However, this is the change that makes a MT29F2G08ABAEAWP practically work with jffs2 on the Zynq platform. In this context, I countered a document from Micron[1] indicating that their on-die chips are incompatible with jffs2 as is, because the on-die oob layout is incompatible with jffs2. I suppose that using the raw variants puts jffs2 in full control of the oob area, but is this really the correct solution? Helmut [1] https://www.micron.com/~/media/Documents/Products/Technical%20Note/NAND%20Flash/tn2975_enable_on-die-ECC_NAND_JFFS2.pdf