Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp900064yba; Thu, 18 Apr 2019 11:27:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsfWYqIWJpKl0ijAUu/W+P1s1lJq87SJ4J+SysTjAyBAbEBev6efFQaVwTeoEbw6YnfHP7 X-Received: by 2002:a17:902:e4:: with SMTP id a91mr78557420pla.2.1555612046106; Thu, 18 Apr 2019 11:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555612046; cv=none; d=google.com; s=arc-20160816; b=o7FcyQE6QkAQtgBImpRGnRbYJJ2lMbvNYUQHB6VTbZ8KWCK6Wv+ASqQlxPozxhBf57 ZtDCTHYX/ezWqUfHSkNZL3Q4fXkqAliyzp/YyZPH4GgxOwA6tq8Qg74dlkcH+ZCpnRUQ 1DkR0m05TzxYv1/tMs+ywWGvSrO7hNjonHTshCy5s/PzUZjBDNJZNtYbNSQjvz2V8HFE Hka1LwTPB4cPoGO7cLCG9NMPf34HqtVW0v2D5i1RawPq53m/QjTnU9M8Q7MrAORcetyH /U+ZeNm/YArE1wUX5cZCgJxwHSqG10rOICLJ1QoZr5jpkIA1LorHPpe7TxRNX0AtGEh3 0Gzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YWXN1c3nx5a/bcU1pIQxXexkDfpwZqCqwqejHRW2N4I=; b=co84gZQkfwnW8teMVMHQTq966rqlQpVVDlyF/70wgeNVkoNs855L/p2R6bfWQS6YRo C/A3jwpuvu9WwkxaC0mD+tJUBMVnnILF10ksQFH9aEoFKNtJOgi92/EVHa+4ztejH11Q AGM8SJyorPayQ3vOolmDCac1Jdd03l/Vn5rz/BDCHl2WPniTw83FcyOR0Yx1Be/XaGL8 bCMIj0QAOptHehVv1WG6bmcm3Zt9uTSqM/110sCrrsZgmNMCPr266T2gSaDog/z/NcW3 Zh39iJNInHYv4kTKZl1PL5T9pbjWMxiX6D8RHr0ax1q+KkJJ4JKj7d4Vv/835HtlbN1F /BvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="sAj/iBQn"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k132si2634045pgc.131.2019.04.18.11.27.11; Thu, 18 Apr 2019 11:27:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="sAj/iBQn"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403865AbfDRS0J (ORCPT + 99 others); Thu, 18 Apr 2019 14:26:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:34116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391211AbfDRSE4 (ORCPT ); Thu, 18 Apr 2019 14:04:56 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C0EEB206B6; Thu, 18 Apr 2019 18:04:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555610696; bh=9kyegzZ/xJK+AyviEj4LuYf/JcELxuLlVx3y6daBQLg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sAj/iBQnB5+Y4J6ihDKXH024DlB7ZFFh9uPYhuBB7mV8cP3zVZoAPQcRR+c+FUqTi 2f9djWgMSBMhZj1n77WPtfZ5ml/IERhZ31NRYiaUv0+6QcAe8jGxihHcWCnCtx1Q3l 1WwzPJuTUO3qvnBJXVPVo/3oHRE4yxtfdFDsetHM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Ronald=20Tschal=C3=83=C2=A4r?= , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 4.14 50/92] ACPI / SBS: Fix GPE storm on recent MacBookPros Date: Thu, 18 Apr 2019 19:57:08 +0200 Message-Id: <20190418160434.458535362@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160430.325165109@linuxfoundation.org> References: <20190418160430.325165109@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit ca1721c5bee77105829cbd7baab8ee0eab85b06d ] On Apple machines, plugging-in or unplugging the power triggers a GPE for the EC. Since these machines expose an SBS device, this GPE ends up triggering the acpi_sbs_callback(). This in turn tries to get the status of the SBS charger. However, on MBP13,* and MBP14,* machines, performing the smbus-read operation to get the charger's status triggers the EC's GPE again. The result is an endless re-triggering and handling of that GPE, consuming significant CPU resources (> 50% in irq). In the end this is quite similar to commit 3031cddea633 (ACPI / SBS: Don't assume the existence of an SBS charger), except that on the above machines a status of all 1's is returned. And like there, we just want ignore the charger here. Link: https://bugzilla.kernel.org/show_bug.cgi?id=198169 Signed-off-by: Ronald Tschalär Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/sbs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index a2428e9462dd..3c092f07d7e3 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c @@ -441,9 +441,13 @@ static int acpi_ac_get_present(struct acpi_sbs *sbs) /* * The spec requires that bit 4 always be 1. If it's not set, assume - * that the implementation doesn't support an SBS charger + * that the implementation doesn't support an SBS charger. + * + * And on some MacBooks a status of 0xffff is always returned, no + * matter whether the charger is plugged in or not, which is also + * wrong, so ignore the SBS charger for those too. */ - if (!((status >> 4) & 0x1)) + if (!((status >> 4) & 0x1) || status == 0xffff) return -ENODEV; sbs->charger_present = (status >> 15) & 0x1; -- 2.19.1