From patchwork Tue Dec 3 16:36:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 3277541 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C76689F380 for ; Tue, 3 Dec 2013 16:40:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 29EF32037D for ; Tue, 3 Dec 2013 16:40:02 +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 D3E7D2038E for ; Tue, 3 Dec 2013 16:40:00 +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 1Vnszn-0004wZ-2N; Tue, 03 Dec 2013 16:38:47 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VnszS-0000rp-Ow; Tue, 03 Dec 2013 16:38:26 +0000 Received: from mail-pb0-f45.google.com ([209.85.160.45]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VnszQ-0000or-CM for linux-arm-kernel@lists.infradead.org; Tue, 03 Dec 2013 16:38:24 +0000 Received: by mail-pb0-f45.google.com with SMTP id rp16so21414456pbb.32 for ; Tue, 03 Dec 2013 08:38:02 -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=/v/tMhSFUGJblcU2AdZbF3+97Vu/JmWv8SgEmqatDcE=; b=jlfzd/Vne71EmrZ9ZUEdxNGoNeGTEUI3e2jtScappuKDmF9GaxFXliBVL2sONzgdyd WDiobBNULCR3VNgKCaW0STtQA3ZuEKcG3u97eQvBXn7d6cq9vuQorlXU7o9C4OCVGs9M 7agdjXLNPCknTlcBTwHz8B7RmEhoO3Nj2f+Yu2al+AjKShWowOZEmaWbiPY95fHfH7p1 XUB3hGdbxtdILrWg+HU2OfeP4tLWw7l22EQVUAzhUWVtxk1+DEacWOvE/CosxW/035IR L+JxjaJASNzyh1dgvGRP8a03ph1OeUwzO3p4Uaf2i3YbzDnwKTaYReDmGnVJofY1rZEa nr5Q== X-Gm-Message-State: ALoCoQk+jw9WzDnShzyg7OSGhqsJMOkUMj5nNkBdFforQllhXoqe2iQ7rSP/K2KjAVaYRHipMiIF X-Received: by 10.67.3.3 with SMTP id bs3mr75943689pad.46.1386088682732; Tue, 03 Dec 2013 08:38:02 -0800 (PST) Received: from localhost ([219.142.3.202]) by mx.google.com with ESMTPSA id hz10sm131152281pbc.36.2013.12.03.08.37.54 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 03 Dec 2013 08:38:02 -0800 (PST) From: Hanjun Guo To: "Rafael J. Wysocki" , Catalin Marinas , Will Deacon , Russell King - ARM Linux , Daniel Lezcano Subject: [RFC part1 PATCH 3/7] ACPI / processor_core: Rework _PDC related stuff to make it more arch-independent Date: Wed, 4 Dec 2013 00:36:47 +0800 Message-Id: <1386088611-2801-4-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1386088611-2801-1-git-send-email-hanjun.guo@linaro.org> References: <1386088611-2801-1-git-send-email-hanjun.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131203_113824_524899_39077CB2 X-CRM114-Status: GOOD ( 15.17 ) X-Spam-Score: -2.6 (--) Cc: Mark Rutland , Matthew Garrett , linaro-kernel@lists.linaro.org, Graeme Gregory , patches@linaro.org, Linus Walleij , Olof Johansson , linux-kernel@vger.kernel.org, Rob Herring , linaro-acpi@lists.linaro.org, linux-acpi@vger.kernel.org, Jon Masters , Grant Likely , Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, Hanjun Guo 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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 _PDC related stuff in processor_core.c is little bit X86/IA64 dependent, rework the code to make it more arch-independent. The return value of acpi_processor_eval_pdc() should be 'acpi_status' but defined as 'int', fix it too. Signed-off-by: Hanjun Guo Signed-off-by: Graeme Gregory --- drivers/acpi/processor_core.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 34e7b3c..9931435 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c @@ -273,8 +273,19 @@ static void acpi_set_pdc_bits(u32 *buf) buf[0] = ACPI_PDC_REVISION_ID; buf[1] = 1; +#if defined(CONFIG_X86) || defined(CONFIG_IA64) /* Enable coordination with firmware's _TSD info */ buf[2] = ACPI_PDC_SMP_T_SWCOORD; + if (boot_option_idle_override == IDLE_NOMWAIT) { + /* + * If mwait is disabled for CPU C-states, the C2C3_FFH access + * mode will be disabled in the parameter of _PDC object. + * Of course C1_FFH access mode will also be disabled. + */ + buf[2] &= ~(ACPI_PDC_C_C2C3_FFH | ACPI_PDC_C_C1_FFH); + + } +#endif /* Twiddle arch-specific bits needed for _PDC */ arch_acpi_set_pdc_bits(buf); @@ -323,25 +334,11 @@ static struct acpi_object_list *acpi_processor_alloc_pdc(void) * _PDC is required for a BIOS-OS handshake for most of the newer * ACPI processor features. */ -static int +static acpi_status acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in) { acpi_status status = AE_OK; - if (boot_option_idle_override == IDLE_NOMWAIT) { - /* - * If mwait is disabled for CPU C-states, the C2C3_FFH access - * mode will be disabled in the parameter of _PDC object. - * Of course C1_FFH access mode will also be disabled. - */ - union acpi_object *obj; - u32 *buffer = NULL; - - obj = pdc_in->pointer; - buffer = (u32 *)(obj->buffer.pointer); - buffer[2] &= ~(ACPI_PDC_C_C2C3_FFH | ACPI_PDC_C_C1_FFH); - - } status = acpi_evaluate_object(handle, "_PDC", pdc_in, NULL); if (ACPI_FAILURE(status))