Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1354359ybi; Fri, 2 Aug 2019 14:02:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzTnsoawEfmpdfzTmXY/3jWimY31/a2SsAZjXbIC9R3vEEh4ghx6dTHhHVUtEQ8YjVecffe X-Received: by 2002:a63:4b02:: with SMTP id y2mr123953289pga.135.1564779742969; Fri, 02 Aug 2019 14:02:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564779742; cv=none; d=google.com; s=arc-20160816; b=IQPUAy/PUTcIRhx9lVaLgAAPaF8iQgyw+Jdfl+vgZVmOIPpR4qKaV3DsJKBZN1rl2i mm+xhLKA196ksjOj6MydPxbE3IEYiBftj9mZ6zpKuoGeEllGbkOuj8TkZNB6gpqw+dtS i6ICeQ52jD6AqzM6VbCgeGuovpOXlvZPAwkOcTa/CtENe0R0rTf512CWXDBXsSNVKvHV vS8eLjLBPIXe0jOUZolXysGvIAAfc2/JyPSXir2WDeeToGeZipTDqGFlCAnINsRmvMsK EScLAHPABk5xjlYoEggRHoMyUytRLY2C+ZdwamYlVYwsmxM1E7MP41FhLpSnj1Ig2uo5 J3aQ== 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=UBfeeHwXZ1MZvOrNLhKo3ch3kJ0OwK40FUTVDPC7Tgs=; b=Ayyq/CFBsVbl0G4QajpPLXAhgCyMxZRg2CNvvsrMMyQb6xrBQXDPR0kHfwtJe9t/ay ndGS6VAWmTWlhEguWEVxVdH+uNbHG4yZkLg1Ei16IYIcmIkp9il+jOiuA0sTju2e9kxm mbRLvWraEAVSZZm2r/xxg04ljN85d2uA+UAga3+UvWWODP6TTaTgRU0/QgSi850iiqoe CkLgHdwjDFjMgHOMafA7qSCIPD80blM7aWcF2qVdb1EnmzMpoNFuxcdvnhKW1+hUFREy CVxjZVtx+tdpPoYklRYWdYipBFNJv6xsIMBnWLp+KtaasdRCLdhCOyT8xa0Yw4BgVR+5 t7OQ== 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 n123si21842862pgn.151.2019.08.02.14.02.07; Fri, 02 Aug 2019 14:02:22 -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 S2391230AbfHBKqY (ORCPT + 99 others); Fri, 2 Aug 2019 06:46:24 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:59740 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730841AbfHBKpv (ORCPT ); Fri, 2 Aug 2019 06:45:51 -0400 Received: from 79.184.255.110.ipv4.supernova.orange.pl (79.184.255.110) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.275) id 08687bff39390d68; Fri, 2 Aug 2019 12:45:49 +0200 From: "Rafael J. Wysocki" To: Linux ACPI Cc: Linux PM , LKML , Zhang Rui , Rajneesh Bhardwaj , Andy Shevchenko , Mario Limonciello , Kai-Heng Feng Subject: [PATCH v3 4/8] ACPI: PM: s2idle: Switch EC over to polling during "noirq" suspend Date: Fri, 02 Aug 2019 12:40:43 +0200 Message-ID: <2250753.m3tS5N7MJZ@kreacher> In-Reply-To: <5997740.FPbUVk04hV@kreacher> References: <5997740.FPbUVk04hV@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Since the ACPI SCI is set up for system wakeup before the "noirq" suspend of devices, it is better to make suspend-to-idle follow suspend-to-RAM (S3) and switch over the EC to polling during "noirq" suspend (and back to interrupt-based flow during "noirq" resume). The frequency of spurious wakeup interrupts from the EC may be reduced this way. Signed-off-by: Rafael J. Wysocki --- In v2 this was patch 5. --- drivers/acpi/ec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) Index: linux-pm/drivers/acpi/ec.c =================================================================== --- linux-pm.orig/drivers/acpi/ec.c +++ linux-pm/drivers/acpi/ec.c @@ -1958,8 +1958,7 @@ static int acpi_ec_suspend_noirq(struct ec->reference_count >= 1) acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_DISABLE); - if (acpi_sleep_no_ec_events()) - acpi_ec_enter_noirq(ec); + acpi_ec_enter_noirq(ec); return 0; } @@ -1968,8 +1967,7 @@ static int acpi_ec_resume_noirq(struct d { struct acpi_ec *ec = acpi_driver_data(to_acpi_device(dev)); - if (acpi_sleep_no_ec_events()) - acpi_ec_leave_noirq(ec); + acpi_ec_leave_noirq(ec); if (ec_no_wakeup && test_bit(EC_FLAGS_STARTED, &ec->flags) && ec->reference_count >= 1)