[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <c22b03a036ea97a94cfe7a2d878ff63c93174d43.1405391679.git.lv.zheng@intel.com>
Date: Tue, 15 Jul 2014 11:15:00 +0800
From: Lv Zheng <lv.zheng@...el.com>
To: "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Len Brown <len.brown@...el.com>
Cc: Lv Zheng <lv.zheng@...el.com>, Lv Zheng <zetalog@...il.com>,
<linux-kernel@...r.kernel.org>, linux-acpi@...r.kernel.org
Subject: [PATCH v2 06/10] ACPI/EC: Add a warning message to indicate event storms.
This patch splits query handler scheduling into a new seperate function
acpi_ec_notify_query_handlers() and adds a warning message in it to
indicate a BIOS bug. It is reported that EC event storm can happen in case
there is no handler prepared for the event. No functional changes.
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=78091
Reported-by: Steffen Weber <steffen.weber@...il.com>
Signed-off-by: Lv Zheng <lv.zheng@...el.com>
---
drivers/acpi/ec.c | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index cf83872..8817836 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -669,32 +669,39 @@ static void acpi_ec_run(void *cxt)
acpi_ec_put_query_handler(handler);
}
-static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data)
+static int acpi_ec_notify_query_handlers(struct acpi_ec *ec, u8 query_bit)
{
- u8 value = 0;
- int status;
struct acpi_ec_query_handler *handler;
- status = acpi_ec_query_unlocked(ec, &value);
- if (data)
- *data = value;
- if (status)
- return status;
-
list_for_each_entry(handler, &ec->list, node) {
- if (value == handler->query_bit) {
+ if (query_bit == handler->query_bit) {
/* have custom handler for this bit */
handler = acpi_ec_get_query_handler(handler);
pr_debug("push query execution (0x%2x) on queue\n",
- value);
+ query_bit);
return acpi_os_execute((handler->func) ?
OSL_NOTIFY_HANDLER : OSL_GPE_HANDLER,
acpi_ec_run, handler);
}
}
+ pr_warn_once("BIOS bug: no handler for query (0x%02x)\n", query_bit);
return 0;
}
+static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data)
+{
+ u8 value = 0;
+ int status;
+
+ status = acpi_ec_query_unlocked(ec, &value);
+ if (data)
+ *data = value;
+ if (status)
+ return status;
+
+ return acpi_ec_notify_query_handlers(ec, value);
+}
+
static void acpi_ec_gpe_query(void *ec_cxt)
{
struct acpi_ec *ec = ec_cxt;
--
1.7.10
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists