===================================================================
@@ -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);
}
===================================================================
@@ -524,6 +524,49 @@ ACPI_EXPORT_SYMBOL(acpi_walk_namespace)
/*******************************************************************************
*
+ * FUNCTION: acpi_match_device_hid
+ *
+ * PARAMETERS: handle and HID to be compared
+ *
+ * RETURN: bool
+ *
+ * DESCRIPTION: check if device coresponding to handle has HID
+ *
+ ******************************************************************************/
+acpi_status acpi_match_device_hid(acpi_handle obj_handle, const char *HID)
+{
+ acpi_status status;
+ struct acpi_namespace_node *node;
+ struct acpica_device_id *hid;
+ int no_match;
+
+ status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE(status))
+ return status;
+
+ node = acpi_ns_validate_handle(obj_handle);
+ status = acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE(status))
+ return status;
+
+ if (!node)
+ return AE_BAD_PARAMETER;
+
+ status = acpi_ut_execute_HID(node, &hid);
+ if (ACPI_FAILURE(status))
+ return status;
+
+ no_match = ACPI_STRCMP(hid->string, HID);
+ ACPI_FREE(hid);
+
+ if (no_match)
+ return AE_NOT_FOUND;
+
+ return AE_OK;
+}
+
+/*******************************************************************************
+ *
* FUNCTION: acpi_ns_get_device_callback
*
* PARAMETERS: Callback from acpi_get_device
===================================================================
@@ -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,