public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/6] kexec jump: in sync with hibernation implementation
@ 2008-08-07  9:05 Huang Ying
  2008-08-07  9:22 ` Pavel Machek
  0 siblings, 1 reply; 3+ messages in thread
From: Huang Ying @ 2008-08-07  9:05 UTC (permalink / raw)
  To: Eric W. Biederman, Pavel Machek, nigel, Rafael J. Wysocki,
	Andrew Morton, Vivek Goyal, mingo, Linus Torvalds
  Cc: linux-kernel, Kexec Mailing List

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

Signed-off-by: Huang Ying <ying.huang@intel.com>

---
 kernel/kexec.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -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);



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 4/6] kexec jump: in sync with hibernation implementation
  2008-08-07  9:05 [PATCH 4/6] kexec jump: in sync with hibernation implementation Huang Ying
@ 2008-08-07  9:22 ` Pavel Machek
  2008-08-07  9:33   ` Huang Ying
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Machek @ 2008-08-07  9:22 UTC (permalink / raw)
  To: Huang Ying
  Cc: Eric W. Biederman, nigel, Rafael J. Wysocki, Andrew Morton,
	Vivek Goyal, mingo, Linus Torvalds, linux-kernel,
	Kexec Mailing List

> Add device_pm_lock() and device_pm_unlock() in kernel_kexec() to be
> in sync with current hibernation implementation.
> 
> Signed-off-by: Huang Ying <ying.huang@intel.com>
> 
> ---
>  kernel/kexec.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> --- a/kernel/kexec.c
> +++ b/kernel/kexec.c
> @@ -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);
> 

Would it be possible to create common function for hibernation and
kexec? Keeping complex stuff like this in sync is ugly.
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 4/6] kexec jump: in sync with hibernation implementation
  2008-08-07  9:22 ` Pavel Machek
@ 2008-08-07  9:33   ` Huang Ying
  0 siblings, 0 replies; 3+ messages in thread
From: Huang Ying @ 2008-08-07  9:33 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Eric W. Biederman, nigel, Rafael J. Wysocki, Andrew Morton,
	Vivek Goyal, mingo, Linus Torvalds, linux-kernel,
	Kexec Mailing List

On Thu, 2008-08-07 at 11:22 +0200, Pavel Machek wrote:
> > Add device_pm_lock() and device_pm_unlock() in kernel_kexec() to be
> > in sync with current hibernation implementation.
> > 
> > Signed-off-by: Huang Ying <ying.huang@intel.com>
> > 
> > ---
> >  kernel/kexec.c |    2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > --- a/kernel/kexec.c
> > +++ b/kernel/kexec.c
> > @@ -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);
> > 
> 
> 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-07 12:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-07  9:05 [PATCH 4/6] kexec jump: in sync with hibernation implementation Huang Ying
2008-08-07  9:22 ` Pavel Machek
2008-08-07  9:33   ` Huang Ying

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox