android_kernel_google_msm/kernel/power
Takashi Iwai 5dc1c88513 PM / sleep: Fix request_firmware() error at resume
commit 4320f6b1d9 upstream.

The commit [247bc037: PM / Sleep: Mitigate race between the freezer
and request_firmware()] introduced the finer state control, but it
also leads to a new bug; for example, a bug report regarding the
firmware loading of intel BT device at suspend/resume:
  https://bugzilla.novell.com/show_bug.cgi?id=873790

The root cause seems to be a small window between the process resume
and the clear of usermodehelper lock.  The request_firmware() function
checks the UMH lock and gives up when it's in UMH_DISABLE state.  This
is for avoiding the invalid  f/w loading during suspend/resume phase.
The problem is, however, that usermodehelper_enable() is called at the
end of thaw_processes().  Thus, a thawed process in between can kick
off the f/w loader code path (in this case, via btusb_setup_intel())
even before the call of usermodehelper_enable().  Then
usermodehelper_read_trylock() returns an error and request_firmware()
spews WARN_ON() in the end.

This oneliner patch fixes the issue just by setting to UMH_FREEZING
state again before restarting tasks, so that the call of
request_firmware() will be blocked until the end of this function
instead of returning an error.

Fixes: 247bc03742 (PM / Sleep: Mitigate race between the freezer and request_firmware())
Link: https://bugzilla.novell.com/show_bug.cgi?id=873790
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-28 07:06:46 -07:00
..
block_io.c
console.c
hibernate.c
Kconfig
main.c
Makefile
power.h
poweroff.c
process.c PM / sleep: Fix request_firmware() error at resume 2014-07-28 07:06:46 -07:00
qos.c
snapshot.c PM / hibernate: Avoid overflow in hibernate_preallocate_memory() 2013-12-04 10:50:31 -08:00
suspend.c
suspend_test.c
swap.c PM / Hibernate: Hibernate/thaw fixes/improvements 2014-02-20 10:45:33 -08:00
user.c