public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: "Barry K. Nathan" <barryn@pobox.com>
Cc: lindqvist@netstar.se, edi@gmx.de, john@hjsoft.com,
	linux-kernel@vger.kernel.org, akpm@osdl.org, torvalds@osdl.org
Subject: Re: [PATCH] swsusp: properly suspend and resume *all* devices
Date: Mon, 3 Jan 2005 19:33:18 +0100	[thread overview]
Message-ID: <20050103183317.GA1353@elf.ucw.cz> (raw)
In-Reply-To: <20050103170807.GA8163@elf.ucw.cz>

On Po 03-01-05 18:08:07, Pavel Machek wrote:
> Hi!
> 
> > swsusp does not suspend and resume *all* devices, including system
> > devices. This has been the case since at least 2.6.9, if not earlier.
> > 
> > One effect of this is that resuming fails to properly reconfigure
> > interrupt routers. In 2.6.9 this was obscured by other kernel code,
> > but in 2.6.10 this often causes post-resume APIC errors and near-total
> > failure of some PCI devices (e.g. network, sound and USB controllers).
> > 
> > On at least one of my systems, without this patch I also have to "ifdown
> > eth0;ifup eth0" to get networking to function after resuming, even after
> > working around the interrupt routing problem mentioned above. With this
> > patch, networking simply works after a resume, and the ifdown/ifup is
> > no longer needed.
> > 
> > This patch is against 2.6.10-mm1, although it applies with an offset to
> > 2.6.10-bk4 as well. I have tested it against 2.6.10-mm1 and 2.6.10-bk4,
> > with and without "noapic", with and without "acpi=off". However, I have
> > not tested it on a highmem system.
> > 
> > I believe this patch fixes a severe problem in swsusp; I would like to
> > see this patch (or at least *some* kind of fix for this problem) tested
> > more widely and committed to mainline before the 2.6.11 release.
> > 
> > Signed-off-by: Barry K. Nathan <barryn@pobox.com>
> 
> Ack. [I have similar patch in my tree, but yours is better in error
> checking area. Please push it to akpm.]

Actually you missed second half: same code should be added around
swsusp_arch_resume. It is not too critical there, but its right thing
to do.
									Pavel

> > --- linux-2.6.10-mm1/kernel/power/swsusp.c	2005-01-03 02:16:15.175265255 -0800
> > +++ linux-2.6.10-mm1-bkn3/kernel/power/swsusp.c	2005-01-03 06:27:07.753344731 -0800
> > @@ -843,11 +843,22 @@
> >  	if ((error = arch_prepare_suspend()))
> >  		return error;
> >  	local_irq_disable();
> > +	/* At this point, device_suspend() has been called, but *not*
> > +	 * device_power_down(). We *must* device_power_down() now.
> > +	 * Otherwise, drivers for some devices (e.g. interrupt controllers)
> > +	 * become desynchronized with the actual state of the hardware
> > +	 * at resume time, and evil weirdness ensues.
> > +	 */
> > +	if ((error = device_power_down(PM_SUSPEND_DISK))) {
> > +		local_irq_enable();
> > +		return error;
> > +	}
> >  	save_processor_state();
> >  	error = swsusp_arch_suspend();
> >  	/* Restore control flow magically appears here */
> >  	restore_processor_state();
> >  	restore_highmem();
> > +	device_power_up();
> >  	local_irq_enable();
> >  	return error;
> >  }
> 

-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

  reply	other threads:[~2005-01-03 18:52 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-28 14:47 2.6.10: e100 network broken after swsusp/resume John M Flinchbaugh
2004-12-28 21:25 ` Håkan Lindqvist
2005-01-01 23:41   ` Eduard Bloch
2005-01-01 17:23 ` Pavel Machek
2005-01-01 22:17   ` John M Flinchbaugh
2005-01-01 22:52     ` Pavel Machek
2005-01-01 23:14     ` Matthew Garrett
2005-01-02  3:46       ` Barry K. Nathan
2005-01-02  5:57   ` Barry K. Nathan
2005-01-02 18:42     ` John M Flinchbaugh
2005-01-02 20:09       ` Håkan Lindqvist
2005-01-03  5:10         ` Barry K. Nathan
2005-01-03  8:31           ` Barry K. Nathan
2005-01-03  8:53             ` Pavel Machek
2005-01-03  8:47           ` Pavel Machek
2005-01-03 10:14             ` Barry K. Nathan
2005-01-03 15:05               ` [PATCH] swsusp: properly suspend and resume *all* devices Barry K. Nathan
2005-01-03 17:08                 ` Pavel Machek
2005-01-03 18:33                   ` Pavel Machek [this message]
2005-01-04  5:15                     ` Barry K. Nathan
2005-01-04  5:18                       ` Barry K. Nathan
2005-01-04  8:44                 ` Martin Lucina
2005-01-04 10:30                   ` 2.6.10 suspend/resume bustage (was Re: [PATCH] swsusp: properly suspend and resume *all* devices) Martin Lucina
2005-01-04 21:43                   ` [PATCH] swsusp: properly suspend and resume *all* devices Pavel Machek
2005-01-05 15:57                     ` Lion Vollnhals
2005-01-06 22:29                       ` Pavel Machek
2005-01-07 13:47                         ` Takashi Iwai
2005-01-07 13:54                           ` Pavel Machek
2005-01-07 14:48                             ` Dmitry Torokhov
2005-01-07 15:35                             ` Vojtech Pavlik
2005-01-07 15:59                         ` Lion Vollnhals

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050103183317.GA1353@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=akpm@osdl.org \
    --cc=barryn@pobox.com \
    --cc=edi@gmx.de \
    --cc=john@hjsoft.com \
    --cc=lindqvist@netstar.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox