Herrera-Bendezu, Luis wrote:
>> -----Original Message-----
>> From: Gilles Chanteperdrix [mailto:[email protected]]
>> Sent: Tuesday, January 11, 2011 6:28 PM
>> To: Herrera-Bendezu, Luis
>> Cc: [email protected]
>> Subject: Re: [Xenomai-help] [Xenomai -help] User space access to DMA memory
>>
>> Gilles Chanteperdrix wrote:
>>> Herrera-Bendezu, Luis wrote:
>>>> On 01/05/2011 5:29 PM Gilles Chanteperdrix wrote:
>>>>> Steven A. Falco wrote:
>>>>>> On 01/05/2011 04:33 PM, Gilles Chanteperdrix wrote:
>>>>> Ok. Could you try to do the same operation with the native API? You just
>>>>> have to pass H_SHARED | H_DMA | H_NONCACHED as flags to rt_heap_create
>>>>> to get the same effect as pci_dma_alloc_coherent.
>>>>>
>>>>> Just to see if the error lies in RTDM implementation or in Xenomai
>>>>> generic code.
>>>>>
>>>>>
>>> (...)
>>> What about the other thing I asked you to test?
>>>
>> Ping? Any news about this test?
> 
> rt_heap_create() with flags H_SHARED | H_DMA | H_NONCACHED report -EINVAL.
> Documentation indicates that H_NONCACHE is not compatible with H_DMA.

Right, supporting H_NONCACHED | H_DMA would mean that we would have to
use kmalloc/get_free_pages then establish a non-cached mapping in
kernel-space with vm_map_ram.

Could you try with H_NONCACHED, but without H_DMA? Of course, the
mapping can not be used for DMA, as it will probably not be physically
contiguous, but at least you can try whether accessing in user-space a
non-cached mapping works.

In any case, we see a defect in the RTDM interface here: we can not ask
the mapping to be mapped non-cacheable, which somewhat defeats the
purpose of pci_alloc_consistent. I do not know enough the powerpc
architecture to know whether this could be the cause of your issue (the
same physical area mapped twice, once cached, once non-cached). However,
on the ARM architecture, for instance, it is bad.


-- 
                                            Gilles.

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to