IRQ Affinity in kernel 4.9.11

cancel
Showing results for 
Search instead for 
Did you mean: 

IRQ Affinity in kernel 4.9.11

533 Views
zc_tee
Contributor III

Hi all,

Currently we are porting our kernel for I.MX6Dual platform from 3.0.101 to 4.9.11.

After struggling for quite some time, we finally manage to port the kernel and boot up our system.

However, we found out one issue on the interrupt handling for the 4.9.11. We realise that in kernel 4.9.11, one of our timing critical GPIO interrupt, is always "interrupted" by other process, and it makes our system unstable.

We had tried to set the affinity of GPIO interrupts to CPU1, but the problem still happens. cat /proc/interrupts shows below:

pastedImage_1.png

May we know what is the thing that keeps interrupting our GPIO interrupt in this case? This problem does not happens at kernel 3.0.101. What is changed from interrupt handling wise, from kernel 3.0.101 to 4.9.11?

We compared the /proc/interrupt of 3.0.101, one thing we found out is that in kernel 4.9.11, it uses twd as system timer watchdog, and this interrupt is high up at number 16. 

In kernel 3.0.101, there is no twd timer, but there is a LOC column, at the bottom of the /proc/interrupt.

Below is the screenshot for /proc/interrupt for kernel 3.0.101

pastedImage_2.png

Could this be the cause of the "interruption" to our GPIO interrupt?

Thank you.

Regards,
Tee

Labels (4)
0 Kudos
2 Replies

289 Views
jamesbone
NXP TechSupport
NXP TechSupport

Which is your GPIO interrupt in cat /proc/interrupt command list?How do you register the GPIO interrupt? It would be helpful in debugging if you provide the source.

I am sharing the GPIO interrupt driver here  for the reference.

0 Kudos

289 Views
zc_tee
Contributor III

Hi James,

The GPIO interrupt is the interrupt names "stepper" in the previous screenshot of the /proc/interrupt.

Below are the source that we initialize and set the irq for this GPIO

gpio_request(PIN_PRINT_DATA_REQ);
gpio_direction_input(PIN_PRINT_DATA_REQ); //in
set_irq_type(PIN_PRINT_DATA_REQ, IRQ_TYPE_EDGE_FALLING);

// interrupt is disabled at the initialization and is enabled only when needed
ret = request_irq(_gpio_to_irq(PIN_PRINT_DATA_REQ), (void *)stepper_isr, IRQF_TRIGGER_NONE, MODULE_NAME, MODULE_NAME);

//enabling GPIO interrupt

enable_irq(_gpio_to_irq(PIN_PRINT_DATA_REQ));

Are we doing it correctly?

Thank you.

Regards,

Tee

0 Kudos