LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-24-2021, 03:28 PM   #1
zvivered
Member
 
Registered: Sep 2007
Posts: 294

Rep: Reputation: 23
dma_alloc_coherent


Hello,

Under Centos 8.2(x64) I'm using dma_alloc_coherent to allocate a contiguous RAM used for DMA from FPGA to RAM.

How can I set this area to be not cacheable ?

Is this really a coherent buffer ?

If yes, then O.S should invalidate the cache automatically so that I always read a fresh data from cache.

In what case I should also use dma_map_single and also dma_alloc_coherent ?

Thank you,
Zvika
 
Old 11-24-2021, 05:19 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,622

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by zvivered View Post
Hello,
Under Centos 8.2(x64) I'm using dma_alloc_coherent to allocate a contiguous RAM used for DMA from FPGA to RAM. How can I set this area to be not cacheable? Is this really a coherent buffer? If yes, then O.S should invalidate the cache automatically so that I always read a fresh data from cache. In what case I should also use dma_map_single and also dma_alloc_coherent?
You should use whatever 'case' is applicable to your custom OS/kernel/hardware/embedded system/FPGA device. As you've been told now for 13 years. Two of the MANY hits for what you're asking, from a brief Google search:
https://stackoverflow.com/questions/...alloc-coherent
https://www.kernel.org/doc/Documentation/DMA-API.txt

May also want to check some of your own threads from more than *THIRTEEN YEARS AGO* that have some similarity:
https://www.linuxquestions.org/quest...rrupts-686156/
https://www.linuxquestions.org/quest...driver-842776/

See any of your other threads where you claim to be developing a kernel driver, and have an FPGA engineer on your 'team' helping you:
https://www.linuxquestions.org/quest...er-4175632357/

Again, as you've been told repeatedly:
  • We do not have your custom hardware
  • We do not have your code
  • We do not have your module
  • You WILL NOT tell us what this device is
  • You WILL NOT tell us what it does or what your goals are
And since we have NONE of this, there is *NOTHING* we can do to assist. We can't guess, and we aren't here to debug your code or look up links to the documentation. Sorry to sound nasty, but it's true. If you're a kernel developer who has been working on such things for 13 years, what do you think we can tell you? Especially since you aren't giving us any details??
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot write a dma_alloc_coherent() allocated buffer to SSD with O_DIRECT flag ComiXZonE Programming 1 09-05-2018 07:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration