From patchwork Fri Nov 22 00:41:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 21672 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f70.google.com (mail-pb0-f70.google.com [209.85.160.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9B57C23FDF for ; Fri, 22 Nov 2013 00:42:15 +0000 (UTC) Received: by mail-pb0-f70.google.com with SMTP id rq2sf1077260pbb.9 for ; Thu, 21 Nov 2013 16:42:14 -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=DAaNwF2JhpkKsHhySB8oT4sPj1t0sA7DMByMtI14t7k=; b=OXhzv6Ad+ZznyOqb/RI1M+nIBGHaiswj0GmWZ0EfiAWao9y8S+eLX6miIzTHmanq6Q jxrxUooSgOVK6uqGGvy8J7wpWY5aH+CDEe5rMUew7gGW/LyrOU/wCif6QndoSaUOdajw 52hweVxT/+jV9o/iRWwpYP1mhsn7yCmFX/ps3Rp49pxjaND56Ph3+4MgQQShGjzSNksa LGdDroZwF0mqWs6HyNjAWnEbOwhhJhDc815Y5O5atPl/KYik3km3GcHb1GyLgRG9yJtP oEtkKo3X4nRuWA7/Ep5BIJVnssPrgkeevncPw+ZH4YIDd3VCD/Noroxrt1o6VSvVc/um //dw== X-Gm-Message-State: ALoCoQkBbO4ghm7BC6v4b4E9BQ2rCCeiNjXpXmpATCHYHt3vLiz9hZyIoQfNW8wPo0CKEOFUz0iV X-Received: by 10.66.161.195 with SMTP id xu3mr3243468pab.33.1385080934682; Thu, 21 Nov 2013 16:42:14 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.4.105 with SMTP id j9ls783564qej.94.gmail; Thu, 21 Nov 2013 16:42:14 -0800 (PST) X-Received: by 10.52.98.194 with SMTP id ek2mr7030739vdb.11.1385080934542; Thu, 21 Nov 2013 16:42:14 -0800 (PST) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id il5si11616146vdb.36.2013.11.21.16.42.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Nov 2013 16:42:14 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id if17so365221vcb.39 for ; Thu, 21 Nov 2013 16:42:14 -0800 (PST) X-Received: by 10.58.233.98 with SMTP id tv2mr8504047vec.11.1385080934057; Thu, 21 Nov 2013 16:42:14 -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 u4csp2867vcz; Thu, 21 Nov 2013 16:42:13 -0800 (PST) X-Received: by 10.66.136.176 with SMTP id qb16mr9283919pab.131.1385080932803; Thu, 21 Nov 2013 16:42:12 -0800 (PST) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by mx.google.com with ESMTPS id rz1si6710743pab.275.2013.11.21.16.42.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Nov 2013 16:42:12 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.50 is neither permitted nor denied by best guess record for domain of al.stone@linaro.org) client-ip=209.85.220.50; Received: by mail-pa0-f50.google.com with SMTP id kl14so541279pab.9 for ; Thu, 21 Nov 2013 16:42:12 -0800 (PST) X-Received: by 10.66.102.100 with SMTP id fn4mr9360730pab.71.1385080932037; Thu, 21 Nov 2013 16:42:12 -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 pl1sm48881461pbb.20.2013.11.21.16.42.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Nov 2013 16:42:11 -0800 (PST) From: al.stone@linaro.org To: linux-acpi@vger.kernel.org Cc: linaro-acpi@lists.linaro.org, patches@linaro.org, linaro-kernel@lists.linaro.org, Al Stone Subject: [PATCH v2 3/6] ACPI: HW reduced mode does not allow use of the FADT sci_interrupt field Date: Thu, 21 Nov 2013 17:41:52 -0700 Message-Id: <1385080915-23430-4-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1385080915-23430-1-git-send-email-al.stone@linaro.org> References: <1385080915-23430-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.220.180 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, remove that usage 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 | 3 ++- drivers/acpi/osl.c | 16 ++++------------ drivers/acpi/pci_link.c | 2 ++ 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index bba9b72..de3a259 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -541,7 +541,8 @@ void __init acpi_early_init(void) goto error0; } -#ifdef CONFIG_X86 +#ifndef CONFIG_ACPI_REDUCED_HARDWARE + /* NOTE: in HW reduced mode, FADT sci_interrupt has no meaning */ if (!acpi_ioapic) { /* compatible (0) means level (3) */ if (!(acpi_sci_flags & ACPI_MADT_TRIGGER_MASK)) { diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 54a20ff..34cd2c5 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; @@ -795,13 +796,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 +812,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 +1798,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 064cd5b..9ae105b 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; }