Sharing HARD IRQs with Linux drivers

"Calin A. Culianu" <[email protected]> Thu, 22 Sep 2005 22:14:50 -0400 (EDT)
Newsgroups gmane.linux.real-time.rtlinux.general
Message-ID <[email protected]>
Hi,

I have a question about sharing hard realtime irqs with linux drivers.

My impression was that irq sharing with Linux was ok and in fact not a bad 
way to go about things (ok, so it can affect task jitter probably.. but 
still it should work, more or less, right?)

My understanding was that a hard realtime irq handler needs to 'pend' the 
irq back to linux if it wants linux to also get it.. is that correct?

Something like the following:

static unsigned int interrupt_handler_rt(unsigned int irq,
 					 struct pt_regs *regs)
{
   my_drivers_interrupt_handler(irq, (void *)&ctx, regs);

   rtl_hard_enable_irq(irq);

   rtl_global_pend_irq(irq);

   return 0;
}


Anyway, I am having trouble sharing IRQs with linux.   I am on linux 
2.4.29-bigphys with latest rtlinux free 3.2-rc1 CVS.


My problem:

I am developing a custom sound driver for the Lynx22 sound board.  The 
driver is pretty correct and I am confident it is bug-free.

At any rate, the driver works like a charm in regular (soft irq'd) Linux. 
It has no problems sharing interrupts with other drivers, and it otherwise 
works correctly with no bugs (I think!).

However, when I convert it over to use hard irq's, it begins to have 
problems....

The driver still functions, but it can no longer share the same interrupt 
line with any linux drivers.  If there is another driver loaded that uses 
the same interrupt, the system hangs.  The offending driver turns out to 
be my ethernet driver (both e100 and eepro100 hang the system).

As it turns out, this IRQ 11 that I need to use is quite popular on my 
system for some reason, and every other crucial piece of hardware is also 
sharing it (including my NVIDIA video board!!).

This problem also happens with X disabled so I know it isn't the nvidia 
drivers (no, I don't use nvidia.o, I use the nv driver from Xorg..).

Anyway.. any insights?  I am beginning to lose my mind with this problem. 
I am thinking of trying different kernel versions and different versions 
of rtlinux and maybe the problem will "go away".

Anyone else run into system hangs when sharing interrupts with linux or 
any other strangeness with rtlinux 3.2-rc1 and kernel 2.4.29?

-Calin



_______________________________________________
Rtl mailing list
[email protected]
http://hq.fsmlabs.com/mailman/listinfo/rtl
http:/www.rtlinux-gpl.org/