]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.9.170/acpi-sbs-fix-gpe-storm-on-recent-macbookpro-s.patch
remove unneeded perf patch from 4.9
[thirdparty/kernel/stable-queue.git] / releases / 4.9.170 / acpi-sbs-fix-gpe-storm-on-recent-macbookpro-s.patch
1 From f34983a7c3ef9a4591986163d084eb7a4c7218f2 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Ronald=20Tschal=C3=A4r?= <ronald@innovation.ch>
3 Date: Sun, 30 Sep 2018 19:52:51 -0700
4 Subject: ACPI / SBS: Fix GPE storm on recent MacBookPro's
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 [ Upstream commit ca1721c5bee77105829cbd7baab8ee0eab85b06d ]
10
11 On Apple machines, plugging-in or unplugging the power triggers a GPE
12 for the EC. Since these machines expose an SBS device, this GPE ends
13 up triggering the acpi_sbs_callback(). This in turn tries to get the
14 status of the SBS charger. However, on MBP13,* and MBP14,* machines,
15 performing the smbus-read operation to get the charger's status triggers
16 the EC's GPE again. The result is an endless re-triggering and handling
17 of that GPE, consuming significant CPU resources (> 50% in irq).
18
19 In the end this is quite similar to commit 3031cddea633 (ACPI / SBS:
20 Don't assume the existence of an SBS charger), except that on the above
21 machines a status of all 1's is returned. And like there, we just want
22 ignore the charger here.
23
24 Link: https://bugzilla.kernel.org/show_bug.cgi?id=198169
25 Signed-off-by: Ronald Tschalär <ronald@innovation.ch>
26 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
27 Signed-off-by: Sasha Levin <sashal@kernel.org>
28 ---
29 drivers/acpi/sbs.c | 8 ++++++--
30 1 file changed, 6 insertions(+), 2 deletions(-)
31
32 diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
33 index ad0b13ad4bbb..4a76000bcf7a 100644
34 --- a/drivers/acpi/sbs.c
35 +++ b/drivers/acpi/sbs.c
36 @@ -443,9 +443,13 @@ static int acpi_ac_get_present(struct acpi_sbs *sbs)
37
38 /*
39 * The spec requires that bit 4 always be 1. If it's not set, assume
40 - * that the implementation doesn't support an SBS charger
41 + * that the implementation doesn't support an SBS charger.
42 + *
43 + * And on some MacBooks a status of 0xffff is always returned, no
44 + * matter whether the charger is plugged in or not, which is also
45 + * wrong, so ignore the SBS charger for those too.
46 */
47 - if (!((status >> 4) & 0x1))
48 + if (!((status >> 4) & 0x1) || status == 0xffff)
49 return -ENODEV;
50
51 sbs->charger_present = (status >> 15) & 0x1;
52 --
53 2.19.1
54