- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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, ¤t_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;
}
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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..- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I changed my PIO irq from Level to Edge and everything works fine
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page