Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jan 1999 10:34:40 -0700
From:      Nate Williams <nate@mt.sri.com>
To:        Mike Smith <mike@smith.net.au>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, Bill Trost <trost@cloud.rain.com>, mobile@FreeBSD.ORG
Subject:   Re: Reclaiming irqs for unsupported PCI hardware? 
Message-ID:  <199901221734.KAA21516@mt.sri.com>
In-Reply-To: <199901220158.RAA12743@dingo.cdrom.com>
References:  <802.916962709@critter.freebsd.dk> <199901220158.RAA12743@dingo.cdrom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> > > - Polling for the card's presence every iteration of the interrupt 
> > >   handler loop.  This is absurdly expensive.  Don't suggest polling 
> > >   once on interrupt entry, unless you can guarantee the card won't be 
> > >   pulled during the interrupt handler's execution.
> > 
> > There is no way to guarantee that the card will not be pulled in the
> > next N microseconds.
> 
> Rrrg.  This is actually a really good point, and I can see where this 
> leads to.
> 

We have no 'shutdown' procedure, unfortunately.  Note, *most* cards that
you pull are probably not 'active', and drivers can be coded to check
for inactivity/removal.  It's not pretty, but it's the best solution
that I'm aware of.  However, it requires that we use an interrupt
routine for removal, else there's no way to 'interrupt' the interrupt
handler and modify the drivers' flag to let it know there is no
hardware.

>  1) DO NOT REMOVE THE CARD UNTIL YOU HAVE SHUT IT DOWN.
>  2) Poll for insertions/removals since the cards are never active in
>     either state (see point 1).
> 
> Perhaps we're just looking at this the wrong way?  We don't try to 
> detect when floppies are stupidly removed, perhaps we shouldn't try to 
> do it with pccard/cardbus cards either?

We have to, because all other OS's do.  And, it's really easy and uses
up very little CPU to do.

> Commentary?  Are we trying too hard to do something that's not worth 
> the effort?

It's impossible to crrrectly handle hot-swapping of PCMCIA cards, but
you can get it mostly right.  Trying to get it more right makes things
really compilicated, and is probably not worth the effort.


Nate

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901221734.KAA21516>