public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: "xiangsheng.hou" <xiangsheng.hou@mediatek.com>
Cc: Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Tudor Ambarus <Tudor.Ambarus@microchip.com>,
	<linux-mtd@lists.infradead.org>, Rob Herring <robh+dt@kernel.org>,
	Mark Brown <broonie@kernel.org>,
	"Boris Brezillon" <bbrezillon@kernel.org>,
	<devicetree@vger.kernel.org>, <linux-spi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <jaimeliao@mxic.com.tw>,
	<juliensu@mxic.com.tw>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [RFC PATCH 06/10] mtd: nand: mxic-ecc: Add Macronix external ECC engine support
Date: Fri, 15 Oct 2021 11:37:41 +0200	[thread overview]
Message-ID: <20211015113741.30712544@xps13> (raw)
In-Reply-To: <872348abea7317c6b3d2ed53c8139e0927bb991f.camel@mediatek.com>

Hi xiangsheng.hou,

xiangsheng.hou@mediatek.com wrote on Wed, 13 Oct 2021 17:15:49 +0800:

> Hi,
> 
> On Fri, 2021-10-08 at 18:22 +0200, Miquel Raynal wrote:
> > 
> > +static int mxic_ecc_count_biterrs(struct mxic_ecc_engine *eng,
> > struct mtd_info *mtd)
> > +{
> > +	struct device *dev = eng->dev;
> > +	unsigned int max_bf = 0;
> > +	int step;
> > +
> > +	for (step = 0; step < eng->steps; step++) {
> > +		u8 stat = eng->status[step];
> > +
> > +		if (stat == NO_ERR) {
> > +			dev_dbg(dev, "ECC step %d: no error\n", step);
> > +		} else if (stat == ERASED_CHUNK) {
> > +			dev_dbg(dev, "ECC step %d: erased\n", step);
> > +		} else if (stat == UNCORR_ERR || stat > MAX_CORR_ERR) {
> > +			dev_dbg(dev, "ECC step %d: uncorrectable\n",
> > step);
> > +			mtd->ecc_stats.failed++;
> > +		} else {
> > +			dev_dbg(dev, "ECC step %d: %d bits
> > corrected\n",
> > +				step, stat);
> > +			max_bf = max_t(unsigned int, max_bf, stat);
> > +			mtd->ecc_stats.corrected += stat;
> > +		}
> > +	}
> > +
> > +	return max_bf;
> > +}  
> 
> In spinand_mtd_read() function, rely on the return value -EBADMSG to
> check whether ecc failed. Therefore, maybe there also need return this
> value in mxic_ecc_count_biterrs() function when uncorrectable ecc
> error?

True, I'll fix this.

Thanks,
Miquèl

  parent reply	other threads:[~2021-10-15  9:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08 16:22 [RFC PATCH 00/10] Macronix ECC engine Miquel Raynal
2021-10-08 16:22 ` [RFC PATCH 01/10] mtd: spinand: Fix comment Miquel Raynal
2021-10-08 16:22 ` [RFC PATCH 02/10] mtd: spinand: macronix: Use random program load Miquel Raynal
2021-10-08 16:22 ` [RFC PATCH 03/10] dt-bindings: vendor-prefixes: Update Macronix prefix Miquel Raynal
2021-10-08 21:47   ` Rob Herring
2021-10-18  1:42     ` 回信: " jaimeliao
2021-10-08 16:22 ` [RFC PATCH 04/10] dt-bindings: mtd: Describe Macronix NAND ECC engine Miquel Raynal
2021-10-08 19:48   ` Rob Herring
2021-10-08 16:22 ` [RFC PATCH 05/10] mtd: nand: ecc: Add infrastructure to support hardware engines Miquel Raynal
2021-10-08 16:22 ` [RFC PATCH 06/10] mtd: nand: mxic-ecc: Add Macronix external ECC engine support Miquel Raynal
     [not found]   ` <872348abea7317c6b3d2ed53c8139e0927bb991f.camel@mediatek.com>
2021-10-15  9:37     ` Miquel Raynal [this message]
2021-10-08 16:22 ` [RFC PATCH 07/10] mtd: nand: mxic-ecc: Support SPI pipelined mode Miquel Raynal
2021-10-08 16:22 ` [RFC PATCH 08/10] spi: mxic: Fix the transmit path Miquel Raynal
     [not found]   ` <OF11A0CCB6.4C81ABAD-ON4825876D.00256D6A-4825876D.00256F7A@LocalDomain>
2021-10-13  7:04     ` 回信: " zhengxunli
2021-10-08 16:22 ` [RFC PATCH 09/10] spi: mxic: Add support for direct mapping Miquel Raynal
2021-10-12  7:14   ` 回信: " jaimeliao
2021-10-15  8:29     ` Miquel Raynal
     [not found]   ` <OF86339F0C.88E145E3-ON4825876D.002567AA-4825876D.002569D9@LocalDomain>
2021-10-13  7:23     ` zhengxunli
2021-10-08 16:22 ` [RFC PATCH 10/10] spi: mxic: Add support for pipelined ECC operations Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211015113741.30712544@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=Tudor.Ambarus@microchip.com \
    --cc=bbrezillon@kernel.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jaimeliao@mxic.com.tw \
    --cc=juliensu@mxic.com.tw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=robh+dt@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vigneshr@ti.com \
    --cc=xiangsheng.hou@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox