From patchwork Fri Sep 17 07:21:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 187222 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8H7OAke019391 for ; Fri, 17 Sep 2010 07:24:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750846Ab0IQHYJ (ORCPT ); Fri, 17 Sep 2010 03:24:09 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]:49194 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750788Ab0IQHYI (ORCPT ); Fri, 17 Sep 2010 03:24:08 -0400 Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o8H7Nd69008864 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 17 Sep 2010 07:23:40 GMT Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o8H5Kk00031835; Fri, 17 Sep 2010 07:23:38 GMT Received: from abhmt001.oracle.com by acsmt354.oracle.com with ESMTP id 605926591284708120; Fri, 17 Sep 2010 00:22:00 -0700 Received: from [192.168.101.11] (/75.36.243.150) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 17 Sep 2010 00:22:00 -0700 Message-ID: <4C931714.2080905@kernel.org> Date: Fri, 17 Sep 2010 00:21:56 -0700 From: Yinghai Lu User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100714 SUSE/3.0.6 Thunderbird/3.0.6 MIME-Version: 1.0 To: Bjorn Helgaas CC: Andrew Morton , "Brown, Len" , Suresh Siddha , ACPI Devel Maling List , "linux-kernel@vger.kernel.org" , Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Lin Ming , Bob Moore Subject: Re: [PATCH] acpi: handle ACPI0007 Device in acpi_early_set_pdc References: <4C89906B.1050406@kernel.org> <20100910164556.b72d848e.akpm@linux-foundation.org> <4C8AE422.4070602@kernel.org> <201009131128.42519.bjorn.helgaas@hp.com> In-Reply-To: <201009131128.42519.bjorn.helgaas@hp.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 17 Sep 2010 07:24:11 +0000 (UTC) Index: linux-2.6/drivers/acpi/processor_core.c =================================================================== --- linux-2.6.orig/drivers/acpi/processor_core.c +++ linux-2.6/drivers/acpi/processor_core.c @@ -189,7 +189,7 @@ int acpi_get_cpuid(acpi_handle handle, i EXPORT_SYMBOL_GPL(acpi_get_cpuid); #endif -static bool processor_physically_present(acpi_handle handle) +static bool is_processor_and_physically_present(acpi_handle handle) { int cpuid, type; u32 acpi_id; @@ -211,6 +211,8 @@ static bool processor_physically_present acpi_id = object.processor.proc_id; break; case ACPI_TYPE_DEVICE: + if (acpi_match_device_hid(handle, "ACPI0007") != AE_OK) + return false; status = acpi_evaluate_integer(handle, "_UID", NULL, &tmp); if (ACPI_FAILURE(status)) return false; @@ -334,7 +336,7 @@ EXPORT_SYMBOL_GPL(acpi_processor_set_pdc static acpi_status early_init_pdc(acpi_handle handle, u32 lvl, void *context, void **rv) { - if (processor_physically_present(handle) == false) + if (is_processor_and_physically_present(handle) == false) return AE_OK; acpi_processor_set_pdc(handle); @@ -349,7 +351,7 @@ void __init acpi_early_processor_set_pdc */ dmi_check_system(processor_idle_dmi_table); - acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, + acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, early_init_pdc, NULL, NULL, NULL); } Index: linux-2.6/drivers/acpi/acpica/nsxfeval.c =================================================================== --- linux-2.6.orig/drivers/acpi/acpica/nsxfeval.c +++ linux-2.6/drivers/acpi/acpica/nsxfeval.c @@ -642,6 +642,47 @@ acpi_ns_get_device_callback(acpi_handle return (status); } +static acpi_status +acpi_match_device_hid_callback(acpi_handle obj_handle, + u32 nesting_level, + void *context, void **return_value) +{ + *return_value = (void *)0xff; + + return AE_OK; +} + +/******************************************************************************* + * + * FUNCTION: acpi_match_device_hid + * + * PARAMETERS: handle and HID to be compared + * + * RETURN: AE_OK mean found match one + * + * DESCRIPTION: check if device coresponding to handle has HID + * + ******************************************************************************/ +acpi_status acpi_match_device_hid(acpi_handle obj_handle, const char *HID) +{ + struct acpi_get_devices_info info; + void *return_value = NULL; + + ACPI_FUNCTION_TRACE(acpi_match_device_hid); + + info.hid = HID; + info.context = NULL; + info.user_function = acpi_match_device_hid_callback; + + acpi_ns_get_device_callback(obj_handle, ACPI_UINT32_MAX, + &info, &return_value); + + if (!return_value) + return AE_NOT_FOUND; + + return AE_OK; +} + /******************************************************************************* * * FUNCTION: acpi_get_devices Index: linux-2.6/include/acpi/acpixf.h =================================================================== --- linux-2.6.orig/include/acpi/acpixf.h +++ linux-2.6/include/acpi/acpixf.h @@ -160,6 +160,8 @@ acpi_walk_namespace(acpi_object_type typ acpi_walk_callback post_order_visit, void *context, void **return_value); +acpi_status acpi_match_device_hid(acpi_handle obj_handle, const char *HID); + acpi_status acpi_get_devices(const char *HID, acpi_walk_callback user_function,