El 11 de octubre de 2011 19:12, Alexis Berlemont <[email protected]
> escribió:
> Hi,
>
> Sorry for answering late.
>
Well, thanks for answering ;)
>
> I took some time to compare both versions of code (comedi and
> analogy). I did not find anything interesting in mite.c. I was about
> to ask you to increase verbosity (debug + a specific patch) when I got
> a glimpse on the allocation of the asynchronous buffer on the comedi
> side.
>
> The methods are not the same at that level:
> - comedi: n * dma_alloc_coherent + a vmap at the end
> - analogy: a big vmalloc + n * page_to_phys(vmalloc_to_page(vaddr)
>
> I don't understand the reason why the analogy way is not correct, I
> did not have time to check yet. If anyone has any idea, please help
> me.
>
> However, the NI mite expects 32 bit addresses... (because of
> cpu_to_le32 in the mite driver).
>
> If I remember well, you are using a 64-bit architecture. Is it
> correct? There may be a bug here; analogy might give to the mite
> physical addresses which are not below 2^32.
>
That's right, I'm on a 64bit machine. This sounds very reasonable to me.
> So, could you:
> - with comedi, add some printk("%lx") in mite_buf_change so as to dump
> the pages physical addresses
> - with analogy, do the same thing in a4l_mite_buf_change.
>
Ok, I'v only performed the analogy tests so far, and here are the results:
[ 172.627662] Analogy: sizeof(dma_addr_t) = 8
[ 172.627663] Analogy: ring->descriptors_dma_addr = c740d000
[ 172.627665] Analogy: cpu_to_le32(ring->descriptors_dma_addr) = c740d000
[ 172.627666] Analogy: buf->pg_list[0] = 19d806000
[ 172.627667] Analogy: buf->pg_list[1] = 1a9095000
[ 172.627668] Analogy: buf->pg_list[2] = 19d552000
[ 172.627669] Analogy: buf->pg_list[3] = 19eb93000
[ 172.627671] Analogy: buf->pg_list[4] = 1a91fc000
[ 172.627672] Analogy: buf->pg_list[5] = 1a9203000
[ 172.627673] Analogy: buf->pg_list[6] = 19d9c1000
[ 172.627674] Analogy: buf->pg_list[7] = 19ebff000
[ 172.627675] Analogy: buf->pg_list[8] = 19eacb000
[ 172.627676] Analogy: buf->pg_list[9] = 1a905d000
[ 172.627677] Analogy: buf->pg_list[10] = 1a9050000
[ 172.627678] Analogy: buf->pg_list[11] = 1a9174000
[ 172.627679] Analogy: buf->pg_list[12] = 1aa791000
[ 172.627680] Analogy: buf->pg_list[13] = 1aa635000
[ 172.627682] Analogy: buf->pg_list[14] = 1aa7fb000
[ 172.627683] Analogy: buf->pg_list[15] = 19dae5000
These are printed right after the call to "pci_alloc_consistent()" and in
the subsequent "for" loop. So if I understand it right,
"ring->descriptors_dma_addr" represents the base physical address that DMA
transfers will access? And then, "buf->pg_list" are virtual addresses or
virtual page indexes?
I'll check those values in comedi and let you know.
Thanks a lot for your effort!
Fernando
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help