[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: laptop hot swapping




On Fri, 29 Sep 2000, David Smock wrote:
> Date: Fri, 29 Sep 2000 14:12:16 -0500
> To: debian-user@lists.debian.org
> From: David Smock <d-smock@northwestern.edu>
> Subject: laptop hot swapping
> 
> I have a Dell Inspiron 5000 running debian woody, and all the apm stuff
> works great.  My only problem is hot swapping drives - is there any way
> to get linux to recognize the fact that ive changed block devices?  
> 
> I've tried suspending and swapping, but no dice either - the kernel is
> still thinking a cdrom is on /dev/hdc
> 
> Any ideas?
> 
> David Smock
> d-smock@northwestern.edu
> 
> 
> -- 
> Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org <
> /dev/null
> 
I have been able to hot swap on a few Compaq laptops(Armada 7400, E500)
only under the following condition:
1. Linux booted with CD in the multibay

I could then hot swap a floppy for the CD and was able to hot swap back to
the CD.  If I booted with the floppy then I could not swap the CD because
Linux did not know a CD was on the system.

I write bios for the Compaq notebooks so this is how it works for APM.
1. User removes multibay device
2. Hardware generates an external SMI
3. SMI code turns off power/buffers to empty bay, updates internal bios
device tables, etc.
4. Bios generate PnP message to tell OS of a device change
5. OS queries PnP the find which device it changed and updates its
info/drivers

The same process occurs for device insertion except if an IDE device is
inserted the SMI code has more work to do.  It must take the IDE/Atapi
device out of reset, ID it, do any geometry/xfer speed setup.  Also, if you
insert the device in a bay on the same channel as an existing IDE device
then the existing device state must be preserved because when you hardware
reset the new device all devices are reset on that channel.

You could do this at least two ways.

1. This is a bad way but modify the linux IDE driver to keep all
interfaces/dev nodes hot and poll periodically for presence of devices.  

2. Write a kernel module to poll the PnP event register periodically.  This
is what Win95 does.  When a device change message comes
through(insertion/removal) go out and load/re-load the driver and setup the
nodes, etc.

I've been too lazy to learn linux kernel programming to do this;)

Dell probably uses a similar PnP mechanism.

This sounds like a good project for 2.4 and devfs.

scott worley
sworley@houston.rr.com



Reply to: