Dear Mr. Van Loon Sr., Thank you very much for your answers. It was a typing mistake ( < instead <=) sorry.
And also in servicing the interrupt the code is actually like this if(g_strBrdDetail[i].IRQ == irqno) { // Read Interrupts Status // Check wheather it is from this board if so, Clear Interrupt } To confirm, I am not trying to share interrupt with normal linux. I am using rtl_request_irq for connecting the irq to ISR in the init_module. The problem is solved by optimizing the code to handle interrupt effectively. Thank you very much for your immediate response. Regards RD Hello R O N A L D D U C K: When you speak of sharing interrupts, I believe there are 2 possible instances. 1) One or more of your boards shares interrupts with Linux. 2) The boards that you are servicing / driving in rtl are sharing an interrupt between themselves, but are not sharing an interrupt with Linux. I have some experience with the later and it is easy to do. Looking at your code snippet, IMHO, it basically looks right but I wonder if your g_uiTotalBrds is zero based or one based. If it is one based, meaning if you have 2 boards, g_uiTotalBrds == 2, then you are probably overrunning the bounds of your g_strBrdDetail structure. The following line: > for(i=0; i <= g_uiTotalBrds; i++) would need to be: for(i=0; i<g_uiTotalBrds; i++) It may be that in simplifying your code you simply did not include detail, but depending upon what happens should an interrupt not be serviced but be cleared on the interrupting board, the following logic: > if(g_strBrdDetail[i].IRQ == irqno) > { > // Read Interrupts Status > // Clear Interrupt > } might have a "race" condition unless your code actually reads something like: if(g_strBrdDetail[i].IRQ == irqno) { // Read Interrupts Status if( Interrupt from this board ){ // Service Interrupt // Clear Interrupt } } I'll explain. If you are always clearing the interrupt status register on the board whether or not the board had an interrupt pending, then the interrupt might get set while you are running your ISR triggered by another board and be at the point just before you "Clear Interrupt". If some action of servicing the interrupt was required to perpetuate further interrupts and you had already bypassed that code prior to this board's interrupt being set, the interrupt would shortly be cleared but the perpetuating action would not have been executed. You did not mention if you were testing rtl_global_request_irq() once and only once for each interrupt that your rtl process / driver handles in your init_module(). If not, you might be trying to share an interrupt with Linux. Best regards, Wayne R O N A L D D U C K wrote: > > Dear Friends, > I am sending a mail after a long time. I am facing a problem now. Please > help me to come out of this. > > Environment: > ~~~~~~~~~~~~ > RT-Linux - Version 3.1 > Linux - 2.4.16 with RT patch from contribution > > Hardware > ~~~~~~~~ > Pentium III - 700 MHz > 128 MB SDRAM > 40GB HAR DISK > > ADD-ON Module > ~~~~~~~~~~~~~~ > Supports PCI Ver 2.1 > Memory Requirement - 1 MB PCI > IO Requirement - 256 bytes I/O > IRQ - 1 Line INT A > > We are developing a driver for a PCI add-on module which is actually a > communication add-on like RS-422 and 1553B. The problem here is if I put > more than one PCI add-on (same module) in the same PC, I am not able to > service interrupts properly. > Because, both are sharing the same interrupt the line. When I program the > BIOS to allocate different IRQs there is no problem. > > Please tell me wheather RT-Linux supports IRQ sharing, if so how to > implement that. > > Because I have return a single driver to handle multiple cards, I am having > a single ISR and registering with the rtl_request_interrupt function. In > that function, whenever I get an interrupt, I am checking which board is > using the raised IRQ number (from ISR function parameter), then I am > servicing the interrupt. If more that one board matches I am reading the IRQ > status from the board and verifying wheather it has generated the Interrupt, > if not I will go to the next matching board, I am also verifying the other > board even the Interrupt is raised by the any one of the matching boards. > > Code snippet > ~~~~~~~~~~~~ > > PCI_ISR(irqno, regs) > { > for(i=0; i <= g_uiTotalBrds; i++) > { > if(g_strBrdDetail[i].IRQ == irqno) > { > // Read Interrupts Status > // Clear Interrupt > } > } > rtl_irq_hardenable(irqno); > } > > The Problem > ~~~~~~~~~~~ > * In an instance, if two or more boards is raising interrupts on the same > line, IRQ is serviced for any one board only, with this effect the system is > hanging and stops responding. This is due to the un serviced interrupts of > other boards. > > Typical case: > > Let us say the Interrupt is raised for the third board, my interrupt service > routine is called immediately. Now in the processing when the loop reaches > the third iteration (Board 3, i=2), assume board 2 is raising interrupt, in > this case there won't be any call to ISR because the IRQ line is same for > both boards and in RT-Linux the IRQ line is disabled when the ISR is called. > Because the loop is in third iteration and board 2 has raised the interrupt > there will not be any chance of servicing the Board 2 until the loop is > fully executed and ISR is returned with the rtl_irq_hard_enable. > > My Problem is, the ISR is not getting invoked even though there is a pending > interrupt on the same line. > > Please advice on how to handle this problem. > > Regards > RD > > -- [rtl] --- > To unsubscribe: > echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR > echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED] > -- > For more information on Real-Time Linux see: > http://www.rtlinux.org/ -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/ -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/