Skip to contentSkip to conversation

:ACPI: Ingore the memory block with zero block size in course of memory hotplug

PATCH New yakui 1 participant 1 message Jul 3, 2009 ACPI

lore
Share & tools
lore

yakui

author
#0 lore raw

PATCH 2/2 :ACPI: Ingore the memory block with zero block size in course of memory hotplug

From: Zhao Yakui <[email protected]>

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:

Quoted 1 line

System RAM resource 0 - ffffffffffffffff cannot be added

---
 drivers/acpi/acpi_memhotplug.c |   18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
drivers/acpi/acpi_memhotplug.c +15 -3
Index: linux-2.6/drivers/acpi/acpi_memhotplug.c
===================================================================
@@ -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)