nw i got the follwing result when i inserted this module: ---------------------------------------------------------------------- Oct 2 14:46:47 AnkurAggarwal kernel: Ank$: Hello module registered successfully! Oct 2 14:46:47 AnkurAggarwal kernel: Ank$: Memory allocation successful Oct 2 14:46:47 AnkurAggarwal kernel: Ank$: Port Available Oct 2 14:46:47 AnkurAggarwal kernel: Ank$:cdev successful Oct 2 14:46:47 AnkurAggarwal kernel: Ank$: Generation of Interrupt starts Oct 2 14:46:47 AnkurAggarwal kernel: Anks:ret:-16 Oct 2 14:46:47 AnkurAggarwal kernel: Press a key... Oct 2 14:46:47 AnkurAggarwal kernel: >>> PARALLEL PORT INT HANDLED Oct 2 14:46:47 AnkurAggarwal kernel: Ank$: ret=-16 Oct 2 14:46:47 AnkurAggarwal kernel: Generating interrupt now on all output pins (intr/ACK = pin 10) Oct 2 14:46:47 AnkurAggarwal kernel: Interrupt generated. You should see the handler-message ----------------------------------------------------------------------------------------------------------------------- the return value for request_irq() is negative but still it shows the handler message. what could be the problem ??? i observed 1 thing in driver codes that enable_irq is rarely used after request_irq(),but the tutorial i reffered used it. why so???
i will be glad for your inputs... thanks On Fri, Oct 2, 2009 at 1:39 PM, Jason Nymble <jason.nym...@gmail.com> wrote: > > On 02 Oct 2009, at 9:30 AM, Harinderjit Singh Sandhu wrote: > > i want to know which statement is turning it off..... > > On Thu, Oct 1, 2009 at 9:03 PM, Greg KH <g...@kroah.com> wrote: > >> On Thu, Oct 01, 2009 at 08:55:27PM +0530, Harinderjit Singh Sandhu wrote: >> > this is the code for the small module that i wrote >> >> The problem is in your interrupt handler: >> >> > // interrupt handler >> > irqreturn_t interrupt_handler (int irqn, void *dev) >> > { >> > >> > printk("Press a key "); >> > >> > >> > return IRQ_HANDLED; >> > >> > >> > } >> >> You aren't really handling the interrupt by turning it off in the >> hardware. So the kernel sees an interrupt storm for your device and >> shuts it off to save the system from going crazy. >> >> What are you trying to do with this sample module? >> >> greg k-h >> > > You need to clear the hardware interrupt in some way (to acknowledge to the > hardware that you've seen it essentially). Often this means reading a > register value. It depends on your hardware... > -- --------------------- Harinderjit Singh Sent from Delhi, DL, India -- --------------------- Harinderjit Singh