dma_alloc_coherent irqs off too long

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

dma_alloc_coherent irqs off too long

1,458 次查看
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 项奖励
回复
1 回复

1,242 次查看
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 项奖励
回复