From: Dave H. <dhy...@gm...> - 2005-09-30 15:04:00
|
Hi ashutosh, > I am trying to build kernel module to handle the interrupt generated > by nssp in the gumstix > The process followed is as follows > firstly created a kernel module registered it as the charter device( > which can be seen by lsmod) > registered a interrupt(number 9 i.e. the NSSP_IRQ value) handler which > is viewable by 'cat /proc/interrupts' > currently there in no hardware connected to nssp pins but using it in > the loopback mode > and trying to get interrupt by > -->interrupt test register > -->timeout register > -->receive/transmit fifo service request > but in all cases the system hang and is required to be restarted by > switching off and then on the power supply > also, i am using preloaded kernel It would be useful to see the entire c file (and any associated header files) as well as the console output. I'll throw out some comments based on what you did include: 1 - Your prototype for the interrupt routine is slightly wrong. I'm suprised you didn't get a warning on the call to request_irq. The correct prototype is: irqreturn_t nssp_interrupt( int irq, void *_dev, struct pt_regs *r) and you NEED to return something (like IRQ_HANDLED). Since your routine is declared void, you'll get some random return value. 2 - I don't see where sem is initialized. Calling down on an unintialized semaphore wouldn't be good. 3 - Your "delay" in the nssp_init routine using: for(i=3D0;i<1000;i++); will almost certainly be optimized away. You'd be better off you use ndelay or mdelay functions. 4 - Because I can't what regs is initialized to, I'm not sure if it's memory or pointing to the registers. If it's memory, then I don't see where you're enabling the interrupts. If it points to the hardware, then you're enabling the interrupts before you register an interrupt handler. 5 - When you built your module, are you sure that the kernel that's runnng on the gumstix matches the kernel in your buildroot? I always like to download my built root_fs_arm so that I can be sure everything matches. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |