dma_alloc_coherent irqs off too long

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

dma_alloc_coherent irqs off too long

1,439 Views
don1097
Contributor I


We are using the IMX6Dual and during startup we are missing characters on one of the Uarts.

We tried using DMA for the Uart and adjusting the receive threshold but no luck.

We noticed that it happens during the insmod of the galcore.ko driver.

Finally ran ftrace for irqsoff and discovered the irqs are off for 1165us and as much as 1700us.

The Uart is running at 230kbaud which translates to 43us/char with a 32 byte fifo.  Overrun occurs at 1419us.

Why is this taking so long?

# tracer: irqsoff

#

  insmod-291     0d..1    0us!: __raw_spin_lock_irqsave

  insmod-291     0d..1 1163us+: _raw_spin_unlock_irqrestore

  insmod-291     0d..1 1165us : trace_hardirqs_on <-_raw_spin_unlock_irqrestore

  insmod-291     0d..1 1166us : <stack trace>

=> __dma_alloc

=> dma_alloc_coherent

=> gckOS_AllocateNonPagedMemory

=> gckOS_AllocateContiguous

=> _Construct

=> gckMMU_Construct

=> gckKERNEL_Construct

=> gckGALDEVICE_Construct

0 Kudos
Reply
1 Reply

1,223 Views
Yuri
NXP Employee
NXP Employee

Looks like Linux implementation of DMA API to handle coherency between CPUs and external devices
(when accessing the same physical memory) is not intended for real time applications.

0 Kudos
Reply