From patchwork Fri Jul 3 02:50:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhao, Yakui" X-Patchwork-Id: 33849 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 n632mF8g022375 for ; Fri, 3 Jul 2009 02:49:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750998AbZGCCte (ORCPT ); Thu, 2 Jul 2009 22:49:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751067AbZGCCte (ORCPT ); Thu, 2 Jul 2009 22:49:34 -0400 Received: from mga02.intel.com ([134.134.136.20]:31927 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750998AbZGCCtd (ORCPT ); Thu, 2 Jul 2009 22:49:33 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 02 Jul 2009 19:39:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.42,338,1243839600"; d="scan'208";a="529861798" Received: from yakui_zhao.sh.intel.com (HELO [10.239.13.62]) ([10.239.13.62]) by orsmga001.jf.intel.com with ESMTP; 02 Jul 2009 19:49:22 -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: Fri, 03 Jul 2009 10:50:28 +0800 Message-Id: <1246589428.18688.88.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-03 10:22:22.000000000 +0800 +++ linux-2.6/drivers/acpi/acpi_memhotplug.c 2009-07-03 10:36:07.000000000 +0800 @@ -242,7 +242,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); @@ -257,8 +262,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)