Re: Detecting kernel shutdown in a kernel driver

From: Andi Kleen
Date: Fri Feb 11 2005 - 10:17:34 EST


"Simon White" <s_a_white@xxxxxxxxx> writes:

> Hi,
>
> I've been writing a device driver for a piece of hardware that we recently found the pci bridge has an issue on software reset (kernel 2.6.8.1, hardware reset is fine). The bridge appears to corrupt the subvendor/device ids on next boot. We have found a software work around in that I can write to the bridge on module exit and it will always detect correctly next boot (through module_exit when rmmod'd).
>
> However on shutting down a machine with the module loaded it never works next time, so is module_exit actually called?

It's only called when the module is explicitely unloaded.

You can use register_reboot_notifier() though.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/