Received: by 10.192.165.148 with SMTP id m20csp473576imm; Wed, 2 May 2018 03:40:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqusV5A6y+4eaVAb3EWuQjOc5tYXVzHkMwFpZPGTbBd9ksszXMVuPn4VVovoiPPfMU2G4aR X-Received: by 2002:a63:5fd1:: with SMTP id t200-v6mr16068885pgb.246.1525257611383; Wed, 02 May 2018 03:40:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525257611; cv=none; d=google.com; s=arc-20160816; b=RBh3a83x60NWbP2a4yxUQ3GELtfwdeSW5SAoEjH4iTBfjGXm+NyIrlZcevzwUKdmOi teRpmX3VaPQUkty/PoSLh0iF2Dn4Wg7wUao7KARI/DVpPCAvOAhKkPmjwc5dksZu87jH RfgcMKzVYLWI2FalVCWQ/AYyPtlavklwoat8XHNXYlDBAQWXpvG1qPhSLpkGZqjIggxL WAJ9mhAIbbJB33uYAvkqidKbYR1rw65WXgE4vFQUFKuxq3HO1+w+tfnJKutDtxfs8RQZ yYtR1xDpbAcUMxI6uirDX8Lw+q6jqmSAdUOmls6DEvaNgBAdwE2w8uHZ9ZDubrMhKfvo G3LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=bE/INolw1uVtS5dGfYdYPhMXxMmvDxeK54BD+1hKaxY=; b=gkfKIj+h4kpCgsSre913mQrv2IwLbKhqPkf/iVAMiChUGVWWoo+VCOnyltIFSUxdPC 1tFYXGyd8AkZC+MpSwiwHqyTYvKsUvvojQM+OKtVOhvGtpR5+8PUH5dYn3goXG0KmdlT 4IslBpItV4BFMomgrm1Fc5WkX8zYtHoyXdWAPQUn0afq1yiGzQWQwEED7y4izoWwXPUF qoKMfKjWoxskqZLVBDeLgwir+h/wVsBu9Wfgn5lVEVNxUFIoDeZ2WEZDcd+P3cnjEA+A I1ogrhTv0dne6q1fU+aVscskWVqbnvgosO55NgFDda67rH9Hlk3Wd5CLqXvznYsiNS9v 6Q1A== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m137-v6si9013664pga.382.2018.05.02.03.39.57; Wed, 02 May 2018 03:40:11 -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; 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 S1751175AbeEBKj1 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 2 May 2018 06:39:27 -0400 Received: from mail.bootlin.com ([62.4.15.54]:46107 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750849AbeEBKj0 (ORCPT ); Wed, 2 May 2018 06:39:26 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 4C95E20723; Wed, 2 May 2018 12:39:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id D87CC2038E; Wed, 2 May 2018 12:39:13 +0200 (CEST) Date: Wed, 2 May 2018 12:39:14 +0200 From: Boris Brezillon To: "Wan, Jane (Nokia - US/Sunnyvale)" Cc: Miquel Raynal , "shreeya.patel23498@gmail.com" , "yamada.masahiro@socionext.com" , "richard@nod.at" , "linux-kernel@vger.kernel.org" , "marek.vasut@gmail.com" , "Bos, Ties \(Nokia - US/Sunnyvale\)" , "prabhakar.kushwaha@nxp.com" , "linux-mtd@lists.infradead.org" , "jagdish.gediya@nxp.com" , "shawnguo@kernel.org" , "computersforpeace@gmail.com" , "dwmw2@infradead.org" Subject: Re: [PATCH 1/2] Fix FSL NAND driver to read all ONFI parameter pages Message-ID: <20180502123914.3755a634@bbrezillon> In-Reply-To: References: <1524788396-32380-1-git-send-email-Jane.Wan@nokia.com> <1524788396-32380-2-git-send-email-Jane.Wan@nokia.com> <20180428134218.3ae857eb@xps13> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 1 May 2018 05:01:23 +0000 "Wan, Jane (Nokia - US/Sunnyvale)" wrote: > Hi Miquèl and Boris, > > Thank you for your response and feedback. I've modified the fix based on your comments. > Please see the updated patch file at the end of this message (also in attachment). > My answers to your comments/questions are inline in the previous message. > > Here is the answer to Boris question in another email thread: > > > What if some NANDs have 4 or more copies of the param page? > [Jane] The ONFI spec defines that the parameter page and its two redundant copies are mandatory. > The additional redundant pages are optional. Currently, the FSL NAND driver only reads the first > parameter page. This patch is to fix the driver to meet the mandatory requirement in the spec. > We got a batch of particularly bad NAND chips recently and we needed these changes to make them > work reliably over temperature. The patch was verified using these bad chips. And that proves my point. The core is reading 3 param pages [1], but since this driver was trying to guess how many bytes to read from ->cmdfunc() and did not guess correctly you ended up with a partially working implementation (works only if the first PARAM page is valid). Now, you fix it to read 3 PARAM pages, but what if we decide to read more to cope with MLC NANDs where even more copy are needed to have one valid version? You'll have to patch ->cmdfunc() again, just because you're trying to guess something that the core is supposed to tell you. [1]https://elixir.bootlin.com/linux/v4.17-rc3/source/drivers/mtd/nand/raw/nand_base.c#L5115