eeepc-laptop: fix pci hotplug race on load and unload
authorAlan Jenkins <alan-jenkins@tuffmail.co.uk>
Fri, 28 Aug 2009 12:56:34 +0000 (12:56 +0000)
committerLen Brown <len.brown@intel.com>
Fri, 28 Aug 2009 19:21:11 +0000 (15:21 -0400)
commit07e84aa98f6b3a7278d3267f6f657955ed3eb973
treee3f9b3a8fea9ab26e84bb1e7ef93a9db2a883951
parentdcf443b5813074031a45b05ad9c57da98bcae329
eeepc-laptop: fix pci hotplug race on load and unload

Wifi rfkill state changes can race with pci hotplug cleanup.  A simple
fix is to refresh the hotplug state just before deregistering the pci
hotplug slot.

There is also potential for a hotplug notification to fire too early
during setup, while the structures it uses are still being initialised.
(This could only happen if the BIOS performs hotplug itself; a bug
triggered by removing the battery while hibernated).  Avoid this by
registering the notifier later.  The same refresh mechanism is used
to handle rfkill state changes which can now race with registration.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/platform/x86/eeepc-laptop.c