From patchwork Wed Jan 8 00:46:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: al.stone@linaro.org X-Patchwork-Id: 3450941 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F3C4DC02DC for ; Wed, 8 Jan 2014 00:48:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 18AAD20122 for ; Wed, 8 Jan 2014 00:48:20 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 11F1220121 for ; Wed, 8 Jan 2014 00:48:19 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W0hJH-0001l7-Lq; Wed, 08 Jan 2014 00:47:51 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W0hJC-00005W-Oj; Wed, 08 Jan 2014 00:47:46 +0000 Received: from mail-ie0-f177.google.com ([209.85.223.177]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W0hIy-0008U4-3d for linux-arm-kernel@lists.infradead.org; Wed, 08 Jan 2014 00:47:33 +0000 Received: by mail-ie0-f177.google.com with SMTP id tp5so1246346ieb.8 for ; Tue, 07 Jan 2014 16:47:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7llLwBPy5IoupXfe84al1F+B1Ip6tve20gMcpYTdy0I=; b=LkTIWPny4Iuhfi1H9SY0ba2SqEFcO7HSoB5Ib0tLV5sk2hKiCUv09BtPV3g+zLje2A 2eHKJF2N5gVlkari+6BX9qeml91uSc6kZ6B1ozx05b3UB6iznogfivN0nOvP0VGfx6tZ 4C8orx+jrl72ZB9kQ8mPw/BP3VHuPcOVf3tqcb7HyPk11NY/N8cBoS+heRtNUexxTmsZ Nzwie+EpLTgiMgItTlG0RJmOSihrVt9WWtbHVB3I/5w8jUOFDfCgC3wjWHVh7qjyUs/A v9/m/OMumoyULY3+qOkQp91MzcnroM5QL5arx2ptuJz68PIV5n8BQxdFsD3HhHkGqhCS sKGQ== X-Gm-Message-State: ALoCoQmdMl4AUr9skYijeyOLmlcGLN0vHktK3MvrxSCVId8XNox4sAc6rht52D0rYmsOrGJmmr5Y X-Received: by 10.42.62.196 with SMTP id z4mr24423790ich.49.1389142026672; Tue, 07 Jan 2014 16:47:06 -0800 (PST) Received: from fidelio.ahs3.com (74-93-232-46-Colorado.hfc.comcastbusiness.net. [74.93.232.46]) by mx.google.com with ESMTPSA id kt2sm6361770igb.1.2014.01.07.16.47.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jan 2014 16:47:05 -0800 (PST) From: al.stone@linaro.org To: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 3/5] ACPI: HW reduced mode does not allow use of the FADT sci_interrupt field Date: Tue, 7 Jan 2014 17:46:49 -0700 Message-Id: <1389142011-27356-4-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1389142011-27356-1-git-send-email-al.stone@linaro.org> References: <1389142011-27356-1-git-send-email-al.stone@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140107_194732_195064_1C0E3DCD X-CRM114-Status: GOOD ( 15.94 ) X-Spam-Score: -0.1 (/) Cc: patches@linaro.org, Al Stone , linaro-kernel@lists.linaro.org, linaro-acpi@lists.linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, SUSPICIOUS_RECIPS, UNPARSEABLE_RELAY autolearn=no 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 From: Al Stone In HW reduced mode, the use of the SCI interrupt is not allowed. In all those places that use the FADT sci_interrupt field, make sure we do not execute that path when in HW reduced mode. In the case of acpi_os_install_interrupt_handler() in osl.c, this allows us to open up the routine to installing interrupt handlers other than acpi_gbl_FADT.sci_interrupt regardless of whether we are in ACPI legacy mode or reduced HW mode; acpi_os_remove_interrupt_handler() changes to maintain symmetry. Signed-off-by: Al Stone --- drivers/acpi/bus.c | 30 ++++++++++++++++-------------- drivers/acpi/osl.c | 18 +++++++----------- drivers/acpi/pci_link.c | 2 ++ 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 0710004..d871859 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -552,21 +552,23 @@ void __init acpi_early_init(void) } #ifdef CONFIG_X86 - if (!acpi_ioapic) { - /* compatible (0) means level (3) */ - if (!(acpi_sci_flags & ACPI_MADT_TRIGGER_MASK)) { - acpi_sci_flags &= ~ACPI_MADT_TRIGGER_MASK; - acpi_sci_flags |= ACPI_MADT_TRIGGER_LEVEL; + if (!acpi_gbl_reduced_hardware) { + if (!acpi_ioapic) { + /* compatible (0) means level (3) */ + if (!(acpi_sci_flags & ACPI_MADT_TRIGGER_MASK)) { + acpi_sci_flags &= ~ACPI_MADT_TRIGGER_MASK; + acpi_sci_flags |= ACPI_MADT_TRIGGER_LEVEL; + } + /* Set PIC-mode SCI trigger type */ + acpi_pic_sci_set_trigger(acpi_gbl_FADT.sci_interrupt, + (acpi_sci_flags & ACPI_MADT_TRIGGER_MASK) >> 2); + } else { + /* + * now that acpi_gbl_FADT is initialized, + * update it with result from INT_SRC_OVR parsing + */ + acpi_gbl_FADT.sci_interrupt = acpi_sci_override_gsi; } - /* Set PIC-mode SCI trigger type */ - acpi_pic_sci_set_trigger(acpi_gbl_FADT.sci_interrupt, - (acpi_sci_flags & ACPI_MADT_TRIGGER_MASK) >> 2); - } else { - /* - * now that acpi_gbl_FADT is initialized, - * update it with result from INT_SRC_OVR parsing - */ - acpi_gbl_FADT.sci_interrupt = acpi_sci_override_gsi; } #endif diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 44c07eb..c946a3a 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -84,6 +84,7 @@ static int (*__acpi_os_prepare_extended_sleep)(u8 sleep_state, u32 val_a, static acpi_osd_handler acpi_irq_handler; static void *acpi_irq_context; +static u32 acpi_irq_number; static struct workqueue_struct *kacpid_wq; static struct workqueue_struct *kacpi_notify_wq; static struct workqueue_struct *kacpi_hotplug_wq; @@ -178,6 +179,10 @@ static void __init acpi_request_region (struct acpi_generic_address *gas, static int __init acpi_reserve_resources(void) { + /* Handle hardware reduced mode: i.e., do nothing. */ + if (acpi_gbl_reduced_hardware) + return 0; + acpi_request_region(&acpi_gbl_FADT.xpm1a_event_block, acpi_gbl_FADT.pm1_event_length, "ACPI PM1a_EVT_BLK"); @@ -795,13 +800,6 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler, acpi_irq_stats_init(); - /* - * ACPI interrupts different from the SCI in our copy of the FADT are - * not supported. - */ - if (gsi != acpi_gbl_FADT.sci_interrupt) - return AE_BAD_PARAMETER; - if (acpi_irq_handler) return AE_ALREADY_ACQUIRED; @@ -818,15 +816,13 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler, acpi_irq_handler = NULL; return AE_NOT_ACQUIRED; } + acpi_irq_number = irq; return AE_OK; } acpi_status acpi_os_remove_interrupt_handler(u32 irq, acpi_osd_handler handler) { - if (irq != acpi_gbl_FADT.sci_interrupt) - return AE_BAD_PARAMETER; - free_irq(irq, acpi_irq); acpi_irq_handler = NULL; @@ -1806,7 +1802,7 @@ acpi_status __init acpi_os_initialize1(void) acpi_status acpi_os_terminate(void) { if (acpi_irq_handler) { - acpi_os_remove_interrupt_handler(acpi_gbl_FADT.sci_interrupt, + acpi_os_remove_interrupt_handler(acpi_irq_number, acpi_irq_handler); } diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 2652a61..d5c155e 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -505,6 +505,8 @@ int __init acpi_irq_penalty_init(void) } } /* Add a penalty for the SCI */ + if (acpi_gbl_reduced_hardware) + return 0; acpi_irq_penalty[acpi_gbl_FADT.sci_interrupt] += PIRQ_PENALTY_PCI_USING; return 0; }