public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Andrew Morton <akpm@osdl.org>
Cc: Pavel Machek <pavel@ucw.cz>,
	linux-kernel@vger.kernel.org, barryn@pobox.com,
	marado@student.dei.uc.pt, acpi-devel@lists.sourceforge.net
Subject: Re: 2.6.11-rc4-mm1: something is wrong with swsusp powerdown
Date: 01 Mar 2005 04:08:24 -0700	[thread overview]
Message-ID: <m1u0nvr5cn.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20050301015231.091b5329.akpm@osdl.org>

Andrew Morton <akpm@osdl.org> writes:

> Pavel Machek <pavel@ucw.cz> wrote:
> >
> > In `subj` kernel, machine no longer powers down at the end of
> >  swsusp. 2.6.11-rc5-pavel works ok, as does 2.6.11-bk.
> 
> Binary searching indicates that this is due to
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.11-rc5/2.6.11-rc5-mm1/broken-out/acpi_power_off-bug-fix.patch.
> 
> 
> I'll drop it.  That patch is pretty ugly-looking anyway (ACPI code in
> drivers/base/power/?).
> 
> Perhaps someone who is hitting the problem which that patch addresses could
> raise a bugzilla entry.
> 
> Oh.  It has one.  http://bugme.osdl.org/show_bug.cgi?id=4041
> 
> Anyway.  It needs more work.

Agreed.

I threw it together to test a specific code path, and the fact it
fails in software suspend is actually almost confirmation that I am on
the right track.  This actually fixed the case I was testing.

In this case the failure is simply because system_state is
not set to SYSTEM_POWER_OFF before
kernel/power/disk.c:power_down() calls device_shutdown().
The appropriate reboot notifier is also not called..

So to fix this properly all of the places
that call machine_power_off now need to call a wrapper
that does all of the appropriate things and then calls
machine_power_off.

Likewise with the other reboot functions.

In addition a clean way to get device_shutdown() to 
call acpi_power_off_prepare() at roughly the location
I have it hard coded.  

The fundamental issue this patch was starting to address
before I ran out of steam, is that acpi_power_off_prepare()
must be called with interrupts enabled and after we have shut down
the system devices (i.e. the interrupt controllers) we can't
guarantee interrupts, are working.

I'm don't know how much earlier it is safe to
acpi_power_off_prepare().  But mostly I think we need to
throw in a fake device to attach acpi_power_off_prepare to.

Eric

  parent reply	other threads:[~2005-03-01 11:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20050228231721.GA1326@elf.ucw.cz>
     [not found] ` <20050228231721.GA1326-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-03-01  9:52   ` 2.6.11-rc4-mm1: something is wrong with swsusp powerdown Andrew Morton
2005-03-01 10:54     ` Pavel Machek
     [not found]       ` <20050301105448.GG1345-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-03-01 11:12         ` Eric W. Biederman
2005-03-01 12:02           ` Pavel Machek
2005-03-01 11:08     ` Eric W. Biederman [this message]
2005-03-01 12:08       ` Pavel Machek
2005-03-01 17:33         ` Eric W. Biederman

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=m1u0nvr5cn.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=acpi-devel@lists.sourceforge.net \
    --cc=akpm@osdl.org \
    --cc=barryn@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marado@student.dei.uc.pt \
    --cc=pavel@ucw.cz \
    /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