All of lore.kernel.org
 help / color / mirror / Atom feed
* UBI/UBIFS: debugging help
@ 2015-03-13 18:11 Renaud Barbier
  2015-03-13 18:42 ` Richard Weinberger
  2015-03-17 18:31 ` Renaud Barbier
  0 siblings, 2 replies; 4+ messages in thread
From: Renaud Barbier @ 2015-03-13 18:11 UTC (permalink / raw)
  To: linux-mtd

My platform is based on a ARM Cortex-A9 and boots barebox from a spi-nor.

I have tested UBI/UBIFS from Linux on this platform with no issue after
disabling 4KB support for the spi nor I am using.

However, I got problem on the boot loader side. UBI/UBIFS has been
ported by the barebox community from Linux and I used it successfully
on a previous project on a PPC platform.

On the ARM platform I can ubiattach, mount the mtd partition and copy a
small file (~65KB spanning two sectors). The issue comes when I copy out
a larger file (512KB) out. It fails to copy the whole file.

At the point of failure, ubifs_tnc_locate fails resulting in the
function read_block to return -ENOENT.

Debugging shows that in the function ubifs_search_zbranch no keys match
is found prior to the failure.

I know this list is called linux-mtd but I was hoping that somebody
could give me a pointer on where to look next. I am currently going
through git logs and mailing list.

I am pretty confident the boot loader spi driver is working properly as
raw write-read-compare have not failed.

cheers.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: UBI/UBIFS: debugging help
  2015-03-13 18:11 UBI/UBIFS: debugging help Renaud Barbier
@ 2015-03-13 18:42 ` Richard Weinberger
  2015-03-16 18:10   ` Renaud Barbier
  2015-03-17 18:31 ` Renaud Barbier
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Weinberger @ 2015-03-13 18:42 UTC (permalink / raw)
  To: Renaud Barbier; +Cc: linux-mtd

On Fri, Mar 13, 2015 at 7:11 PM, Renaud Barbier <renaud.barbier@ge.com> wrote:
> My platform is based on a ARM Cortex-A9 and boots barebox from a spi-nor.
>
> I have tested UBI/UBIFS from Linux on this platform with no issue after
> disabling 4KB support for the spi nor I am using.
>
> However, I got problem on the boot loader side. UBI/UBIFS has been
> ported by the barebox community from Linux and I used it successfully
> on a previous project on a PPC platform.
>
> On the ARM platform I can ubiattach, mount the mtd partition and copy a
> small file (~65KB spanning two sectors). The issue comes when I copy out
> a larger file (512KB) out. It fails to copy the whole file.
>
> At the point of failure, ubifs_tnc_locate fails resulting in the
> function read_block to return -ENOENT.
>
> Debugging shows that in the function ubifs_search_zbranch no keys match
> is found prior to the failure.
>
> I know this list is called linux-mtd but I was hoping that somebody
> could give me a pointer on where to look next. I am currently going
> through git logs and mailing list.

In such situations I start with testing all layers bottom up.
1. Does the MTD driver work (I mean really work)
2. Does UBI work correctly? (ubi tests, etc...)
3. Same for UBIFS

HTH,
//richard

-- 
Thanks,
//richard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: UBI/UBIFS: debugging help
  2015-03-13 18:42 ` Richard Weinberger
@ 2015-03-16 18:10   ` Renaud Barbier
  0 siblings, 0 replies; 4+ messages in thread
From: Renaud Barbier @ 2015-03-16 18:10 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: linux-mtd

Thanks.

I just found that after moving the files out and copying them  back
under Linux, then copying out the files works under barebox.
I will see how Linux handles the same PEBs read, maybe that will give me
a clue.




On 13/03/2015 18:42, Richard Weinberger wrote:
> On Fri, Mar 13, 2015 at 7:11 PM, Renaud Barbier <renaud.barbier@ge.com> wrote:
>> My platform is based on a ARM Cortex-A9 and boots barebox from a spi-nor.
>>
>> I have tested UBI/UBIFS from Linux on this platform with no issue after
>> disabling 4KB support for the spi nor I am using.
>>
>> However, I got problem on the boot loader side. UBI/UBIFS has been
>> ported by the barebox community from Linux and I used it successfully
>> on a previous project on a PPC platform.
>>
>> On the ARM platform I can ubiattach, mount the mtd partition and copy a
>> small file (~65KB spanning two sectors). The issue comes when I copy out
>> a larger file (512KB) out. It fails to copy the whole file.
>>
>> At the point of failure, ubifs_tnc_locate fails resulting in the
>> function read_block to return -ENOENT.
>>
>> Debugging shows that in the function ubifs_search_zbranch no keys match
>> is found prior to the failure.
>>
>> I know this list is called linux-mtd but I was hoping that somebody
>> could give me a pointer on where to look next. I am currently going
>> through git logs and mailing list.
> 
> In such situations I start with testing all layers bottom up.
> 1. Does the MTD driver work (I mean really work)
> 2. Does UBI work correctly? (ubi tests, etc...)
> 3. Same for UBIFS
> 
> HTH,
> //richard
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: UBI/UBIFS: debugging help
  2015-03-13 18:11 UBI/UBIFS: debugging help Renaud Barbier
  2015-03-13 18:42 ` Richard Weinberger
@ 2015-03-17 18:31 ` Renaud Barbier
  1 sibling, 0 replies; 4+ messages in thread
From: Renaud Barbier @ 2015-03-17 18:31 UTC (permalink / raw)
  To: linux-mtd

 I have added debug messages in the Linux UBIFS driver (I am using Linux
3.14) and noticed as well that read_block returns -ENOENT several times
toward the end of the copy of a file (512KB). Though, the Linux system
is able to read the whole file correctly (checksum is correct).

The boot loader however bails out on error.

The read_block  issue disappears if I delete, copy it back and remount
the UBIFS file system.

Below is the way I create the UBI image before formatting the SPI-nor:
# mkfs.ubifs -vv -F -d boot -m 1 -e 65408 -c 380  -U -x lzo -o boot.img
# ubinize -v -o test3_nor.img -p 64KiB -m 1 ubinize.cfg

with ubinize.cfg:
# Section header
[boot]
mode=ubi
# Source image
image=boot.img
# Volume ID in UBI image
vol_id=0
# Volume size
vol_size=25MiB
# Allow for static resize
vol_type=dynamic
# Volume name
vol_name=boot

So in summary, if I ubiformat the partition from Linux with a ubi image,
the Linux UBIFS driver function read_block returns ENOENT during file
copy and it completes.
However, if I copy a file to the UBIFS partition and read back after
re-mounting there is no issue.

Would somebody know whether the parameters to mkfs.ubifs and ubinize
have anything to do with read_block failing?

I created UBI images before for a flash with 128KB sectors and not seen
this problem.

Cheers.


On 13/03/2015 18:11, Renaud Barbier wrote:
> My platform is based on a ARM Cortex-A9 and boots barebox from a spi-nor.
> 
> I have tested UBI/UBIFS from Linux on this platform with no issue after
> disabling 4KB support for the spi nor I am using.
> 
> However, I got problem on the boot loader side. UBI/UBIFS has been
> ported by the barebox community from Linux and I used it successfully
> on a previous project on a PPC platform.
> 
> On the ARM platform I can ubiattach, mount the mtd partition and copy a
> small file (~65KB spanning two sectors). The issue comes when I copy out
> a larger file (512KB) out. It fails to copy the whole file.
> 
> At the point of failure, ubifs_tnc_locate fails resulting in the
> function read_block to return -ENOENT.
> 
> Debugging shows that in the function ubifs_search_zbranch no keys match
> is found prior to the failure.
> 
> I know this list is called linux-mtd but I was hoping that somebody
> could give me a pointer on where to look next. I am currently going
> through git logs and mailing list.
> 
> I am pretty confident the boot loader spi driver is working properly as
> raw write-read-compare have not failed.
> 
> cheers.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-17 18:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-13 18:11 UBI/UBIFS: debugging help Renaud Barbier
2015-03-13 18:42 ` Richard Weinberger
2015-03-16 18:10   ` Renaud Barbier
2015-03-17 18:31 ` Renaud Barbier

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.