From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Lekensteyn <lekensteyn@gmail.com>
Cc: rockorequin@hotmail.com,
"Cristian Rodríguez" <crrodriguez@opensuse.org>,
"ACPI Devel Mailing List" <linux-acpi@vger.kernel.org>,
"Len Brown" <lenb@kernel.org>, "Lin Ming" <ming.m.lin@intel.com>,
"Linux PM list" <linux-pm@vger.kernel.org>
Subject: [PATCH] ACPI / PCI / PM: Fix device PM regression related to D3hot/D3cold
Date: Wed, 16 May 2012 22:15:21 +0200 [thread overview]
Message-ID: <201205162215.21429.rjw@sisk.pl> (raw)
In-Reply-To: <201205161224.26007.rjw@sisk.pl>
From: Rafael J. Wysocki <rjw@sisk.pl>
Commit 1cc0c998fdf2cb665d625fb565a0d6db5c81c639 (ACPI: Fix D3hot
v D3cold confusion) introduced a bug in __acpi_bus_set_power() and
changed the behavior of acpi_pci_set_power_state() in such a way that
it generally doesn't work as expected if PCI_D3hot is passed to it
as the second argument.
First off, if ACPI_STATE_D3 (equal to ACPI_STATE_D3_COLD) is passed
to __acpi_bus_set_power() and the explicit_set flag is set for the
D3cold state, the function will try to execute AML method called
"_PS4", which doesn't exist.
Fix this by adding a check to ensure that the name of the AML method
to execute for transitions to ACPI_STATE_D3_COLD is correct in
__acpi_bus_set_power().
Second, if PCI_D3hot is passed to acpi_pci_set_power_state() as the
target state, the function will request a transition to
ACPI_STATE_D3_HOT instead of ACPI_STATE_D3. However,
ACPI_STATE_D3_HOT is now only marked as supported if the _PR3 AML
method is defined for the given device, which is rare. This causes
problems to happen on systems where devices were successfully put
into ACPI D3 by pci_set_power_state(PCI_D3hot) which doesn't work
now. In particular, some unused graphics adapters are not turned
off as a result.
To fix this issue restore the old behavior of
acpi_pci_set_power_state(), which is to request a transition to
ACPI_STATE_D3 (equal to ACPI_STATE_D3_COLD) if either PCI_D3hot or
PCI_D3cold is passed to it as the argument.
This approach is not ideal, because generally power should not
be removed from devices if PCI_D3hot is the target power state,
but since this behavior is relied on, we have no choice but to
restore it at the moment and spend more time on designing a
better solution in the future.
References: https://bugzilla.kernel.org/show_bug.cgi?id=43228
Reported-by: rocko <rockorequin@hotmail.com>
Reported-by: Lekensteyn <lekensteyn@gmail.com>
Reported-by: Cristian Rodríguez <crrodriguez@opensuse.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
Hi all,
The previous patch was incomplete, so please test this one instead.
Thanks,
Rafael
---
drivers/acpi/bus.c | 4 ++++
drivers/pci/pci-acpi.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
Index: linux/drivers/pci/pci-acpi.c
===================================================================
--- linux.orig/drivers/pci/pci-acpi.c
+++ linux/drivers/pci/pci-acpi.c
@@ -223,7 +223,7 @@ static int acpi_pci_set_power_state(stru
[PCI_D0] = ACPI_STATE_D0,
[PCI_D1] = ACPI_STATE_D1,
[PCI_D2] = ACPI_STATE_D2,
- [PCI_D3hot] = ACPI_STATE_D3_HOT,
+ [PCI_D3hot] = ACPI_STATE_D3,
[PCI_D3cold] = ACPI_STATE_D3
};
int error = -EINVAL;
Index: linux/drivers/acpi/bus.c
===================================================================
--- linux.orig/drivers/acpi/bus.c
+++ linux/drivers/acpi/bus.c
@@ -250,6 +250,10 @@ static int __acpi_bus_set_power(struct a
return -ENODEV;
}
+ /* _PS3 should be executed for transitions into D3cold. */
+ if (state == ACPI_STATE_D3_COLD)
+ object_name[3] = '3';
+
/*
* Transition Power
* ----------------
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-05-16 20:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-15 15:28 [PATCH] acpi: fix regression on D3hot detection Lekensteyn
2012-05-15 15:47 ` Rafael J. Wysocki
[not found] ` <1430051.zWhrZKIcmE@penguin>
2012-05-15 17:28 ` Rafael J. Wysocki
2012-05-16 10:24 ` Rafael J. Wysocki
2012-05-16 20:15 ` Rafael J. Wysocki [this message]
2012-05-16 20:50 ` [Update][PATCH] ACPI / PCI / PM: Fix device PM regression related to D3hot/D3cold Rafael J. Wysocki
2012-05-16 20:47 ` Cristian Rodríguez
2012-05-16 21:01 ` Rafael J. Wysocki
2012-05-17 19:34 ` [Update 3x][PATCH] " Rafael J. Wysocki
2012-05-17 21:56 ` [Update 4x][PATCH] " Rafael J. Wysocki
-- strict thread matches above, loose matches on Subject: below --
2012-05-17 22:39 [PATCH] " Rafael J. Wysocki
2012-05-18 5:56 ` Cristian Rodríguez
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=201205162215.21429.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=crrodriguez@opensuse.org \
--cc=lekensteyn@gmail.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=ming.m.lin@intel.com \
--cc=rockorequin@hotmail.com \
/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;
as well as URLs for NNTP newsgroup(s).