Delay in handling GPIO Interrupt imx6

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

Delay in handling GPIO Interrupt imx6

1,294 Views
vijeshreddy
Contributor I

I am using imx6 phyboard, I have interfaced an external ADC using SPI, I am accessing SPI using /dev/mem .

I will get an ADC Interrupt (high to low transition) once in very 90uSec. and I will read the samples data from ADC. I have configured a GPIO in interrupt mode and I am polling the status register to check whether interrupt has occurred or not ( There is no interrupt service routine) and every thing looks  fine until here .

The time gap between each interrupt is 90uSec and most of the times  imx6 is reading the samples data within 30usec,  however some times imx6 is taking around 80uSec (or even more )to respond after interrupt has occurred and as a result data is getting missed - Here interrupt is not getting missed , it is served late.

I am suspecting whether my process is scheduled out by the operating system? Is there any method to block all other processes when I am reading ADC?

Please let me know your views.

Thanks in advance.

0 Kudos
2 Replies

762 Views
jiriluznicky
Contributor III

Hi,

which kernel version do you use? We have probably similar problem since we switched from 4.6 to 4.14-rc2. Since then we're sometimes getting ~200us bonus delay until interrupt routine is called.


Jiri

0 Kudos

762 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi vijesh,

you may handle the interrupt with a kernel module. In the following thread I shared a code to do that, it will be useful.

Issue with configuring GPIO as an interrupt - i.MX6Q 


Regards,
Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos