From patchwork Tue Dec 17 00:16:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 22547 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4CB8923FC6 for ; Tue, 17 Dec 2013 00:16:56 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wm4sf19907047obc.7 for ; Mon, 16 Dec 2013 16:16:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=3e0Avc2LxF7S5OhqIbl9QT+CHgmlJbJweNcv0ao4Ax4=; b=dhQ4h1WX+vS2gvw5fzbeB2aheL7Mm+SQNXdU3ql6UfLLRF+FL9KP274p24/ShwZTPC kCYrZKemEN6YbUa0olth1hHdygnZzHK2idWxJCx4aVIuIPQj0kIvLx21Psp1eSXbCuDF TnLHHlahvSblRhta58TU/xPu79krtwVnR+chKUEfvEgpchVzC/ZegWogm+Rka83H1T5S MowdGF03NjEQK0DOAJhDkvA9epvEJaVqIVAWbQaahYsJ7YcAxDvdETVPI+W5ESMNB+mN eCfzhxKRf7qjMpY53oOM3i4F1nxgAtulxfIbjmGaAqHR4DmblTjk254RQNVsYAS+mH8t HyPg== X-Gm-Message-State: ALoCoQmmQBzouSdx3bq1kCJCh3iNRxcLyhljoqzcSzuJCCTNuDmX8gWDutTFrKIQDBX3s40tZhTg X-Received: by 10.182.241.129 with SMTP id wi1mr7110145obc.10.1387239415858; Mon, 16 Dec 2013 16:16:55 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.40.194 with SMTP id z2ls2417273qek.23.gmail; Mon, 16 Dec 2013 16:16:55 -0800 (PST) X-Received: by 10.220.74.69 with SMTP id t5mr9597210vcj.18.1387239415713; Mon, 16 Dec 2013 16:16:55 -0800 (PST) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id q19si4371187vea.139.2013.12.16.16.16.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 16:16:55 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id db12so3784139veb.8 for ; Mon, 16 Dec 2013 16:16:55 -0800 (PST) X-Received: by 10.52.168.4 with SMTP id zs4mr46055vdb.59.1387239415608; Mon, 16 Dec 2013 16:16:55 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp29240vcz; Mon, 16 Dec 2013 16:16:55 -0800 (PST) X-Received: by 10.50.78.199 with SMTP id d7mr647231igx.8.1387239414862; Mon, 16 Dec 2013 16:16:54 -0800 (PST) Received: from mail-ie0-f175.google.com (mail-ie0-f175.google.com [209.85.223.175]) by mx.google.com with ESMTPS id dj10si15018730icc.94.2013.12.16.16.16.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 16:16:54 -0800 (PST) Received-SPF: neutral (google.com: 209.85.223.175 is neither permitted nor denied by best guess record for domain of al.stone@linaro.org) client-ip=209.85.223.175; Received: by mail-ie0-f175.google.com with SMTP id x13so7509699ief.20 for ; Mon, 16 Dec 2013 16:16:54 -0800 (PST) X-Received: by 10.42.4.201 with SMTP id 9mr3602322ict.57.1387239414547; Mon, 16 Dec 2013 16:16:54 -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 j3sm12877632igj.9.2013.12.16.16.16.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Dec 2013 16:16:53 -0800 (PST) From: al.stone@linaro.org To: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: linaro-acpi@lists.linaro.org, patches@linaro.org, linaro-kernel@lists.linaro.org, Al Stone Subject: [PATCH v4 3/5] ACPI: HW reduced mode does not allow use of the FADT sci_interrupt field Date: Mon, 16 Dec 2013 17:16:39 -0700 Message-Id: <1387239401-13918-4-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1387239401-13918-1-git-send-email-al.stone@linaro.org> References: <1387239401-13918-1-git-send-email-al.stone@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: al.stone@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 bba9b72..33ff87f 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -542,21 +542,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; }