ubifs_decompress: cannot decompress 2293 bytes, compressor lzo, error -22

Miquel Raynal miquel.raynal at bootlin.com
Tue Apr 19 00:33:17 PDT 2022


Hi Scott,

+Richard

macromarship at gmail.com wrote on Tue, 19 Apr 2022 10:05:49 +0800:

> 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

Did you run the various nand tests besides nandbiterrs? If they all
pass then maybe Richard will be more helpful than I am...

> 
> 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 at bootlin.com> wrote:
> >
> > Hi Scott,
> >
> > macromarship at 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 at 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  


Thanks,
Miquèl



More information about the linux-mtd mailing list