From patchwork Thu Oct 22 12:03:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Yu X-Patchwork-Id: 7464621 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1F5249F302 for ; Thu, 22 Oct 2015 12:01:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 49A3320937 for ; Thu, 22 Oct 2015 12:01:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5E25820943 for ; Thu, 22 Oct 2015 12:01:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757299AbbJVMBD (ORCPT ); Thu, 22 Oct 2015 08:01:03 -0400 Received: from mga09.intel.com ([134.134.136.24]:8987 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757276AbbJVMA5 (ORCPT ); Thu, 22 Oct 2015 08:00:57 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 22 Oct 2015 05:00:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,181,1444719600"; d="scan'208";a="832942865" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.239.160.87]) by fmsmga002.fm.intel.com with ESMTP; 22 Oct 2015 05:00:48 -0700 From: Chen Yu To: rjw@rjwysocki.net, lenb@kernel.org Cc: rui.zhang@intel.com, lv.zheng@intel.com, linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Chen Yu , Subject: [PATCH 3/3] ACPI / PM: Fix incorrect wakeup irq setting before suspend-to-idle Date: Thu, 22 Oct 2015 20:03:29 +0800 Message-Id: <1445515409-31349-1-git-send-email-yu.c.chen@intel.com> X-Mailer: git-send-email 1.8.4.2 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For ACPI compatible system, SCI(ACPI System Control Interrupt) is used to wake system up from suspend-to-idle. Once CPU is woken up by SCI, interrupt handler will firstly checks if current interrupt is legal to wake up the whole system, thus irq_pm_check_wakeup is invoked to validate the irq number. However, before suspend-to-idle, acpi_gbl_FADT.sci_interrupt is marked rather than actual irq number in acpi_freeze_prepare, this might lead to unable to wake up the system. This patch fixes this problem by marking the irq number return by acpi_gsi_to_irq as IRQD_WAKEUP_STATE, rather than marking the acpi_gbl_FADT.sci_interrupt. Cc: # 3.18+ Acked-by: Lv Zheng Signed-off-by: Chen Yu --- drivers/acpi/sleep.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 2f0d4db..1704595 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -632,14 +632,16 @@ static int acpi_freeze_prepare(void) acpi_enable_wakeup_devices(ACPI_STATE_S0); acpi_enable_all_wakeup_gpes(); acpi_os_wait_events_complete(); - enable_irq_wake(acpi_gbl_FADT.sci_interrupt); + if (!IS_INVALID_ACPI_IRQ(acpi_sci_irq)) + enable_irq_wake(acpi_sci_irq); return 0; } static void acpi_freeze_restore(void) { acpi_disable_wakeup_devices(ACPI_STATE_S0); - disable_irq_wake(acpi_gbl_FADT.sci_interrupt); + if (!IS_INVALID_ACPI_IRQ(acpi_sci_irq)) + disable_irq_wake(acpi_sci_irq); acpi_enable_all_runtime_gpes(); }