netdev
[Top] [All Lists]

Re: 3C905b partial lockup in 2.4.5-pre5 and up to 2.4.6-pre1

To: Jeff Garzik <jgarzik@xxxxxxxxxxxxxxxx>
Subject: Re: 3C905b partial lockup in 2.4.5-pre5 and up to 2.4.6-pre1
From: Andrew Morton <andrewm@xxxxxxxxxx>
Date: Tue, 12 Jun 2001 02:10:57 +1000
Cc: netdev@xxxxxxxxxxx
References: <3B23A4BB.7B4567A3@mandrakesoft.com> <20010610093838.A13074@flint.arm.linux.org.uk> <Pine.LNX.4.33.0106101201490.9384-100000@toomuch.toronto.redhat.com> <20010610173419.B13164@flint.arm.linux.org.uk> <15140.5762.589629.252904@pizda.ninka.net> <3B24C185.824EBBE0@uow.edu.au> <15140.51018.942446.320621@pizda.ninka.net> <3B24CC80.D880510@mandrakesoft.com> <3B24D3F0.F2B6DA76@uow.edu.au> <3B24EC2F.175B088A@mandrakesoft.com>
Sender: owner-netdev@xxxxxxxxxxx
[ List trimmed ]

Jeff Garzik wrote:
> 
> Andrew Morton wrote:
> >
> > Jeff Garzik wrote:
> > >
> > > "David S. Miller" wrote:
> > > >
> > > > Andrew Morton writes:
> > > >  > It'd need to be callable from interrupt context - otherwise
> > > >  > each device/driver which has link status change interrupts
> > > >  > will need to implement some form of interrupt->process context
> > > >  > trick.
> > > >
> > > > Well, we could make the netif_carrier_*() implementation do the
> > > > "interrupt->process context" trick.
> > > >
> > > > Jamal can feel free to post what he has.
> > >
> > > If we have any problems with context we can always use schedule_task()
> >
> > Yep.  With dev_hold() and dev_put() to avoid module removal
> > races.  One would also have to be sure that the right things
> > happen if the interface is downed between the interrupt and
> > execution of the schedule_task() callback.
> 
> Why not call MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT?  It makes it much
> more obvious you are closing a race related to modules, and it goes away
> when the module is built into the kernel.

It'd best be done inside netif_carrier_*().  So there one
could use try_inc_mod_count(dev->owner).  But that means
an rmmod would fail if there was an event outstanding.

With dev_hold(), which appears to be Alexey's answer to the
module horrors, the rmmod caller will simply block until the
callback has completed and will then see success, which is
what we'd prefer to have happen.

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