Re: ide_set_handler: timer already active

Gadi Oxman (gadio@netvision.net.il)
Mon, 5 Apr 1999 21:30:02 +0300 (IDT)


Hi Geert,

I think I see it; looks like start_request() in ide_do_request() resulted
in a completion interrupt calling ide_do_request() again before we exited
it. That completion interrupt decided to exit the driver now, and set a
timer to wake us up later. Meanwhile, when we returned, ide_do_request()
thought that it has just serviced a request which was completed immediately,
without waiting for any interrupts at all, and we then went again to check
if we can exit the driver, and set the sleep timer again..

Does the following patch eliminate the warning messages?

If it helps, we need to verify that the irq is really masked in the
interrupt controller while the handler is being called. This can also
explain the 'eth0: Re-entering the interrupt handler' warnings from the
ethernet driver.

Thanks,

Gadi

--- ide.c~ Fri Mar 26 03:13:28 1999
+++ ide.c Mon Apr 5 21:16:47 1999
@@ -1090,7 +1090,7 @@
unsigned long io_flags;

hwgroup->busy = 1;
- while (hwgroup->handler == NULL) {
+ while (hwgroup->handler == NULL && hwgroup->busy) {
spin_lock_irqsave(&io_request_lock, io_flags);
drive = choose_drive(hwgroup);
if (drive == NULL) {

On Mon, 5 Apr 1999, Geert Uytterhoeven wrote:

> On Fri, 12 Mar 1999, Gadi Oxman wrote:
> > On Fri, 12 Mar 1999, Mark Lord wrote:
> > > Geert Uytterhoeven wrote:
> > >
> > > > Do you share the interrupts of your IDE interfaces with other devices? I do.
> > >
> > > Yes, but only with other PCI devices (all level-triggered).
> > > Right now I have two IDE interfaces (RAID0) and an EEpro100 sharing IRQ
> > > 11.
> > >
> > > > > The message is is only there "temporarily" anyway,
> > > > > just to check for bugs seen (but not understood) on other architecture(s).
> > > >
> > > > I see the message several times a day. Each of these would have been a full
> > > > crash in the days before I replaced the call to add_timer() by mod_timer().
> > > >
> > > > Strange... Where is the bug????
> > >
> > > Must be somewhere in the M68k interrupt layer.
> > > The ia32 interrupt stuff was also fairly buggy last fall.
> >
> > This error is very strange -- del_timer() is performed on all entry
> > points to ide_do_request(). Geert, can you log each add_timer() and
> > del_timer() performed by the IDE driver, and verify that indeed two
> > add_timer() were called in a raw? We can also try to force an oops
> > at that place and look at the stack trace for some hints.
>
> I added some printks to the calls that modify the timers (I have only one IDE
> chain, so hwgroup->timer is always the same):
>
> 'A' -> add_timer()
> 'D' -> del_timer()
> 'M' -> mod_timer()
>
> and I catched these:
>
> | DADADADMide_set_handler: timer already active
> ^
> | Apr 5 12:30:17 cassandra 4>Apr 5 12:30:17 kernel: MDADADADADADADADA
> ^
>
> | ADADADADADADADADADADMide_set_handler: timer already active
> ^
> | Apr 5 12:30:19 cassandra 4>Apr 5 12:30:19 kernel: MDADADMDADADMDA
> ^
>
> As you can see, there are two consecutive `M's. At all other places, you have
> something like
>
> | DADADADMDMDADADADADADA
> ^ ^
> which is OK.
>
> Then I added an `asm("illegal")' to force a stack backtrace:
>
> Illegal instruction in
>
> [<0005f1f0>] 0005f012 t ide_do_request
>
> Backtrace:
>
> [<0008eae0>] 0008e799 r ide_hwif_to_major
> [<00002700>] 000026d4 T copy_thread
> [<000119a8>] 0001196a T make_pages_present
> [<0000ffff>] 0000ffd4 T copy_page_range (odd address??)
> [<00064c5c>] 00064bcc t write_intr
> [<0005f5d2>] 0005f592 t start_next_request
> [<00002010>] 00002008 T get_options
> [<00064bcc>] 00064bcc t write_intr
> [<0005f822>] 0005f76e T ide_intr
> [<0002bd16>] 0002bcd2 T amiga_do_irq_list
> [<0002c39e>] 0002c32e t cia_handler
> [<000032dc>] 000032a2 T process_int
> [<000023da>] 000023b0 T inthandler
> [<000119a8>] 0001196a T make_pages_present
> [<0000232c>] 000022fc T system_call
> [<000119a8>] 0001196a T make_pages_present
> [<0000215a>] 0000215a t init
> [<0000215a>] 0000215a t init
>
> Nothing interesting, I'm afraid.
>
> Since I also get `eth0: Re-entering the interrupt handler.' from the Ariadne
> Ethernet driver, I brought the net down, removed the ariadne LKM and even
> disconnected the UTP cable to make sure no interrupts would happen from the
> Ariadne (Ariadne and IDE share the same interrupt), but I still get
> `ide_set_handler: timer already active' messages...
>
> Greetings,
>
> Geert
>
> --
> Geert Uytterhoeven Geert.Uytterhoeven@cs.kuleuven.ac.be
> Wavelets, Linux/{m68k~Amiga,PPC~CHRP} http://www.cs.kuleuven.ac.be/~geert/
> Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium
>
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
> Please read the FAQ at http://www.tux.org/lkml/
>
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/