2013-10-24 13:25:50

by Russ Dill

[permalink] [raw]
Subject: [PATCH] PM / hibernate: Move software_resume to late_initcall_sync

software_resume is being called after deferred_probe_initcall in
drivers base. If the probing of the device that contains the resume
image is deferred, and the system has been instructed to wait for
it to show up, this wait will occur in software_resume. This causes
a deadlock.

Move software_resume into late_initcall_sync so that it happens
after all the other late_initcalls.

Signed-off-by: Russ Dill <[email protected]>
---
kernel/power/hibernate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index c9c759d..0121dab 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -846,7 +846,7 @@ static int software_resume(void)
goto Finish;
}

-late_initcall(software_resume);
+late_initcall_sync(software_resume);


static const char * const hibernation_modes[] = {
--
1.8.3.2


2013-10-24 14:22:11

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH] PM / hibernate: Move software_resume to late_initcall_sync

Hi!

> software_resume is being called after deferred_probe_initcall in
> drivers base. If the probing of the device that contains the resume
> image is deferred, and the system has been instructed to wait for
> it to show up, this wait will occur in software_resume. This causes
> a deadlock.
>
> Move software_resume into late_initcall_sync so that it happens
> after all the other late_initcalls.
>
> Signed-off-by: Russ Dill <[email protected]>

Acked-by: Pavel Machek <[email protected]>


--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html