Received: by 10.213.65.68 with SMTP id h4csp3690849imn; Tue, 10 Apr 2018 03:10:39 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+ZmppBHDdftYjan2nzumrhh0cJjjcghQkRcpcPEmWYg76NZa9sY+YbJOvX6PAA9Ka16glw X-Received: by 10.101.100.9 with SMTP id a9mr27618100pgv.209.1523355039807; Tue, 10 Apr 2018 03:10:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523355039; cv=none; d=google.com; s=arc-20160816; b=KpmxoKQ64ODOZbWuqu4ftrtV3HQt/TF+9JT3/NMa0bST9+Bof7KPWCFB4rpxZ2HBc3 5HN8zuYhRINLS3T1m4mffdzrF+dDnpwH5qA0g+EtKkXhdhxQcMCj/wFvuaz8j60079MZ RVsluF2Q7qdIoSeMoCyN5lrffY4bzBkgksC5G6ecM++HUZPOIcJh0FaPHOEermBsWgTo yCNH9UgkvBPx0vA3vE8zgZPugUzFI0xQ5iS96djLd0gN4ma3DIJyLb3E2520NEGQ66KZ 1+PZ/NH6RuNFP1/QpHj+uItziMAXmj/13yJUpiziUiPrqojzM3fESxJuRPvQz37iTEXV SgCQ== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=rxDAkKKfhD+lS9kXpqUzLVpnvxq6uInaWFhqy2TPSgg=; b=HmPXOqcn3WRL3Rm98CpS2Urs2uHddPr6QVX6lxvOy6vI0qsD0gfsh6CmG71zv5cZo+ 5E5BGmdWeA39Opf/ySCOf0QjbTZQKwn+4tK6XQcanmha683/LFZ0vjQamkq1ZyPBGV5Z piCYFfjuNce7xpq19jOgNDSB/fdumQ/8iD6Ew1RF4whL/MKeOPRoZKomLy+yFOdsWXpB w/t1Df2olEX7yyJjkK2n2HCcgkd1X17nO9VJLgnJV3XPCcOeXOYUPw2KASgajSe5wzIJ jlL6jn0zc+rr2iGLYULlK7ynrwAlS1csVeMf+Oiv5h3FCZRYYSHKg81N0CM6AsObKhy8 AcwQ== 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 r14-v6si2478125pli.324.2018.04.10.03.10.02; Tue, 10 Apr 2018 03:10:39 -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 S1752584AbeDJKF4 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 10 Apr 2018 06:05:56 -0400 Received: from mail.bootlin.com ([62.4.15.54]:43403 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752062AbeDJKFy (ORCPT ); Tue, 10 Apr 2018 06:05:54 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 3A05120712; Tue, 10 Apr 2018 12:05:53 +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, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from xps13 (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id CF388200FB; Tue, 10 Apr 2018 12:05:42 +0200 (CEST) Date: Tue, 10 Apr 2018 12:05:42 +0200 From: Miquel Raynal To: Abhishek Sahu Cc: Boris Brezillon , Archit Taneja , Richard Weinberger , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marek Vasut , linux-mtd@lists.infradead.org, Cyrille Pitchen , Andy Gross , Brian Norris , David Woodhouse Subject: Re: [PATCH 6/9] mtd: nand: qcom: support for checking read errors for last codeword Message-ID: <20180410120542.24ea9ddb@xps13> In-Reply-To: <1522845745-6624-7-git-send-email-absahu@codeaurora.org> References: <1522845745-6624-1-git-send-email-absahu@codeaurora.org> <1522845745-6624-7-git-send-email-absahu@codeaurora.org> Organization: Bootlin 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 Hi Abhishek, On Wed, 4 Apr 2018 18:12:22 +0530, Abhishek Sahu wrote: > Add boolean function argument in parse_read_errors to identify > whether the read error has been called for complete page read or > only last codeword read. This will help in subsequent patches to > detect ECC errors in case of last codeword read. Can you explain when this happen: "last codeword read"? I don't see the use case. Thanks, Miquèl > > Signed-off-by: Abhishek Sahu > --- > drivers/mtd/nand/qcom_nandc.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/mtd/nand/qcom_nandc.c b/drivers/mtd/nand/qcom_nandc.c > index ba43752..dce97e8 100644 > --- a/drivers/mtd/nand/qcom_nandc.c > +++ b/drivers/mtd/nand/qcom_nandc.c > @@ -1570,7 +1570,7 @@ struct read_stats { > * errors. this is equivalent to what 'ecc->correct()' would do. > */ > static int parse_read_errors(struct qcom_nand_host *host, u8 *data_buf, > - u8 *oob_buf) > + u8 *oob_buf, bool last_cw) > { > struct nand_chip *chip = &host->chip; > struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip); > @@ -1579,12 +1579,12 @@ static int parse_read_errors(struct qcom_nand_host *host, u8 *data_buf, > unsigned int max_bitflips = 0; > struct read_stats *buf; > bool flash_op_err = false; > - int i; > + int i, cw_cnt = last_cw ? 1 : ecc->steps; > > buf = (struct read_stats *)nandc->reg_read_buf; > nandc_read_buffer_sync(nandc, true); > > - for (i = 0; i < ecc->steps; i++, buf++) { > + for (i = 0; i < cw_cnt; i++, buf++) { > u32 flash, buffer, erased_cw; > int data_len, oob_len; > > @@ -1743,7 +1743,8 @@ static int read_page_ecc(struct qcom_nand_host *host, u8 *data_buf, > free_descs(nandc); > > if (!ret) > - ret = parse_read_errors(host, data_buf_start, oob_buf_start); > + ret = parse_read_errors(host, data_buf_start, oob_buf_start, > + false); > > return ret; > } -- Miquel Raynal, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com