<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 8 Jan 2022, 14:37 Sadanand Warrier, <<a href="mailto:sadanandwarrier@gmail.com">sadanandwarrier@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Fabio<br>
   Thanks for the response. I had already accessed that link that you<br>
have pasted. Michal Nazarewicz also has a few other points on using<br>
CMA.<br>
When I tried to use the API after setting cma=128M on the kernel boot<br>
command line and booted the kernel, the api returned without<br>
allocating memory<br>
when the driver was installed.<br>
The dmesg shows that 128M was reserved for CMA but dma_alloc_coherent failed.<br>
It seems that default CentOS and perhaps Ubuntu kernels are not<br>
compiled with CONFIG_DMA_CMA=yes for the dma_alloc_coherent to work.<br>
I'm not sure if this is a valid assumption. I haven't tried<br>
recompiling the kernel yet with that option set.<br>
>From what I have managed to eke out we need CONFIG_CMA=yes and<br>
CONFIG_DMA_CMA=yes too.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">If I recall it well, I think they are needed. Why haven't you yet checked?</div><div dir="auto"><br></div><div dir="auto">I assume that you know how to change your .config, re-build the kernel and the modules and install everything in the right places. Don't you?<br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Just grep  the ".config" of your distro. It should be placed in /boot/ with a name like "config-`uname -r`" or in /usr/src/linux/ with its true name (.config) and see if those options are enabled. Or you may use directly "make menuconfig" and search with its special keys. Then "make -jN && sudo make modules_install install" (and hope that installkernel is not broken like it has been in openSUSE Tumbleweed for weeks).  :(</div><div dir="auto"><br></div><div dir="auto">I'm not an expert about this particular subject, so if they have already been  enabled I cannot help you with more than the above information. That article in <a href="http://lwn.net">lwn.net</a> is everything I've studied about this subject and I haven't ever used it in kernel programming.</div><div dir="auto"><br></div><div dir="auto">Regards,</div><div dir="auto"><br></div><div dir="auto">Fabio M. De Francesco </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks<br>
S<br>
<br>
<br>
On Sat, 8 Jan 2022 at 07:23, FMDF <<a href="mailto:fmdefrancesco@gmail.com" target="_blank" rel="noreferrer">fmdefrancesco@gmail.com</a>> wrote:<br>
><br>
> On Tue, 21 Dec 2021, 15:36 Sadanand Warrier, <<a href="mailto:sadanandwarrier@gmail.com" target="_blank" rel="noreferrer">sadanandwarrier@gmail.com</a>> wrote:<br>
>><br>
>> Hello<br>
>>     Is CMA still supported as described in this document<br>
>> <a href="https://lwn.net/Articles/396707/" rel="noreferrer noreferrer" target="_blank">https://lwn.net/Articles/396707/</a> ?<br>
><br>
><br>
> Yes, it is.<br>
><br>
> Read the following instructions on how to use that feature:<br>
><br>
> "A deep dive into CMA" at<br>
> <a href="https://lwn.net/Articles/486301/" rel="noreferrer noreferrer" target="_blank">https://lwn.net/Articles/486301/</a><br>
><br>
> Regards,<br>
><br>
> Fabio M. De Francesco<br>
><br>
</blockquote></div></div></div>