Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 03 Jul 2000 10:45:42 -0600
From:      Warner Losh <imp@village.org>
To:        Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, Nick Hibma <n_hibma@calcaphon.com>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/sys bus.h bus_private.h src/sys/kern subr_bus.c 
Message-ID:  <200007031645.KAA23666@harmony.village.org>
In-Reply-To: Your message of "Mon, 03 Jul 2000 12:34:53 EDT." <200007031634.MAA17071@khavrinen.lcs.mit.edu> 
References:  <200007031634.MAA17071@khavrinen.lcs.mit.edu>  <6433.962634479@critter.freebsd.dk> <200007031604.KAA23352@harmony.village.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <200007031634.MAA17071@khavrinen.lcs.mit.edu> Garrett Wollman writes:
: I think this is a bug in pccard (or rather, in the way removable
: devices are currently implemented in newbus).  If I reinsert the same
: (or a functionally identical) device, I should be able to expect it to
: start off from where it was before.
: 
: In other words, devices which are removed need to be accounted for as
: ``still attached but not physically present'' rather than simply
: ``gone''.

I don't think this is a bug.  The card is now gone.  There's no easy
way to tell if you inserted the same card or a different card from the
pccard layer.  If you insert a different card, even one of the same
model and make, it should behave as if it was a new card in the
system.  Why?  Because it has a different NIC address at the very
least.  Since the NIC is different, you'll get a different DHCP
address, or you'd have to wait for ARP entries to time out.  If it is
the same, it does no harm to recreate and reconfigure the interface.

Then you get into all the fun problems when someone tries to access
the device that isn't there.  What do you do with packets for it?
What do you do with disk blocks?  What about mounted file systems?  It
gets real ugly in a huge hurry.  

Where it gets really ugly is flash cards.  What if I take out one
flash card and insert another, identical flash card that has different
file systems on it (flash cards don't have serial numbers)?  Or worse
yet, suspend, swap out the card with another one, and resume.  If you
had mounted file systems on the original flash card, you certainly
don't want them flushing onto the new flash card.  Bad things would
happen due to this inconsistancy.

When the card is detached, it is gone.  There's no concept of "this
logical device is still there, but not attached to a physical device"
in the newbus system.  I'm not sure that adding this concept would
help more than it would hurt.

Warner


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




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