From: linas@austin.ibm.com Date: Wed, 14 Jan 2004 23:57:48 +0000 Subject: Re: unclean yanking out of device? Message-Id: <20040114175748.A40506@forte.austin.ibm.com> List-Id: References: <20040114160002.G57254@forte.austin.ibm.com> In-Reply-To: <20040114160002.G57254@forte.austin.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Wed, Jan 14, 2004 at 03:24:12PM -0800, Greg KH wrote: > On Wed, Jan 14, 2004 at 05:08:49PM -0600, linas@austin.ibm.com wrote: > > > > > > > > What is supposed to happen if I just yank out a (network/scsi) device > > > > while it is being used, without calling any of the hotplug unregister > > > > remove etc. functions in advance? > > > > Let me rephrase: I want to make 'appropriate' changes to the 2.6/2.7 > > kernel, and some selected device drivers, so that a sysadmin can > > stupidly yank out an *ordinary* PCI card (not a pcmcia) without doing > > an orderly shutdown in advance. > > Hahahaha... no, PCI drivers can not handle that. Right. I've been tasked with modifying several specific drivers to handle that. > See the PCI Hotplug > spec for why. You mean the spec that's avaialble from http://www.pcisig.com ? or a linux-specific spec? > PCI drivers need to be told to shut down before removing > them. And that will not change, sorry. Hmm. Let me point out that other operating systems already do this (and have been doing so for a while). The chipset I'm working with has been shipping for, I dunno, a couple of years or something like that. They've already gone through a four or five engineering upgrades on the feature set. So when you say you're sorry, did you mean "its a bad idea, I will personally oppose it", or do you mean "you'll have to implement all of this by your lonesome"? > > More specifically, I have a whiz-bang PCI controller that will > > shut down a PCI slot when it is hit by a cosmic ray (data/address > > parity error, other error, etc.). I want to be able to "recover" > > that slot, (if its recoverable), and get things going again. > > That pci controller needs to tell the OS that it is going to shut down > that pci slot. Otherwise that pci controller violates the PCI spec. I was only half-joking about the cosmic ray. The cosmic ray violated the PCI spec. boo hoo. Now what? Tell it to go back to the supernova it came from? > Note, yes I know that cPCI controllers do this, that's a totally > different story... the os still needs to know before turning off a slot. This isn't a cPCI chipset. The point is, the hardware went kaboom, the pci device is in some hopeless state, and further communication with it is impossible. My goal is to clean up the kernel state and move on. Let me rephrase that: I could hack up some code that does this, but my goal is really to do it in such a way so that the patches are accepted by Torvalds, etal. Much of the code can be done in the arch directories, but some of it needs to go into generic files, and into specific device drivers, and so its my interest to go as generic as possible before I have to retreat to a rats-nest of special-case code. Which is why I bring this up now, rather than simply announcing a patch that has already been implemented. --linas ------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel