• Zhang Rui's avatar
    ACPI: fix hotplug race · 19cd847a
    Zhang Rui authored
    The hotplug notification handler and drivers' notification handler all
    run in one workqueue.  Before hotplug removes an acpi device, the
    device driver's notification handler is already be recorded to run just
    after global notification handler.  After hotplug notification handler
    runs, acpica will notice a NULL notification handler and crash.
    
    So now we run run hotplug in another workqueue and wait
    for all acpi notication handlers finish.
    This was found in battery hotplug, but actually all
    hotplug can be affected.
    Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
    Signed-off-by: default avatarShaohua Li <shaohua.li@intel.com>
    Signed-off-by: default avatarLen Brown <len.brown@intel.com>
    19cd847a
acpiosxf.h 8.02 KB