ACPI: Set flag DOCK_UNDOCKING when triggered via sysfs
authorHolger Macht <hmacht@suse.de>
Wed, 12 Mar 2008 00:07:27 +0000 (01:07 +0100)
committerLen Brown <len.brown@intel.com>
Tue, 18 Mar 2008 09:16:38 +0000 (05:16 -0400)
begin_undock() is only called when triggered via a acpi notify handler
(pressing the undock button on the dock station), but complete_undock() is
always called after the eject. So if a undock is triggered through a sysfs
write, the flag DOCK_UNDOCKING has to be set for the dock station,
too. Otherwise this will freeze the system hard.

Signed-off-by: Holger Macht <hmacht@suse.de>
Acked-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/dock.c

index 307cef65c24758bacb00ef7a2700fcb96a29738b..fa44fb96fc343d1c8dcb54b0b01e5849061f8678 100644 (file)
@@ -710,6 +710,7 @@ static ssize_t write_undock(struct device *dev, struct device_attribute *attr,
        if (!count)
                return -EINVAL;
 
+       begin_undock(dock_station);
        ret = handle_eject_request(dock_station, ACPI_NOTIFY_EJECT_REQUEST);
        return ret ? ret: count;
 }