Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2616645imm; Mon, 16 Jul 2018 11:00:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdMW4gCbr9gfFnhdz4hY5haoHycWpEcUd7SNt5bHqDJ+EW0JUg/EDmLrSLDBWEy2c+dMG7p X-Received: by 2002:a62:9541:: with SMTP id p62-v6mr18908453pfd.152.1531764017607; Mon, 16 Jul 2018 11:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531764017; cv=none; d=google.com; s=arc-20160816; b=CKAN9lEcvNJouUf63SJE1FMdr02lsdHOgWYrZAh1AL5a1vpgENFWRM6Jk23rM/L9L4 UXNzNgsiexcw4vGJNWptaarSQQlKygTTVIbGB6DYbfqX+OKwLPEsXHB0emD9/aEb3g6P RbxRd5OormZlmFpnSSHg7/NSj6zc0he9r153F0LBigM2q4yZoymsR3MadLfV70M22+lP yz86YBFyR7NHwxwUFiJZe6wgiRaVUIypXExuY/iU88h3DsViKEwOrA38/UqXGaG1Fe05 KCA8l18iy8EJbnmU9r31rFgFI3BmGtnKs89GoITJD33z2uNzqGHItBNSUrUvKw/01z5g OgWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=B73HMQaZzYazaBpgerkQASRRFJvZ4+DwEhvvxITV0+0=; b=uDBh1FKDunv4yG3hLLG41fYf0cur6+DFU4GpYfWxbHropSKJnrQVh196riroxB/ZpG Z+BpDCABN77l2viWWS5ArKSJrRjdQeBVgSueCznw9TkuiV/xr6ZGyotueon4GJZEwjct gE5vJbbpCs1CrUT58kh5IQWtG370locWMiFUpXBBrsdyIZdQTeW3gcfKBzdCbbjf/f11 nxZhoFl4CaKehGT+Qc1vNvThBNqmYi5jb0iQ2B1Ne/g5Xm4IZqEupn9IxUKRtaVmajS2 9r+J/ddHUTgxgg2w6T+Ev/W5qf8+P7j2f979ovMW2KVhktwYq5Nqr2jYOdBcr3rbMUgX 82dw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f11-v6si30069911plr.316.2018.07.16.11.00.02; Mon, 16 Jul 2018 11:00:17 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729360AbeGPS2A convert rfc822-to-8bit (ORCPT + 99 others); Mon, 16 Jul 2018 14:28:00 -0400 Received: from mga03.intel.com ([134.134.136.65]:26212 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727957AbeGPS2A (ORCPT ); Mon, 16 Jul 2018 14:28:00 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jul 2018 10:59:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,362,1526367600"; d="scan'208";a="57309450" Received: from orsmsx109.amr.corp.intel.com ([10.22.240.7]) by orsmga008.jf.intel.com with ESMTP; 16 Jul 2018 10:59:28 -0700 Received: from orsmsx159.amr.corp.intel.com (10.22.240.24) by ORSMSX109.amr.corp.intel.com (10.22.240.7) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 16 Jul 2018 10:59:28 -0700 Received: from orsmsx110.amr.corp.intel.com ([169.254.10.90]) by ORSMSX159.amr.corp.intel.com ([169.254.11.31]) with mapi id 14.03.0319.002; Mon, 16 Jul 2018 10:59:28 -0700 From: "Schmauss, Erik" To: "Rafael J. Wysocki" , Linux ACPI CC: =?iso-8859-1?Q?Thomas_H=E4nig?= , Takashi Iwai , Linux PM , "Linux Kernel Mailing List" Subject: RE: [PATCH] ACPICA: Clear status of all events when entering S5 Thread-Topic: [PATCH] ACPICA: Clear status of all events when entering S5 Thread-Index: AQHUFpu0XUtNzBv1akqdlUOPvTIt7aSSL9Hg Date: Mon, 16 Jul 2018 17:59:27 +0000 Message-ID: References: <1704080.gFTvVrrZA1@aspire.rjw.lan> <6f01a906-b27c-0e1a-e9f6-fa27c015faa3@cosifan.de> <2396867.eZQXUlvGZn@aspire.rjw.lan> In-Reply-To: <2396867.eZQXUlvGZn@aspire.rjw.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjFmMTc1NDgtMWU4ZS00Mzc5LTgxNGUtZTRmNjdjMjA3YmZkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVTlyMnArUG9lT0wwdWdoTGo2dDNtZWJycjJGem9LVEpScXJFb2pxQmFsZHY1R3ZSWnN3YWR5cmtYSmkwRWkzVSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.22.254.140] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Rafael J. Wysocki [mailto:rjw@rjwysocki.net] > Sent: Sunday, July 8, 2018 2:10 AM > To: Linux ACPI > Cc: Thomas H?nig ; Takashi Iwai ; > Schmauss, Erik ; Linux PM pm@vger.kernel.org>; Linux Kernel Mailing List > Subject: [PATCH] ACPICA: Clear status of all events when entering S5 > > From: Rafael J. Wysocki > > After commit 18996f2db918 (ACPICA: Events: Stop unconditionally clearing ACPI > IRQs during suspend/resume) the status of ACPI events is not cleared any more > when entering the ACPI S5 system state (power > off) which causes some systems to power up immediately after turing off power > in certain situations. > > That is a functional regression, so address it by making the code clear the status > of all ACPI events again when entering S5 (for system-wide suspend or > hibernation the clearing of the status of all events is not desirable, as it might > cause the kernel to miss wakeup events sometimes). > > Fixes: 18996f2db918 (ACPICA: Events: Stop unconditionally clearing ACPI IRQs > during suspend/resume) > Reported-by: Takashi Iwai > Tested-by: Thomas H?nig > Signed-off-by: Rafael J. Wysocki > --- > > Resend https://patchwork.kernel.org/patch/10511451/ with a changelig and > tags. > > --- > drivers/acpi/acpica/hwsleep.c | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > > Index: linux-pm/drivers/acpi/acpica/hwsleep.c > ================================================================= > == > --- linux-pm.orig/drivers/acpi/acpica/hwsleep.c > +++ linux-pm/drivers/acpi/acpica/hwsleep.c > @@ -51,16 +51,23 @@ acpi_status acpi_hw_legacy_sleep(u8 slee > return_ACPI_STATUS(status); > } > > - /* > - * 1) Disable all GPEs > - * 2) Enable all wakeup GPEs > - */ > + /* Disable all GPEs */ > status = acpi_hw_disable_all_gpes(); > if (ACPI_FAILURE(status)) { > return_ACPI_STATUS(status); > } > + /* > + * If the target sleep state is S5, clear all GPEs and fixed events too > + */ > + if (sleep_state == ACPI_STATE_S5) { > + status = acpi_hw_clear_acpi_status(); > + if (ACPI_FAILURE(status)) { > + return_ACPI_STATUS(status); > + } > + } > acpi_gbl_system_awake_and_running = FALSE; > > + /* Enable all wakeup GPEs */ > status = acpi_hw_enable_all_wakeup_gpes(); > if (ACPI_FAILURE(status)) { > return_ACPI_STATUS(status); Rafael, I've created an ACPICA pull request containing this patch. Thanks, Erik