From patchwork Tue Jul 7 02:56:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhao, Yakui" X-Patchwork-Id: 34372 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n672tSRr025852 for ; Tue, 7 Jul 2009 02:55:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754525AbZGGCzX (ORCPT ); Mon, 6 Jul 2009 22:55:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754526AbZGGCzX (ORCPT ); Mon, 6 Jul 2009 22:55:23 -0400 Received: from mga02.intel.com ([134.134.136.20]:19758 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754525AbZGGCzW (ORCPT ); Mon, 6 Jul 2009 22:55:22 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 06 Jul 2009 19:45:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.42,360,1243839600"; d="scan'208";a="530646560" Received: from yakui_zhao.sh.intel.com (HELO [10.239.13.62]) ([10.239.13.62]) by orsmga001.jf.intel.com with ESMTP; 06 Jul 2009 19:55:09 -0700 Subject: [Patch 2/2]:ACPI: Ingore the memory block with zero block size in course of memory hotplug From: yakui To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org Date: Tue, 07 Jul 2009 10:56:11 +0800 Message-Id: <1246935371.14188.5.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1 (2.22.1-2.fc9) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Zhao Yakui If the memory block size is zero, ignore it and don't do the memory hotplug flowchart. Otherwise it will complain the following warning message: >System RAM resource 0 - ffffffffffffffff cannot be added Signed-off-by: Zhao Yakui --- drivers/acpi/acpi_memhotplug.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/drivers/acpi/acpi_memhotplug.c =================================================================== --- linux-2.6.orig/drivers/acpi/acpi_memhotplug.c 2009-07-07 10:33:43.000000000 +0800 +++ linux-2.6/drivers/acpi/acpi_memhotplug.c 2009-07-07 10:52:26.000000000 +0800 @@ -244,7 +244,12 @@ num_enabled++; continue; } - + /* + * If the memory block size is zero, please ignore it. + * Don't try to do the following memory hotplug flowchart. + */ + if (!info->length) + continue; if (node < 0) node = memory_add_physaddr_to_nid(info->start_addr); @@ -259,8 +264,15 @@ mem_device->state = MEMORY_INVALID_STATE; return -EINVAL; } - - return result; + /* + * Sometimes the memory device will contain several memory blocks. + * When one memory block is hot-added to the system memory, it will + * be regarded as a success. + * Otherwise if the last memory block can't be hot-added to the system + * memory, it will be failure and the memory device can't be bound with + * driver. + */ + return 0; } static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)