CRC error when mounting UBIFS

Leo Barnes barnes.leo at gmail.com
Fri Jun 4 12:18:26 EDT 2010


You were completely right that the errors were driver related. I
created a test that tested page-aligned/unaligned reads of different
lengths and then managed to spot the error in the driver. I will send
in the test once I have cleaned up the code a bit. Might be useful for
someone else.

A new question:
Background:
The driver in use in the device does all communication with the
NAND-chipset/controller via DMA. Some of the problems I had with the
driver was that UBI in some cases sends vmalloc'd buffers to the
mtd-driver for reading and writing which failed spectacularly (it
might have been kmalloc'd buffers that were not allocated with
GFP_DMA, I'm unsure if DMA would succeed in this case). Since I dont
know exactly how UBI manages it's memory buffers, my question might be
impossible to implement efficiently.

Question:
Would it be possible to make all buffers that are sent to mtd->read()
DMA-friendly?

Best regards,
//Leo

On Thu, Jun 3, 2010 at 5:32 PM, Artem Bityutskiy <dedekind1 at gmail.com> wrote:
> On Thu, 2010-06-03 at 17:14 +0200, Leo Barnes wrote:
>> Hmm, ok. I would have thought the paranoid UBI checks would be able to
>> find driver related problems. I have however now tried creating and
>> mounting ubi/ubifs through nandsim on the device, so ubifs seems to be
>> working well.
>
> Well, with extra self-checks, UBI reads all it writes and verifies, but
> since all writes are aligned, all UBI reads are aligned too.
>
>> I have tried mtd_readtest on the driver which fails when I allow
>> OOB-reads. Since the driver handles ECC in hardware and I dont need to
>> read the OOB-data for the sake of UBI/UBIFS, this should be no
>> problem. When removing the oob-reads from the test, it works
>> perfectly.
>>
>> You are probably right that what fails is unaligned/short reads, since
>> this is exactly the functionality that I had to add to the driver.
>> Does any of the mtd-tests test these kinds of reads? Might be a good
>> addition if not.
>
> I do not remember, you'd need to look into the test. And of course
> patches are welcome.
>
> --
> Best Regards,
> Artem Bityutskiy (Артём Битюцкий)
>
>



More information about the linux-mtd mailing list