All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Zhang <macromarship@gmail.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: ubifs_decompress: cannot decompress 2293 bytes, compressor lzo, error -22
Date: Tue, 19 Apr 2022 10:05:49 +0800	[thread overview]
Message-ID: <CABy3iKwAVYkstq4=fg6cjh4VRAzSwGa7JNy494Ag69e_t9UTjA@mail.gmail.com> (raw)
In-Reply-To: <20220415102929.5c654933@xps13>

Dear Miquel:
     I have fixed the nuc980 nand driver, now the nandbiterrors works.

# ./nandbiterrs /dev/mtd3 -i
incremental biterrors test
Successfully corrected 0 bit errors per subpage
Inserted biterror @ 0/5
Read reported 1 corrected bit errors
Successfully corrected 1 bit errors per subpage
Inserted biterror @ 0/2
Read reported 2 corrected bit errors
Successfully corrected 2 bit errors per subpage
Inserted biterror @ 0/0
Read reported 3 corrected bit errors
Successfully corrected 3 bit errors per subpage
Inserted biterror @ 1/7
Read reported 4 corrected bit errors
Successfully corrected 4 bit errors per subpage
Inserted biterror @ 1/5
Read reported 5 corrected bit errors
Successfully corrected 5 bit errors per subpage
Inserted biterror @ 1/2
Read reported 6 corrected bit errors
Successfully corrected 6 bit errors per subpage
Inserted biterror @ 1/0
Read reported 7 corrected bit errors
Successfully corrected 7 bit errors per subpage
Inserted biterror @ 2/6
Read reported 8 corrected bit errors
Successfully corrected 8 bit errors per subpage
Inserted biterror @ 2/5
Failed to recover 1 bitflips
Read error after 9 bit errors per page

But I noticed the lzo decompress error is still there.
I did  following actions to test.
/dev/mtd3 is mounted on /opt using ubifs.
tar zcvf /root/opt.tar.gz /opt  (done without error)
format /opt.
tar zxvf /root/opt.tar.gz -C /

Then when I run php program which is in opt. I saw dmesg
[  118.850000] UBIFS error (ubi0:0 pid 1526): ubifs_decompress: cannot
decompress 2293 bytes, compressor lzo, error -22
[  118.860000] UBIFS error (ubi0:0 pid 1526): do_readpage: bad data
node (block 15, inode 396)
[  118.870000] UBIFS error (ubi0:0 pid 1526): do_readpage: cannot read
page 15 of inode 396, error -22
[  118.880000] UBIFS error (ubi0:0 pid 1526): ubifs_decompress: cannot
decompress 2293 bytes, compressor lzo, error -22
[  118.900000] UBIFS error (ubi0:0 pid 1526): do_readpage: bad data
node (block 15, inode 396)
[  118.900000] UBIFS error (ubi0:0 pid 1526): do_readpage: cannot read
page 15 of inode 396, error -22
[  118.920000] UBIFS error (ubi0:0 pid 1526): ubifs_decompress: cannot
decompress 2293 bytes, compressor lzo, error -22
[  118.930000] UBIFS error (ubi0:0 pid 1526): do_readpage: bad data
node (block 15, inode 396)
[  118.940000] UBIFS error (ubi0:0 pid 1526): do_readpage: cannot read
page 15 of inode 396, error -22

I removed the ubifs_dump_node call to avoid many dump text. The
problem is when I run php program, lots of above logs dumped.
But I don't see any effect of the above logs. the program seems running.
Is there a possibility the underlying nand driver data is ok, but the
lzo compress/decompress code has bugs ?  I am running linux-5.4.y
cloned from kernel.org.

On Fri, Apr 15, 2022 at 4:29 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hi Scott,
>
> macromarship@gmail.com wrote on Fri, 15 Apr 2022 12:38:09 +0800:
>
> > Hi. Miquèl.
> > Yes. I tried nandbiterrs, the result is below. Looks ecc is not working .
> >
> > [root@jgcx: ~]#./nandbiterrs /dev/mtd2 -i
> > incremental biterrors test
> > Successfully corrected 0 bit errors per subpage
> > Inserted biterror @ 0/5
> > Failed to recover 1 bitflips
> > Read error after 1 bit errors per page
> >
> > By checking the nand driver whichi is nuc980_nand.c
> >
> > https://github.com/OpenNuvoton/NUC980-linux-4.4.y/blob/master/drivers/mtd/nand/nuc980_nand.c
> >
> >
> > * Enable HW ECC : unused on most chips
> > */
> > void nuc980_nand_enable_hwecc(struct mtd_info *mtd, int mode)
> > {
> > ENTER();
> > #ifdef NUC980_NAND_DEBUG
> > {
> > char * ptr=REG_SMRA0;
> > int i=0;
> > if( mode == NAND_ECC_READ )
> > printk("[R]=\n");
> > else
> > printk("[W]=\n");
> >
> > for(i=0; i<mtd->oobsize; i++)
> > {
> > printk("%X ", *(ptr+i) );
> > if ( i % 32 == 31)
> > printk("\n");
> > }
> > printk("\n");
> > }
> > #endif
> > LEAVE();
> > }
> >
> >
> > I guess the nuc980 driver doesn't support ecc correction.
>
> You cannot use NAND without proper ECC handling.
>
> Thanks,
> Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2022-04-19  2:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14 16:45 ubifs_decompress: cannot decompress 2293 bytes, compressor lzo, error -22 Scott Zhang
2022-04-14 17:24 ` Miquel Raynal
2022-04-15  4:38   ` Scott Zhang
2022-04-15  8:29     ` Miquel Raynal
2022-04-19  2:05       ` Scott Zhang [this message]
2022-04-19  7:33         ` Miquel Raynal
2022-04-19  7:44           ` Richard Weinberger
2022-04-19  9:03             ` Scott Zhang
2022-04-19  9:11               ` Scott Zhang
2022-04-20  3:00                 ` Scott Zhang
2022-04-20  6:26                   ` Richard Weinberger

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='CABy3iKwAVYkstq4=fg6cjh4VRAzSwGa7JNy494Ag69e_t9UTjA@mail.gmail.com' \
    --to=macromarship@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.