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: 21977 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6B53D202AE for ; Tue, 3 Dec 2013 16:38:05 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id e14sf47100758iej.4 for ; Tue, 03 Dec 2013 08:38:05 -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=/v/tMhSFUGJblcU2AdZbF3+97Vu/JmWv8SgEmqatDcE=; b=jMmTSJfaQxgMGy0pvzzPQW0h9JjOJX3IBusqtBVr/nEpsAeowXYkkmhp0JRgE8GPhc 2veJv+yDvOgzEjbNrtmxHlFm8uHuSDHBJ4YHfjhd/b/QPBJZfS0svuYVUp0Xe8xL6oBA vUq+Ki7hz+GDm9wq4YV0Dh7t0EBnKsnRx4kYb2S/B2/dIlbWPdnbvmFh0nOd+X6ptq09 t+nRs3FkLBbJO1mG5dBm9fKsOVcssoJdXjc+TYLe57N53aSO1ZGD+AYcOARyO8mz2q03 zHJtSv6umd2H/DSaQBIuuvGnUdpP+gz0zL3gxwUz1tRNt3yen85PNlqM0atyLZ2pDAdq 7adw== X-Gm-Message-State: ALoCoQlHzaoAiD3Bf/9P7L4xwSST6kpTBzw3t5uKONhatJ1krETKhsXOY45JnExkH5BI89dQT+RI X-Received: by 10.182.24.134 with SMTP id u6mr5630101obf.24.1386088684915; Tue, 03 Dec 2013 08:38:04 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.17.65 with SMTP id m1ls1979559qed.91.gmail; Tue, 03 Dec 2013 08:38:04 -0800 (PST) X-Received: by 10.220.101.199 with SMTP id d7mr1994895vco.42.1386088684676; Tue, 03 Dec 2013 08:38:04 -0800 (PST) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id op1si31582373vcb.42.2013.12.03.08.38.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 08:38:04 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.173 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.173; Received: by mail-ve0-f173.google.com with SMTP id oz11so10732533veb.32 for ; Tue, 03 Dec 2013 08:38:04 -0800 (PST) X-Received: by 10.52.116.74 with SMTP id ju10mr47281131vdb.20.1386088684466; Tue, 03 Dec 2013 08:38:04 -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 u4csp222405vcz; Tue, 3 Dec 2013 08:38:04 -0800 (PST) X-Received: by 10.66.161.1 with SMTP id xo1mr11704629pab.146.1386088683554; Tue, 03 Dec 2013 08:38:03 -0800 (PST) Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by mx.google.com with ESMTPS id qu5si14366649pbc.150.2013.12.03.08.38.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 08:38:03 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.178 is neither permitted nor denied by best guess record for domain of hanjun.guo@linaro.org) client-ip=209.85.192.178; Received: by mail-pd0-f178.google.com with SMTP id y10so20391020pdj.37 for ; Tue, 03 Dec 2013 08:38:02 -0800 (PST) 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 Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Grant Likely , Matthew Garrett , Olof Johansson , Linus Walleij , Bjorn Helgaas , Rob Herring , Mark Rutland , Jon Masters , patches@linaro.org, linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, linaro-acpi@lists.linaro.org, Hanjun Guo , Graeme Gregory 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: hanjun.guo@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 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: , _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))