[Prev][Next][Index][Thread]

Re: IRQ masking and unmasking



> From: "Giuseppe Lettieri" <lettieri@iet.unipi.it>
> To: "oskit users" <oskit-users@fast.cs.utah.edu>
> Subject: IRQ masking and unmasking
> Date: Wed, 8 Mar 2000 13:58:59 +0100
> 
> Hi,
> I am trying to study OSKit code to make a better use of it in our work.
> Looking at linux glue
> code for the network device drivers and at base environment interrupt
> management (OSKit version 990722), I have noticed (I can be wrong) that
> the source IRQ is still masked in the PIC when do_bottom_half code is
> executed. Is this intentional? May it cause some problem when burst of
> messages are received? This is important for me, as I must make the
> assumption that packet loss is a rare event (in a very small LAN, of
> course). If I have misanderstood your code, please excuse me :-)

You are correct.  The 990722 snapshot had a bigger problem in that ALL
interrupts might be disabled when do_bottom_half was called.  I would
suggest you upgrade to the latest OSKit snapshot if possible.  But even
that snapshot has the problem you describe.  The short-term solution for
that is to call enable_irq:

	/* Run any Linux software interrupt handlers before returning */
	if ((local_irq_count[0] == 0) && (bh_mask & bh_active)) {
+		enable_irq(irq);
		linux_sti();
		do_bottom_half();
	}

I say "short-term" because calling do_bottom_half here at all is not right.
If an IRQ were shared between the linux_dev component and some other
component (say, freebsd_dev) then the bottom_half handling could interfere
with the other component's HW interrupt handling.  Note that shared IRQs
within the linux_dev component are not a problem.