> On Mon, 06 Nov 2000, David Woodhouse wrote:
> > No. You have to reset the hardware fully each time you load the module.
> > Although you _expect_ it to be in the state in which you left it, you can't
> > be sure of that.
> If a reset is needed, I think it should come explicitly from userspace.
Take Alan's example of a USB device, say USB audio. If it is disconnected
and reconnected to add a hub, or anything else, the device may shut itself
down, go to an undefined state, or even power cycle (if it draws power from
the USB +5V). Same with hot-swap PCI cards. The driver *MUST* reset the
device on load. If saving mixer levels through this kind of transition is
desired (which it evidentally is), the module load/unload code must save and
restore the settings.
This is exactly equivelent to reseting hardware after a warm boot. Who knows
what the Windows driver did to your card in the mean time. A device driver
can only guarantee that nobody horkes with its hardware while it is loaded--
In the interim, the driver may have been connected to another computer,
accessed by another driver, or accessed from userspace (say, VMWare doing
a pass through driver).
I personally like the idea of having insmod/rmmod do copy-out/copy-in from
a cache file in userspace. That way, if we need large data sets (a ROM
image for something.) they don't take up kernel space when not in use.
Also, it allows people to have persistant settings across reboot through
the same mechanism--avoiding duplicating information in shutdown/startup
--- Fear is the mind killer. -- Frank Herbert, "Dune" - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to firstname.lastname@example.org Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Tue Nov 07 2000 - 21:00:20 EST