From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Len Brown <lenb@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Matthew Garrett <mjg59@srcf.ucam.org>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Linux-pm mailing list <linux-pm@lists.linux-foundation.org>,
Andreas Mohr <andi@lisas.de>,
Maciej Rutecki <maciej.rutecki@gmail.com>
Subject: [PATCH 9/11] ACPI: Always check if _PRW is present before trying to evaluate it
Date: Thu, 6 Jan 2011 23:40:00 +0100 [thread overview]
Message-ID: <201101062340.00868.rjw@sisk.pl> (raw)
In-Reply-To: <201101062331.17079.rjw@sisk.pl>
From: Rafael J. Wysocki <rjw@sisk.pl>
Before evaluating _PRW for devices that are reported as inactive or
not present by their _STA control methods we should check if those
methods are actually present (otherwise the evaulation of _PRW will
obviously fail and a scary message will be printed unnecessarily).
Reported-by: Andreas Mohr <andi@lisas.de>
Reported-by: Maciej Rutecki <maciej.rutecki@gmail.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/acpi/scan.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Index: linux-2.6/drivers/acpi/scan.c
===================================================================
--- linux-2.6.orig/drivers/acpi/scan.c
+++ linux-2.6/drivers/acpi/scan.c
@@ -1388,7 +1388,6 @@ static acpi_status acpi_bus_check_add(ac
struct acpi_bus_ops *ops = context;
int type;
unsigned long long sta;
- struct acpi_device_wakeup wakeup;
struct acpi_device *device;
acpi_status status;
int result;
@@ -1399,7 +1398,13 @@ static acpi_status acpi_bus_check_add(ac
if (!(sta & ACPI_STA_DEVICE_PRESENT) &&
!(sta & ACPI_STA_DEVICE_FUNCTIONING)) {
- acpi_bus_extract_wakeup_device_power_package(handle, &wakeup);
+ struct acpi_device_wakeup wakeup;
+ acpi_handle temp;
+
+ status = acpi_get_handle(handle, "_PRW", &temp);
+ if (ACPI_SUCCESS(status))
+ acpi_bus_extract_wakeup_device_power_package(handle,
+ &wakeup);
return AE_CTRL_DEPTH;
}
next prev parent reply other threads:[~2011-01-06 22:40 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-06 22:31 [PATCH 0/11] Various ACPI patches for 2.6.38 Rafael J. Wysocki
2011-01-06 22:32 ` [PATCH 1/11] ACPI / ACPICA: Fix global lock acquisition Rafael J. Wysocki
2011-01-06 22:33 ` [PATCH 2/11] ACPI / PM: Do not enable multiple devices to wake up simultaneously Rafael J. Wysocki
2011-01-06 22:34 ` [PATCH 3/11] ACPI / PM: Use device wakeup flags for handling ACPI wakeup devices Rafael J. Wysocki
2011-01-06 22:35 ` [PATCH 4/11] ACPI / PM: Drop special ACPI wakeup flags Rafael J. Wysocki
2011-01-06 22:36 ` [PATCH 5/11] ACPI / PM: Report wakeup events from buttons Rafael J. Wysocki
2011-01-06 22:37 ` [PATCH 6/11] ACPI / PM: Blacklist Averatec machine known to require acpi_sleep=nonvs Rafael J. Wysocki
2011-01-06 22:38 ` [PATCH 7/11] ACPI / PM: Rename acpi_power_off_device() Rafael J. Wysocki
2011-01-06 22:38 ` [PATCH 8/11] ACPI / PM: Check status of power resources under mutexes Rafael J. Wysocki
2011-01-06 22:40 ` Rafael J. Wysocki [this message]
2011-01-06 22:41 ` [PATCH 10/11] ACPI: Drop device flag wake_capable Rafael J. Wysocki
2011-01-06 23:52 ` [linux-pm] " David Brownell
2011-01-07 0:22 ` Rafael J. Wysocki
2011-01-06 22:42 ` [PATCH 11/11] ACPI / Battery: Update information on info notification and resume Rafael J. Wysocki
2012-05-01 18:47 ` [bug?] Battery notifications produce flashing battery icon, syslog spam (Re: [PATCH 11/11] ACPI / Battery: Update information on info notification and resume) Jonathan Nieder
2012-05-01 19:00 ` Adrian Fita
2012-05-01 19:14 ` Jonathan Nieder
2012-05-01 19:42 ` Ralf Jung
2012-05-02 11:49 ` Paolo Scarabelli
2012-05-03 8:54 ` Andy Whitcroft
2012-05-03 12:47 ` Matthew Garrett
2012-05-03 13:48 ` [PATCH 1/1] battery: only refresh the sysfs files when pertinant information changes Andy Whitcroft
2012-05-04 13:29 ` Ralf Jung
2012-05-05 10:37 ` Adrian Fita
2012-05-08 5:50 ` Len Brown
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=201101062340.00868.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=andi@lisas.de \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=maciej.rutecki@gmail.com \
--cc=mjg59@srcf.ucam.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;
as well as URLs for NNTP newsgroup(s).