From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miquel Raynal Subject: Re: [PATCH 6/9] mtd: nand: qcom: support for checking read errors for last codeword Date: Tue, 10 Apr 2018 12:05:42 +0200 Message-ID: <20180410120542.24ea9ddb@xps13> References: <1522845745-6624-1-git-send-email-absahu@codeaurora.org> <1522845745-6624-7-git-send-email-absahu@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Return-path: In-Reply-To: <1522845745-6624-7-git-send-email-absahu@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: linux-arm-msm@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