summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpi_memhotplug.c
diff options
context:
space:
mode:
authorZhao Yakui <yakui.zhao@intel.com>2009-07-07 02:56:11 (GMT)
committerLen Brown <len.brown@intel.com>2009-08-02 16:25:12 (GMT)
commit5d2619fca753d270e63e76c9e18437b0d9bc8d75 (patch)
tree61ba09656dd63c66659c8994f19767e262afb93f /drivers/acpi/acpi_memhotplug.c
parentaa7b2b2e973874df99a45b31adbed5978b46be1f (diff)
downloadlinux-fsl-qoriq-5d2619fca753d270e63e76c9e18437b0d9bc8d75.tar.xz
ACPI: Ingore the memory block with zero block size in course of memory hotplug
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 <yakui.zhao@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/acpi_memhotplug.c')
-rw-r--r--drivers/acpi/acpi_memhotplug.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 37cbe72..9a62224 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -242,7 +242,12 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
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 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
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)