Received: by 10.192.165.148 with SMTP id m20csp441263imm; Fri, 4 May 2018 00:06:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr1fP0qbDEsLIkLMg7ghzQiTvLdiMdisK0D75y8t6eLiR7xSFJOHsmvBj10iF5j1G/1ViyQ X-Received: by 2002:a65:47cb:: with SMTP id f11-v6mr21771466pgs.235.1525417614127; Fri, 04 May 2018 00:06:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525417614; cv=none; d=google.com; s=arc-20160816; b=lvMEjhBxcferGQqWoGMhgzTKXWXUINnG+r7W3ij1BtveR98JvwpsC/mLJ6tWLAtQga cnD/PNH7TDipXfYnryudA8s2PGfeNNYn0bq18WhDo7mzUPDC6wvDzgJQEzb2wOaYrokA 2AVQglbCE4wvD4TK/hP06kSbs2/JucQvkyH0roF+9wobUU2pki97kQK9bTdwZoQHBN+v +ijurgL3GMZkdAf/aD207fXnQbzY5jsO4iIw24rV+YszsgU9rAuSNoVXzTq8UF/UW2YR LEhOfGfVEI1FOGURv9BFYL3y5fvwTGrQUq2DYlV2R8V2nhdF7YV+NUoM2QK1qI8FfZ5n z5Xg== 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=7tcWPTa9WATLDZLqg82xf2wWkad5ACVNanit752srmQ=; b=iIZeKX3ybbxgj9XxxA5b9LTRrC9dp6OdFmC/4IthPiaId6eiHLUOeSmi7CIYUHuhD3 jv1T1dB4j7/DTXCvxv18BuxgL0qvaqGiY6D6IFAAJB21e54dhvGoCsA6knuvtTwRf71R JKu0hl4QJG2iXbyy2icUyHPcKBJzrPkdCA1q4aSdc4Csb3eF5EcGDgPDObOzF9TUe111 uvLsKS2CD6Nh1jr3wni1AyH26yJ9gSnmIxCF3FMqQXgyDqIga+sxK9TdGim3Mu4/tGZE pmnVs3G+Miu2iXGPhMJROi0KT5qjX7j1+i240RGXYin4zSFhaHoH4q0JCA+G0agnWRyY jrIQ== 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 z6-v6si12440743pgu.377.2018.05.04.00.06.39; Fri, 04 May 2018 00:06:54 -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 S1751339AbeEDHF6 (ORCPT + 99 others); Fri, 4 May 2018 03:05:58 -0400 Received: from mail.bootlin.com ([62.4.15.54]:48373 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751124AbeEDHF5 (ORCPT ); Fri, 4 May 2018 03:05:57 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 85A7A2076B; Fri, 4 May 2018 09:05:55 +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 1E5DE20A21; Fri, 4 May 2018 09:05:45 +0200 (CEST) Date: Fri, 4 May 2018 09:05:45 +0200 From: Boris Brezillon To: "Wan, Jane (Nokia - US/Sunnyvale)" Cc: Miquel Raynal , "dwmw2@infradead.org" , "computersforpeace@gmail.com" , "Bos, Ties (Nokia - US/Sunnyvale)" , "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "richard@nod.at" , "marek.vasut@gmail.com" , "yamada.masahiro@socionext.com" , "prabhakar.kushwaha@nxp.com" , "shawnguo@kernel.org" , "jagdish.gediya@nxp.com" , "shreeya.patel23498@gmail.com" Subject: Re: [PATCH v2 1/2] mtd: rawnand: fsl_ifc: fix FSL NAND driver to read Message-ID: <20180504090545.2b422446@bbrezillon> In-Reply-To: References: 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=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jane, On Fri, 4 May 2018 01:35:37 +0000 "Wan, Jane (Nokia - US/Sunnyvale)" wrote: > Hi Miquel and Boris, > > Thank you for your response. The following is the reposting the v2 version of the patch (also in the attachment). No need to attach the patch, and this message should not be placed here... > > Subject: [PATCH v2 1/2] mtd: rawnand: fsl_ifc: fix FSL NAND driver to read > all ONFI parameter pages > > Per ONFI specification (Rev. 4.0), if the CRC of the first parameter page > read is not valid, the host should read redundant parameter page copies. > Fix FSL NAND driver to read the two redundant copies which are mandatory > in the specification. > > Signed-off-by: Jane Wan > --- ... but here. Also, I'd recommend using git send-email to send patches, so that they are properly sent and placed in a thread when they are part of a patch series. Thanks, Boris > drivers/mtd/nand/raw/fsl_ifc_nand.c | 17 ++++++++++------- > 1 file changed, 10 insertions(+), 7 deletions(-) > > diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl_ifc_nand.c > index 61aae02..98aac1f 100644 > --- a/drivers/mtd/nand/raw/fsl_ifc_nand.c > +++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c > @@ -342,9 +342,16 @@ static void fsl_ifc_cmdfunc(struct mtd_info *mtd, unsigned int command, > > case NAND_CMD_READID: > case NAND_CMD_PARAM: { > + /* > + * For READID, read 8 bytes that are currently used. > + * For PARAM, read all 3 copies of 256-bytes pages. > + */ > + int len = 8; > int timing = IFC_FIR_OP_RB; > - if (command == NAND_CMD_PARAM) > + if (command == NAND_CMD_PARAM) { > timing = IFC_FIR_OP_RBCD; > + len = 256 * 3; > + } > > ifc_out32((IFC_FIR_OP_CW0 << IFC_NAND_FIR0_OP0_SHIFT) | > (IFC_FIR_OP_UA << IFC_NAND_FIR0_OP1_SHIFT) | > @@ -354,12 +361,8 @@ static void fsl_ifc_cmdfunc(struct mtd_info *mtd, unsigned int command, > &ifc->ifc_nand.nand_fcr0); > ifc_out32(column, &ifc->ifc_nand.row3); > > - /* > - * although currently it's 8 bytes for READID, we always read > - * the maximum 256 bytes(for PARAM) > - */ > - ifc_out32(256, &ifc->ifc_nand.nand_fbcr); > - ifc_nand_ctrl->read_bytes = 256; > + ifc_out32(len, &ifc->ifc_nand.nand_fbcr); > + ifc_nand_ctrl->read_bytes = len; > > set_addr(mtd, 0, 0, 0); > fsl_ifc_run_command(mtd);