1 From 558e4736f2e1b0e6323adf7a5e4df77ed6cfc1a4 Mon Sep 17 00:00:00 2001
2 From: Lv Zheng <lv.zheng@intel.com>
3 Date: Thu, 21 Aug 2014 14:41:26 +0800
4 Subject: ACPI / EC: Add support to disallow QR_EC to be issued before completing previous QR_EC
6 From: Lv Zheng <lv.zheng@intel.com>
8 commit 558e4736f2e1b0e6323adf7a5e4df77ed6cfc1a4 upstream.
10 There is platform refusing to respond QR_EC when SCI_EVT isn't set
11 which is Acer Aspire V5-573G.
13 By disallowing QR_EC to be issued before the previous one has been
14 completed we are able to reduce the possibilities to trigger issues on
17 Note that this fix can only reduce the occurrence rate of this issue, but
18 this issue may still occur when such a platform doesn't clear SCI_EVT
19 before or immediately after completing the previous QR_EC transaction.
20 This patch cannot fix the CLEAR_ON_RESUME quirk which also relies on
21 the assumption that the platforms are able to respond even when SCI_EVT
24 But this patch is still useful as it can help to reduce the number of
25 scheduled QR_EC work items.
27 Link: https://bugzilla.kernel.org/show_bug.cgi?id=82611
28 Reported-and-tested-by: Alexander Mezin <mezin.alexander@gmail.com>
29 Signed-off-by: Lv Zheng <lv.zheng@intel.com>
30 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
31 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
35 drivers/acpi/ec.c | 4 ++--
36 1 file changed, 2 insertions(+), 2 deletions(-)
38 --- a/drivers/acpi/ec.c
39 +++ b/drivers/acpi/ec.c
40 @@ -299,11 +299,11 @@ static int acpi_ec_transaction_unlocked(
41 /* following two actions should be kept atomic */
43 start_transaction(ec);
44 + if (ec->curr->command == ACPI_EC_COMMAND_QUERY)
45 + clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
46 spin_unlock_irqrestore(&ec->lock, tmp);
48 spin_lock_irqsave(&ec->lock, tmp);
49 - if (ec->curr->command == ACPI_EC_COMMAND_QUERY)
50 - clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
52 spin_unlock_irqrestore(&ec->lock, tmp);