Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Jun 2002 14:44:54 -0600 (MDT)
From:      "M. Warner Losh" <imp@village.org>
To:        winter@jurai.net
Cc:        arch@FreeBSD.ORG
Subject:   Re: It is time to admit that removable devices exist
Message-ID:  <20020624.144454.84361547.imp@village.org>
In-Reply-To: <20020624163116.J95270-100000@sasami.jurai.net>
References:  <20020623.171200.96231110.imp@village.org> <20020624163116.J95270-100000@sasami.jurai.net>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20020624163116.J95270-100000@sasami.jurai.net>
            "Matthew N. Dodd" <winter@jurai.net> writes:
: On Sun, 23 Jun 2002, M. Warner Losh wrote:
: > Please find enclosed the beginnings of a patch to make removable devices
: > better represented in the system.  Right now all it adds is a mechanism
: > by which client drivers can ask if the device is still really there or
: > not.
: 
: If a device driver is ever in a position to ask this question when a
: device is not actually present then we've got larger issues.

You need it in the detach method so that you don't flush things when
the hardware is gone.  Also, there are times that the hardware can
just vanish out from under us, even while we're in some critical
section of code.

: I don't think this is the correct solution; adding function calls to all
: the interrupt handlers is broken, especially since PCMCIA doesn't really
: support hot removal of devices anyway.  No other OS supports this correctly
: either.

We support it decently.  People expect it to basically work.

USB and Firewire all properly support hotplug, but may also need a way
to know if their device has gone away while they weren't looking.
Hotswap PCI also needs this, but there there's hooks in the bridge
chipset that you have to hook into to properly quiess the device.
This is supposed to be a generic method.

: I suggest that you implement a PCMCIA/CARDBUS specific BUS_SETUP_INTR
: method that performs whatever check is needed before calling the driver
: interrupt handler.

We already do that.  But lots of things can happen between when we
call the ISR and when the ISR finishes running.  The call is indented
for ISRs that may wish to terminate always (which they should do
anyway).

: We should also implement 'ifconfig detach/unplumb/destroy' as an interface
: for forcing network devices (the most common hot removed device) to be
: detached.  This will allow users to completely detach the device before
: they remove it.

That's not a viable option.  We'd really need a 'devcontrol detach
sio4' to do things right.

Warner

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




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