Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
The Intel sign-in experience is changing in February to support enhanced security controls. If you sign in, click here for more information.
12486 Discussions

Problem with IRQs. Linux freezing.

Honored Contributor II

Hello i've made a design consisting of a CPU, SDRAM, PHY and etc. 

Then i made a character device driver to recieve IRQs from a VHDL block i've made, my VHDL block generates a high signal at a 60hz frequency. 


However my Linux freezes after a certain time (like 1minute), why is that? 


If i comment the line in my device driver that register the IRQ everything works fine and the linux never freezes! 


My device driver implementation is the follow: 


Read function: 

ssize_t shmem_read(struct file *filep ,char *buff, size_t count, loff_t *offp) { int retval; int temp = 0; interruptible_sleep_on(&readw); retval = copy_to_user(buff, &current_cycle, sizeof(raw_cycle_t)); if (retval != 0) { printk(KERN_ERR "Kernel to userspace copy failed!\n" ); return retval; } return count; }  


IRQ handler 

static irqreturn_t io_irq_handler(int irq, void *dev_id) { wake_up_interruptible(&readw); outl(0xf, &pio_in->np_pioedgecapture); return IRQ_HANDLED; }  



/* IRQ PIO INPUT INIT */ io_irq = PIO_IRQ; enable_irq(io_irq); ret = request_irq(io_irq, &io_irq_handler, 0, DRIVER_NAME, &io_irq); if (ret) { printk(KERN_ERR __FILE__ ": Error while requesting IRQ, during %s\n", __FUNCTION__); return ret; }
0 Kudos
2 Replies
Honored Contributor II

I guess i was having a deadlock.. when i run it with realtime process priority i have no problems. 





NVM just had the same problem after a longer time..
Honored Contributor II

I changed my PIO irq from Level to Edge and everything works fine