]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
c09fd2a2a43d2ca5a9282aeae32251a68432b900
[thirdparty/kernel/stable-queue.git] /
1 From 79149001105f18bd2285ada109f9229ea24a7571 Mon Sep 17 00:00:00 2001
2 From: Lv Zheng <lv.zheng@intel.com>
3 Date: Wed, 29 Oct 2014 11:33:49 +0800
4 Subject: ACPI / EC: Fix regression due to conflicting firmware behavior between Samsung and Acer.
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 From: Lv Zheng <lv.zheng@intel.com>
10
11 commit 79149001105f18bd2285ada109f9229ea24a7571 upstream.
12
13 It is reported that Samsung laptops that need to poll events are broken by
14 the following commit:
15 Commit 3afcf2ece453e1a8c2c6de19cdf06da3772a1b08
16 Subject: ACPI / EC: Add support to disallow QR_EC to be issued when SCI_EVT isn't set
17
18 The behaviors of the 2 vendor firmwares are conflict:
19 1. Acer: OSPM shouldn't issue QR_EC unless SCI_EVT is set, firmware
20 automatically sets SCI_EVT as long as there is event queued up.
21 2. Samsung: OSPM should issue QR_EC whatever SCI_EVT is set, firmware
22 returns 0 when there is no event queued up.
23
24 This patch is a quick fix to distinguish the behaviors to make Acer
25 behavior only effective for Acer EC firmware so that the breakages on
26 Samsung EC firmware can be avoided.
27
28 Fixes: 3afcf2ece453 (ACPI / EC: Add support to disallow QR_EC to be issued ...)
29 Link: https://bugzilla.kernel.org/show_bug.cgi?id=44161
30 Reported-and-tested-by: Ortwin Glück <odi@odi.ch>
31 Signed-off-by: Lv Zheng <lv.zheng@intel.com>
32 [ rjw : Subject ]
33 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
34 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
35
36 ---
37 drivers/acpi/ec.c | 25 ++++++++++++++++++-------
38 1 file changed, 18 insertions(+), 7 deletions(-)
39
40 --- a/drivers/acpi/ec.c
41 +++ b/drivers/acpi/ec.c
42 @@ -126,6 +126,7 @@ static int EC_FLAGS_MSI; /* Out-of-spec
43 static int EC_FLAGS_VALIDATE_ECDT; /* ASUStec ECDTs need to be validated */
44 static int EC_FLAGS_SKIP_DSDT_SCAN; /* Not all BIOS survive early DSDT scan */
45 static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */
46 +static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */
47
48 /* --------------------------------------------------------------------------
49 Transaction Management
50 @@ -210,13 +211,8 @@ static bool advance_transaction(struct a
51 }
52 return wakeup;
53 } else {
54 - /*
55 - * There is firmware refusing to respond QR_EC when SCI_EVT
56 - * is not set, for which case, we complete the QR_EC
57 - * without issuing it to the firmware.
58 - * https://bugzilla.kernel.org/show_bug.cgi?id=86211
59 - */
60 - if (!(status & ACPI_EC_FLAG_SCI) &&
61 + if (EC_FLAGS_QUERY_HANDSHAKE &&
62 + !(status & ACPI_EC_FLAG_SCI) &&
63 (t->command == ACPI_EC_COMMAND_QUERY)) {
64 t->flags |= ACPI_EC_COMMAND_POLL;
65 t->rdata[t->ri++] = 0x00;
66 @@ -981,6 +977,18 @@ static int ec_enlarge_storm_threshold(co
67 }
68
69 /*
70 + * Acer EC firmware refuses to respond QR_EC when SCI_EVT is not set, for
71 + * which case, we complete the QR_EC without issuing it to the firmware.
72 + * https://bugzilla.kernel.org/show_bug.cgi?id=86211
73 + */
74 +static int ec_flag_query_handshake(const struct dmi_system_id *id)
75 +{
76 + pr_debug("Detected the EC firmware requiring QR_EC issued when SCI_EVT set\n");
77 + EC_FLAGS_QUERY_HANDSHAKE = 1;
78 + return 0;
79 +}
80 +
81 +/*
82 * On some hardware it is necessary to clear events accumulated by the EC during
83 * sleep. These ECs stop reporting GPEs until they are manually polled, if too
84 * many events are accumulated. (e.g. Samsung Series 5/9 notebooks)
85 @@ -1054,6 +1062,9 @@ static struct dmi_system_id ec_dmi_table
86 {
87 ec_clear_on_resume, "Samsung hardware", {
88 DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD.")}, NULL},
89 + {
90 + ec_flag_query_handshake, "Acer hardware", {
91 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), }, NULL},
92 {},
93 };
94