Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2354227imm; Wed, 3 Oct 2018 02:31:03 -0700 (PDT) X-Google-Smtp-Source: ACcGV62UviPpUUtwIJgBTugxeDGbd6zLRyIuWuWaT8SZ9xiHE06dLG9v7N4jgAaAZ6EwJyqBkyf8 X-Received: by 2002:a63:480e:: with SMTP id v14-v6mr582564pga.308.1538559063139; Wed, 03 Oct 2018 02:31:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538559063; cv=none; d=google.com; s=arc-20160816; b=ojiUxPy9VJnt09LObSUpvHD/xiBIQMHmsYl2BQCmXFB4RUnkzLuidYeAO7Sck2YBKA Cd6grVIqIoOHqKzzlzMUJUvW6H9kQX+KapDZtgWLxv55lMFTxZg8KEGVRQ1sK+1ymGWS J2pxYKKidd/baj8xGtAUfOsjMauSSMDMZnEFjBOaY9BiVj+UkKYNJysI+G7FBXjbK526 B4wdC8I+o4tDVVBsNNbqnW4po0dtrtud9pbqAT3ze7+HJegXnDd1rM1RZ+NhwMbx7+WO iJcAQIaHfBuYoZyMy1TNg1ZHvwDONrgav8cDrMvR23B1VNviabrCb8yYsbMi+VjEKZNl X01g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=lZt1wI0bIXeNV9/GxLuOW1TsIjOQWf8dWMWAqpA9GxU=; b=qMIAhoVZd4Eo87DiKzNn7VZYD51nCR+p+ToWPEF/jYJlJkQQy2F/9XcgztXQaWTbiw AUVDEoUWqgjD+OelBqEoZ1w3bEQjm4SfePsgKyIaV0D/zGEc25F2RwFi30LsrLyRo4lP SuyZjN86P9YV32JJNqeD930XUCTPj7TfkmpUCyQvraZepik1lYaOkK5LWKbTjcfctlKg jk8gsrkHJ1HhY6BQ4QaCHolkKjZP9TQAKDvB/yrME6M9v/cfVr4+BexB9aMVGRFL/fBi yOrWnme4LzgAYT9KhDpxP3qZzvApSaSsg30zFRVKtwY6HLDFD46jp2mH0HpG2JEXcvJw 8cpQ== ARC-Authentication-Results: i=1; mx.google.com; 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 d4-v6si930033pgj.341.2018.10.03.02.30.48; Wed, 03 Oct 2018 02:31:03 -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; 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 S1727729AbeJCQQu convert rfc822-to-8bit (ORCPT + 99 others); Wed, 3 Oct 2018 12:16:50 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:48704 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726724AbeJCQQu (ORCPT ); Wed, 3 Oct 2018 12:16:50 -0400 Received: from 79.184.253.194.ipv4.supernova.orange.pl (79.184.253.194) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.148) id 24c3cb921fe4d6f1; Wed, 3 Oct 2018 11:29:13 +0200 From: "Rafael J. Wysocki" To: Ronald =?ISO-8859-1?Q?Tschal=E4r?= Cc: Len Brown , Zhang Rui , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ACPI/sbs: Fix GPE storm on recent MacBookPro's. Date: Wed, 03 Oct 2018 11:26:13 +0200 Message-ID: <3586570.iHchT2WdI2@aspire.rjw.lan> In-Reply-To: <20181001025251.GA9069@innovation.ch> References: <20181001025251.GA9069@innovation.ch> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, October 1, 2018 4:52:51 AM CEST Ronald Tschal?r wrote: > 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 > CC: Zhang Rui > Signed-off-by: Ronald Tschal?r > --- > 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 295b59271189..96c5e27967f4 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; > Applied, thanks!