Restrict DMA Buffer to 32 bit Address

Tal Lubko tallubko at yahoo.com
Wed Jan 13 22:44:36 EST 2021


 Hi
I've PCI device which uses DMA engines and runs on 64 bit Linux with 512MB RAM.It has 32 bit register used to specify DMA buffer address so as far as I understand I need to restrict it DMA buffers addresses to 32 bit.
I tried the following:
err = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));if (err) {    exit...}
dma_alloc_coherent(dev, 0x1000, &dma_handle, GFP_KERNEL)
but when I print allocated buffer address I get the following 0x409993216
What am I missing here?
Thanks,Tal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20210114/9a75cf65/attachment.html>


More information about the Kernelnewbies mailing list