From: Carlos Corbacho <carlos@strangeworlds.co.uk>
To: linux-acpi@vger.kernel.org
Cc: lenb@kernel.org
Subject: [PATCH 4/4] ACPI: WMI: Clean up handling of spec violating data blocks
Date: Sun, 24 Feb 2008 13:34:34 +0000 [thread overview]
Message-ID: <20080224133434.2317.84600.stgit@pacifica> (raw)
In-Reply-To: <20080224133412.2317.5802.stgit@pacifica>
Acer violate the ACPI-WMI spec by declaring some of their data blocks as
expensive, but with no corresponding WCxx method. There is already some
workaround code in to handle the initial WCxx call (we just ignore a
failure here); but we need to properly check if the second, "clean up",
WCxx call is actually needed or not, rather than fail simply because it
isn't there.
Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
---
drivers/acpi/wmi.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/wmi.c b/drivers/acpi/wmi.c
index efacc9f..c33b1c6 100644
--- a/drivers/acpi/wmi.c
+++ b/drivers/acpi/wmi.c
@@ -293,7 +293,7 @@ struct acpi_buffer *out)
{
struct guid_block *block = NULL;
struct wmi_block *wblock = NULL;
- acpi_handle handle;
+ acpi_handle handle, wc_handle;
acpi_status status, wc_status = AE_ERROR;
struct acpi_object_list input, wc_input;
union acpi_object wc_params[1], wq_params[1];
@@ -338,8 +338,10 @@ struct acpi_buffer *out)
* expensive, but have no corresponding WCxx method. So we
* should not fail if this happens.
*/
- wc_status = acpi_evaluate_object(handle, wc_method,
- &wc_input, NULL);
+ wc_status = acpi_get_handle(handle, wc_method, &wc_handle);
+ if (ACPI_SUCCESS(wc_status))
+ wc_status = acpi_evaluate_object(handle, wc_method,
+ &wc_input, NULL);
}
strcpy(method, "WQ");
@@ -351,7 +353,7 @@ struct acpi_buffer *out)
* If ACPI_WMI_EXPENSIVE, call the relevant WCxx method, even if
* the WQxx method failed - we should disable collection anyway.
*/
- if ((block->flags & ACPI_WMI_EXPENSIVE) && wc_status) {
+ if ((block->flags & ACPI_WMI_EXPENSIVE) && ACPI_SUCCESS(wc_status)) {
wc_params[0].integer.value = 0;
status = acpi_evaluate_object(handle,
wc_method, &wc_input, NULL);
next prev parent reply other threads:[~2008-02-24 13:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-24 13:34 [PATCH 0/4] ACPI-WMI patches for 2.6.25-rc3 Carlos Corbacho
2008-02-24 13:34 ` [PATCH 1/4] acer-wmi: Rename mail LED correctly & remove hardcoded colour Carlos Corbacho
2008-03-11 21:59 ` Len Brown
2008-02-24 13:34 ` [PATCH 2/4] acer-wmi: Make device detection error messages more descriptive Carlos Corbacho
2008-03-11 21:57 ` Len Brown
2008-03-11 22:10 ` Carlos Corbacho
2008-02-24 13:34 ` [PATCH 3/4] acer-wmi: Don't warn if mail LED cannot be detected Carlos Corbacho
2008-03-11 21:59 ` Len Brown
2008-02-24 13:34 ` Carlos Corbacho [this message]
2008-03-11 22:00 ` [PATCH 4/4] ACPI: WMI: Clean up handling of spec violating data blocks 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=20080224133434.2317.84600.stgit@pacifica \
--to=carlos@strangeworlds.co.uk \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.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