LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 03-10-2019, 07:34 AM   #1
zvivered
Member
 
Registered: Sep 2007
Posts: 294

Rep: Reputation: 23
DMA with SMMU enabled


Hello,

I'm working with 4.4.38 installed on NVIDIA's TX2.
This an ARM architecture.
The SMMU is enabled.

The SBC receives data with DMA from a PCIe endpoint.

Can I use: dma_alloc_coherent to get contiguous physical buffer ?

Or should I use another DMA API ?

The original code is:
Code:
memset(&pdma->cioque, 0, sizeof(struct gefspa_ioque_t));
	memset(&pdma->ciobuf, 0, sizeof(struct gefspa_iobuf_t));

	if (NULL == (pdma->ciobuf.maplist = (struct page **) kmalloc(pdma->maxpages * sizeof(struct page*), GFP_KERNEL))) {
		return -ENOMEM;
	}
	memset(pdma->ciobuf.maplist, 0, pdma->maxpages * sizeof(struct page*));

	if(NULL == (pdma->sglist = (void*) __get_dma_pages(GFP_KERNEL, __get_order(pdma->maxpages*entrysz)))) {
		kfree(pdma->ciobuf.maplist);
		pdma->ciobuf.maplist = NULL;
		return -ENOMEM;
	}
	memset(pdma->sglist, 0, pdma->maxpages*entrysz);

	pdma->sgsize    = entrysz;
	pdma->sgbusaddr = virt_to_phys(pdma->sglist);
But virt_to_phys cause the following kernel oops:
[ 3368.052470] arm-smmu 12000000.iommu: Unhandled context fault: iova=0xea9e8000, fsynr=0x1, cb=22, sid=17(0x11 - AFI), pgd=0, pud=0, pmd=0, pte=0
[ 3368.313623] irq 55: nobody cared (try booting with the "irqpoll" option)

Thank you,
Zvika
 
  


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
How DMA capable ga-p35-ds3?? SATA disks wont set dma on! stardotstar Linux - Hardware 7 03-24-2008 02:58 AM
Hard Drive Problems: timeout waiting for DMA; error waiting for DMA mintee Linux - Hardware 10 09-21-2007 05:06 AM
Help! Xine is killing DMA, I can't make DMA stick! husten SUSE / openSUSE 5 02-27-2007 01:20 AM
DMA works but not by default (despite "use DMA by default" kernel) mehlkelm Linux - Hardware 7 04-11-2005 03:29 PM
Suse 8.2 change my DMA setting on my DVD-R drive to off & IDE DMA MODE NOT SHOWING IT maximalred Linux - General 0 08-23-2003 04:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 02:39 AM.

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