From: Rafael J. Wysocki Date: Thu, 19 Jul 2007 08:47:37 +0000 (-0700) Subject: PM: prevent frozen user mode helpers from failing the freezing of tasks X-Git-Tag: v2.6.23-rc1~453 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccd4b65aef4be2278543fde5b999e55a4d694fd8;p=pandora-kernel.git PM: prevent frozen user mode helpers from failing the freezing of tasks At present, if a user mode helper is running while usermodehelper_pm_callback() is executed, the helper may be frozen and the completion in call_usermodehelper_exec() won't be completed until user space processes are thawed. As a result, the freezing of kernel threads may fail, which is not desirable. Prevent this from happening by introducing a counter of running user mode helpers and allowing usermodehelper_pm_callback() to succeed for action = PM_HIBERNATION_PREPARE or action = PM_SUSPEND_PREPARE only if there are no helpers running. [Namely, usermodehelper_pm_callback() waits for at most RUNNING_HELPERS_TIMEOUT for the number of running helpers to become zero and fails if that doesn't happen.] Special thanks to Uli Luckas , Pavel Machek and Oleg Nesterov for reviewing the previous versions of this patch and for very useful comments. Signed-off-by: Rafael J. Wysocki Acked-by: Uli Luckas Acked-by: Nigel Cunningham Acked-by: Pavel Machek Cc: Oleg Nesterov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed