LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Is Interrupt Nesting enabled by default ? (https://www.linuxquestions.org/questions/linux-kernel-70/is-interrupt-nesting-enabled-by-default-4175510539/)

eyalrt 07-09-2014 01:25 AM

Is Interrupt Nesting enabled by default ?
 
Using kernel 2.6.22. Running IMX.31 arm 11 processor. Compiler and debugger supplied by Freescale.
Sometime a call to a libMath function, like sin() calculation returns with unpredictable values, causing my task to crash.
I have managed to isolate the problem to a use of timer. A timer driver I have wrote, using the IMX.31 timers. If I do no use the timer, no unpredictable values.
I have attached my timer ISR handling. It looks OK to me: Disabling the interrupt, waking a task, enabling the interrupt back and leave.
I use only variables on my stack. Local variables.

1. I will be most thankfull if someone will see something I have missed.
2. Does the linux kernel has interrupt nesting enebled by default? If yes, how can I disable it? This can explain some of the problems I see. I thought interrupt nesting is something that you have to spacially enable.
3. If I want to get the task context, in which the interrupt has accured. How can I get it out? Can I do this using /proc file system ?

Thank you,

Eyal.


static int imx31_timer_interrupt(int irq, void *dev_id)
{
u32 reg;
u32 epitsr;
unsigned long flags;
struct elbit_timer *timer = dev_id;

epitsr = __raw_readl(MXC_EPITSR(timer->base));

/* Disable interrupt */
reg = __raw_readl(MXC_EPITCR(timer->base));
reg &= ~EPITCR_OCIEN;
__raw_writel(reg, MXC_EPITCR(timer->base));

/* Clear interrupt */
__raw_writel(EPITSR_OCIF, MXC_EPITSR(timer->base));

/* Flag interrupt arrival */
spin_lock_irqsave(&timer->irqlock, flags);
timer->irq_arrived = 1;
spin_unlock_irqrestore(&timer->irqlock, flags);

/* Wake up process waiting for timer to expire */
wake_up_interruptible(&timer->pollw);

/* Enable interrupt */
reg = __raw_readl(MXC_EPITCR(timer->base));
reg |= EPITCR_OCIEN;
__raw_writel(reg, MXC_EPITCR(timer->base));

return IRQ_HANDLED;
}


All times are GMT -5. The time now is 12:15 AM.