mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Carlos Corbacho <carlos@strangeworlds.co.uk>
To: Robert Hancock <hancockr@shaw.ca>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	"H. Peter Anvin" <hpa@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Greg KH <gregkh@suse.de>, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>, Len Brown <lenb@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	pm list <linux-pm@lists.linux-foundation.org>
Subject: Re: x86: Increase PCIBIOS_MIN_IO to 0x1500 to fix nForce 4 suspend-to-RAM
Date: Tue, 25 Dec 2007 00:03:25 +0000	[thread overview]
Message-ID: <200712250003.27570.carlos@strangeworlds.co.uk> (raw)
In-Reply-To: <4770356E.1000407@shaw.ca>

On Monday 24 December 2007 22:40:46 Robert Hancock wrote:
> The ACPI spec has the following to say about the _PTS method:
>
> "The platform must not make any assumptions about the state of the
> machine when _PTS is called. For example, operation region accesses that
> require devices to be configured and enabled may not succeed, as these
> devices may be in a non-decoding state due to plug and play or power
> management operations."

That is from the 3.0 spec though. And it looks like the definition changed 
from pre-3.0 to 3.0 and above.

This is what the 1.0B spec says (and this is also repeated verbatim in 2.0, 
2.0a, 2.0b, and 2.0c):

"The _PTS control method is executed by the operating system at the beginning 
of the sleep process for S1, S2, S3, S4, and for orderly S5 shutdown. The 
sleeping state value (1, 2, 3, 4, or 5) is passed to the _PTS control method. 
Before the OS notifies native device drivers and prepares the system software 
for a system sleeping state, it executes this ACPI control method. Thus, this 
control method can be executed a relatively long time before actually 
entering the desired sleeping state. In addition, the OS can abort the 
sleeping operation without notification to the ACPI driver, in which case 
another _PTS would occur some time before the next attempt by the OS to enter 
a sleeping state. The _PTS control method cannot modify the current 
configuration or power state of any device in the system. For example, _PTS 
would simply store the sleep type in the embedded controller in sequencing 
the system into a sleep state when the SLP_EN bit is set."

According to the earlier versions of the ACPI spec, Linux is doing the wrong 
thing - we should call _PTS() before we start powerding down devices, or 
notifying device drivers to start suspending.

So, my limited understanding of what we currently do for ACPI suspend-to-RAM 
is:

1) Freeze processes/ devices
2) Put all devices into low power mode
3) Execute _PTS()
4) Suspend system

So the problem is - our current suspend order is fine for ACPI 3.0 and above, 
but for pre-3.0 systems, this violates the older specs, where 2) and 3) 
should be reversed.

> I would guess some BIOS writers failed to heed this..

No, it looks like the BIOS is obeying the older specs, and Linux is at fault 
here for breaking the suspend logic of pre ACPI 3.0 systems.

-Carlos
-- 
E-Mail: carlos@strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D

  reply	other threads:[~2007-12-25  0:03 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.Tr7qmPdet0rF2FSRX/94s2UEMSE@ifi.uio.no>
     [not found] ` <fa.n/XQFa64Zg8snHoyB/rrKzCvAL0@ifi.uio.no>
2007-12-24 16:59   ` [Bug 9528] " Robert Hancock
     [not found] ` <fa.5MPS0t6OtOOALbc90ywKDrtik+4@ifi.uio.no>
     [not found]   ` <fa.zg2cR0292Evub+o7LgQUdg4A7ZM@ifi.uio.no>
     [not found]     ` <fa.ZBHAMdWAEaW7Flaz8/Gc8PLZUNg@ifi.uio.no>
2007-12-24 22:40       ` Robert Hancock
2007-12-25  0:03         ` Carlos Corbacho [this message]
2007-12-25  2:41           ` ACPI: _PTS ordering needs fixing for pre ACPI 3.0 systems (was: Re: x86: Increase PCIBIOS_MIN_IO to 0x1500 to fix nForce 4 suspend-to-RAM) Carlos Corbacho
2007-12-25 13:36             ` Rafael J. Wysocki
2007-12-25 14:07               ` Rafael J. Wysocki
2007-12-25 13:52                 ` Carlos Corbacho
2007-12-25 13:26           ` x86: Increase PCIBIOS_MIN_IO to 0x1500 to fix nForce 4 suspend-to-RAM Rafael J. Wysocki
2007-12-25 13:12             ` Carlos Corbacho
2007-12-25 14:11               ` Rafael J. Wysocki
2007-12-25 17:17               ` Robert Hancock
2007-12-25 18:26                 ` Rafael J. Wysocki
2007-12-26  4:29                   ` Linus Torvalds
2007-12-26  5:13                     ` Robert Hancock
2007-12-26  7:23                     ` Avi Kivity
     [not found] ` <fa.WvaVh83zJOh/eZUrjQOZy4J8JFk@ifi.uio.no>
     [not found]   ` <fa.VsyhBr+FAHB0bTb9poSZS80xN/0@ifi.uio.no>
     [not found]     ` <fa.XycBwhGuyvtVl/QW5HONqLwOags@ifi.uio.no>
2007-12-27 18:07       ` Suspend code ordering (again) Robert Hancock
2007-12-27 20:00         ` Rafael J. Wysocki
2007-12-28  0:25           ` Robert Hancock
2007-12-28  5:41             ` Linus Torvalds
2008-01-08  3:03             ` Shaohua Li
     [not found] <200712231419.40207.carlos@strangeworlds.co.uk>
2007-12-23 16:30 ` x86: Increase PCIBIOS_MIN_IO to 0x1500 to fix nForce 4 suspend-to-RAM Rafael J. Wysocki
2007-12-23 17:57   ` Ingo Molnar
2007-12-23 18:00   ` Linus Torvalds
2007-12-23 22:20     ` Rafael J. Wysocki
2007-12-23 23:12       ` H. Peter Anvin
2007-12-24  0:09         ` Carlos Corbacho
2007-12-24  0:56           ` Linus Torvalds
2007-12-24  1:14             ` Linus Torvalds
2007-12-24  3:05               ` Carlos Corbacho
2007-12-24 13:44                 ` Rafael J. Wysocki
2007-12-24 18:34                   ` Linus Torvalds
2007-12-24 21:53                     ` Carlos Corbacho
2007-12-25 12:12   ` Pavel Machek
2007-12-25 12:28     ` Carlos Corbacho

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=200712250003.27570.carlos@strangeworlds.co.uk \
    --to=carlos@strangeworlds.co.uk \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@suse.de \
    --cc=hancockr@shaw.ca \
    --cc=hpa@kernel.org \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=mingo@elte.hu \
    --cc=rjw@sisk.pl \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®