Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Dec 1999 09:00:12 -0700
From:      Warner Losh <imp@village.org>
To:        Mike Smith <msmith@FreeBSD.org>
Cc:        mobile@FreeBSD.org
Subject:   Re: cvs commit: src/sys/pccard pccard.c src/sys/isa sio.c src/sys/dev/ed if_ed_pccard.c src/sys/dev/ep if_ep_pccard.c 
Message-ID:  <199912011600.JAA02186@harmony.village.org>
In-Reply-To: Your message of "Wed, 01 Dec 1999 01:42:17 PST." <199912010942.BAA00486@mass.cdrom.com> 
References:  <199912010942.BAA00486@mass.cdrom.com>  

next in thread | previous in thread | raw e-mail | index | archive | help
In message <199912010942.BAA00486@mass.cdrom.com> Mike Smith writes:
: >   Fix the hang on card eject problem and maybe the hang on suspend
: >   problem.
: >   
: >   o Create new timeout routine so we don't detach the card inside a ISR
: >     but instead drop back to spl0 via a timeout of 0.
: 
: This will still fail in most card-device interrupt handlers that don't
: spin-limit themselves.  If at all possible, there should be a mechanism
: for a card-device interrupt handler to query the parent bus to determine
: whether the hardware has gone away.  (This would allow the handler to bail
: out and let the detach code do its stuff if the handler is spinning madly.)

I know this will still fail.  This is at best a stop-gap approach.  It
lessens the chance there will be a hang, but doesn't eliminate it.
The drivers themselves that support detach will somehow need to know
when they have been detached and check that.  They cannot store this
in sotfc because that is automatically free'd when then instance is
detached.  I'm thinking a small array of bits that are static to the
driver, one per instance.  attach sets the bit, while detach clears
the bit.  If someone wants to check the status, they look at the bit.

Polling the actual card hardware is going to be gross and prone to
races since it would have to ask the bus if the child was still there,
but there is no longer a child handle.  Also, there is no card
hardware anymore, so you can't ask it.  I'm not sure how to solve this
problem generically, and we've had lots of flame wars about this
before.  To be honest, I'm not interested in solving the problem in
the old pccard code at all.

Spin limiters in the ISRs of drivers that support detach.  Doing
thinks like sio does with sc->gone (w/o the softc) and other
techniques are going to be what is required to fix this.

I wanted to make things suck less, and this commit does that.  I'm
under no illusions that it is perfect.

Warner


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?199912011600.JAA02186>