netdev
[Top] [All Lists]

Re: tx_timeout and timer serialisation

To: Andrew Morton <andrewm@xxxxxxxxxx>
Subject: Re: tx_timeout and timer serialisation
From: Andrey Savochkin <saw@xxxxxxxxxxxxx>
Date: Mon, 22 May 2000 19:23:57 +0800
Cc: netdev@xxxxxxxxxxx
In-reply-to: <39291650.D15A17CB@xxxxxxxxxx>; from "Andrew Morton" on Mon, May 22, 2000 at 09:13:20PM
References: <Pine.LNX.4.10.10005192039250.825-100000@xxxxxxxxxxxxx>, <Pine.LNX.4.10.10005192039250.825-100000@xxxxxxxxxxxxx>; <20000520122715.A7682@xxxxxxxxxxxxx> <39262113.19447850@xxxxxxxxxx>, <39262113.19447850@xxxxxxxxxx>; <20000520133557.A8149@xxxxxxxxxxxxx> <39267696.ACCE4DF3@xxxxxxxxxx>, <39267696.ACCE4DF3@xxxxxxxxxx>; <20000522094419.A12225@xxxxxxxxxxxxx> <39291650.D15A17CB@xxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
On Mon, May 22, 2000 at 09:13:20PM +1000, Andrew Morton wrote:
> Andrey Savochkin wrote:
> > ... 
> > For eepro100 it should be
> > 
> > --- eepro100.c  Tue Apr  4 11:05:23 2000
> > +++ eepro100.c-timer    Mon May 22 09:35:52 2000
> > @@ -1799,7 +1799,9 @@
> >                            dev->name, inw(ioaddr + SCBStatus));
> > 
> >         /* Shut off the media monitoring timer. */
> > +       start_bh_atomic();
> >         del_timer(&sp->timer);
> > +       end_bh_atomic();
> > 
> >         /* Shutting down the chip nicely fails to disable flow control. 
> > So.. */
> >         outl(PortPartialReset, ioaddr + SCBPort);
> 
> hmm..  But if the timer handler was running before the
> start_bh_atomic(), it will continue to run during and after the
> del_timer().

Timers run from timer BH.
start_bh_atomic() gives a guarantee that upon its exit no BHs are running and
BHs are disabled until end_bh_atomic().  Certainly, it applies only to calls
not from BH/IRQ context.
And I repeat, that's 2.2 kernel code.

> 
> _Somewhere_ the mainline code needs to spin until the timer handler has
> finished.

That's start_bh_atomic()/wait_on_bh().
See include/asm-i386/softirq.h -> arch/i386/kernel/irq.c

[snip]
> Where's Alexey, BTW?  If he's busily coding a fix for this I'm gonna
> strangle him :)

In Moscow :-)
Last time I spoke with him he was busy with rewriting of fast retransmit
logic and congestion avoidance.

        Andrey

<Prev in Thread] Current Thread [Next in Thread>