Patchwork mtd: onenand: use KERN_DEBUG for ECC errors

login
register
mail settings
Submitter Artem Bityutskiy
Date Aug. 31, 2009, 7:03 a.m.
Message ID <1251702212-17785-1-git-send-email-dedekind@infradead.org>
Download mbox | patch
Permalink /patch/32611/
State New, archived
Headers show

Comments

Artem Bityutskiy - Aug. 31, 2009, 7:03 a.m.
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

ECC errors is a normal phenomena on OneNAND and they happen quite
often. Flash-aware file-systems like JFFS2 or UBIFS are able to
handle them gracefully.

Currently OneNAND driver prints about ECC errors like this:
onenand_bbt_wait: ecc error = 0x2222, controller error 0x2400
onenand_bbt_wait: ecc error = 0x2222, controller error 0x2400
onenand_bbt_wait: ecc error = 0x2222, controller error 0x2400

These messages are scary and make users think that something serious
happened. However, they are handled nicely by UBIFS.

This patch makes this messages to be printed with KERN_DEBUG
level, so that they would not go to the console, at least, which
is currently happening in case of standard default setup.

Indeed, since ECC errors are supposed to be handled by upper
level SW, we do not really have to print these messages, and we
may consider them as debugging prints.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
 drivers/mtd/onenand/onenand_base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Kyungmin Park - Aug. 31, 2009, 7:15 a.m.
Hi<

As I remember, it's changed from KERN_DEBUG to KERN_INFO from adrian request.
I think you worry the ecc error message. If so, how about to change
the ecc message itself? e.g. ecc info
Also controller info instead of controller error.

I got some help there was 1-bit ecc message displayed.

How do you think?

Thank you,
Kyungmin Park

On Mon, Aug 31, 2009 at 4:03 PM, Artem Bityutskiy<dedekind@infradead.org> wrote:
> From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
>
> ECC errors is a normal phenomena on OneNAND and they happen quite
> often. Flash-aware file-systems like JFFS2 or UBIFS are able to
> handle them gracefully.
>
> Currently OneNAND driver prints about ECC errors like this:
> onenand_bbt_wait: ecc error = 0x2222, controller error 0x2400
> onenand_bbt_wait: ecc error = 0x2222, controller error 0x2400
> onenand_bbt_wait: ecc error = 0x2222, controller error 0x2400
>
> These messages are scary and make users think that something serious
> happened. However, they are handled nicely by UBIFS.
>
> This patch makes this messages to be printed with KERN_DEBUG
> level, so that they would not go to the console, at least, which
> is currently happening in case of standard default setup.
>
> Indeed, since ECC errors are supposed to be handled by upper
> level SW, we do not really have to print these messages, and we
> may consider them as debugging prints.
>
> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
> ---
>  drivers/mtd/onenand/onenand_base.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
> index 6e82909..994939e 100644
> --- a/drivers/mtd/onenand/onenand_base.c
> +++ b/drivers/mtd/onenand/onenand_base.c
> @@ -1450,7 +1450,7 @@ static int onenand_bbt_wait(struct mtd_info *mtd, int state)
>        if (interrupt & ONENAND_INT_READ) {
>                int ecc = onenand_read_ecc(this);
>                if (ecc & ONENAND_ECC_2BIT_ALL) {
> -                       printk(KERN_INFO "onenand_bbt_wait: ecc error = 0x%04x"
> +                       printk(KERN_DEBUG "onenand_bbt_wait: ecc error = 0x%04x"
>                                ", controller error 0x%04x\n", ecc, ctrl);
>                        return ONENAND_BBT_READ_ECC_ERROR;
>                }
> --
> 1.6.2.5
>
>
Artem Bityutskiy - Aug. 31, 2009, 7:21 a.m.
On 08/31/2009 10:15 AM, Kyungmin Park wrote:
> Hi<
>
> As I remember, it's changed from KERN_DEBUG to KERN_INFO from adrian request.
> I think you worry the ecc error message. If so, how about to change
> the ecc message itself? e.g. ecc info
> Also controller info instead of controller error.

Yeah, may be. It is just that we keep getting questions like
"is this harmful?". Probably it is indeed better to tweak the
message itself and make it look less worrying.

Patch

diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 6e82909..994939e 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -1450,7 +1450,7 @@  static int onenand_bbt_wait(struct mtd_info *mtd, int state)
 	if (interrupt & ONENAND_INT_READ) {
 		int ecc = onenand_read_ecc(this);
 		if (ecc & ONENAND_ECC_2BIT_ALL) {
-			printk(KERN_INFO "onenand_bbt_wait: ecc error = 0x%04x"
+			printk(KERN_DEBUG "onenand_bbt_wait: ecc error = 0x%04x"
 				", controller error 0x%04x\n", ecc, ctrl);
 			return ONENAND_BBT_READ_ECC_ERROR;
 		}