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++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12455 Discussions

Problem with IRQs. Linux freezing.

Altera_Forum
Honored Contributor II
826 Views

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; }  

 

INIT_IRQ 

/* 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
Altera_Forum
Honored Contributor II
96 Views

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

 

 

EDIT: 

 

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

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

Reply