Skip to contentSkip to conversation

kexec jump: in sync with hibernation implementation

PATCH In review Huang Ying 2 participants 3 messages Aug 7, 2008

Subsystems (3)
lore
Share & tools
lore

Huang Ying

author
#0 lore raw

PATCH 4/6 kexec jump: in sync with hibernation implementation

Add device_pm_lock() and device_pm_unlock() in kernel_kexec() to be in sync with current hibernation implementation.

---
 kernel/kexec.c |    2 ++
 1 file changed, 2 insertions(+)
kernel/kexec.c +2 -0
@@ -1457,6 +1457,7 @@ int kernel_kexec(void)
 		error = disable_nonboot_cpus();
 		if (error)
 			goto Resume_devices;
+		device_pm_lock();
 		local_irq_disable();
 		/* At this point, device_suspend() has been called,
 		 * but *not* device_power_down(). We *must*
@@ -1485,6 +1486,7 @@ int kernel_kexec(void)
 		device_power_up(PMSG_RESTORE);
  Enable_irqs:
 		local_irq_enable();
+		device_pm_unlock();
 		enable_nonboot_cpus();
  Resume_devices:
 		device_resume(PMSG_RESTORE);

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#1 lore raw
Quoted 21 lines

Add device_pm_lock() and device_pm_unlock() in kernel_kexec() to be in sync with current hibernation implementation.

---
 kernel/kexec.c |    2 ++
 1 file changed, 2 insertions(+)
kernel/kexec.c +1 -0
@@ -1457,6 +1457,7 @@ int kernel_kexec(void)
 		error = disable_nonboot_cpus();
 		if (error)
 			goto Resume_devices;
+		device_pm_lock();
 		local_irq_disable();
 		/* At this point, device_suspend() has been called,
 		 * but *not* device_power_down(). We *must*

kernel/kexec.c int kernel_kexec(void) · line 1492

Quoted 7 lines
kernel/kexec.c +1 -0
@@ -1485,6 +1486,7 @@ int kernel_kexec(void)
 		device_power_up(PMSG_RESTORE);
  Enable_irqs:
 		local_irq_enable();
+		device_pm_unlock();
 		enable_nonboot_cpus();
  Resume_devices:
 		device_resume(PMSG_RESTORE);

Would it be possible to create common function for hibernation and kexec? Keeping complex stuff like this in sync is ugly.
Pavel

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

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
author
#2 lore raw
Quoted 23 lines · Pavel Machek
Quoted 23 lines

Add device_pm_lock() and device_pm_unlock() in kernel_kexec() to be in sync with current hibernation implementation.

---
 kernel/kexec.c |    2 ++
 1 file changed, 2 insertions(+)
kernel/kexec.c +1 -0
@@ -1457,6 +1457,7 @@ int kernel_kexec(void)
 		error = disable_nonboot_cpus();
 		if (error)
 			goto Resume_devices;
+		device_pm_lock();
 		local_irq_disable();
 		/* At this point, device_suspend() has been called,
 		 * but *not* device_power_down(). We *must*
@@ -1485,6 +1486,7 @@ int kernel_kexec(void)
 		device_power_up(PMSG_RESTORE);
  Enable_irqs:
 		local_irq_enable();
Quoted 8 lines

kernel/kexec.c int kernel_kexec(void) · line 1492

Quoted 5 lines
kernel/kexec.c +1 -0
+		device_pm_unlock();
 		enable_nonboot_cpus();
  Resume_devices:
 		device_resume(PMSG_RESTORE);

Would it be possible to create common function for hibernation and kexec? Keeping complex stuff like this in sync is ugly.

Yes, it is ugly. But it is a little difficult to do that. Hibernation one is more complex than this one.

Best Regards,
Huang Ying

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec