After repeated S4 cycles, a memcpy() Oops occurs in suspend_nvs_save. This error occurs because the ioremap of the NVS region fails, returning NULL and the subsequent memcpy() tries to copy to a NULL pointer, hence the oops.
We running out of mappable regions because suspend_nvs_save() is called twice during hibernation, and yet the unmapping via suspend_nvs_free() is only called once, hence we have a leak.
Looking at create_image() in kernel/power/hibernate.c, we can see that we call the __acpi_pm_prepare() via arch_prepare_suspend() and a little later we call platform_pre_snapshot() which calls acpi_hibernation_pre_snapshot() which does the duplication of the suspend_nvs_save(). We need to drop on these.
This has been fixed in upstream commit:
commit c5f7a1bb65bca03253c189e946b3ca79669f08af
Author: Rafael J. Wysocki <email address hidden>
Date: Fri Jul 2 00:14:09 2010 +0200
ACPI / Sleep: Consolidate suspend and hibernation routines
Some hibernation and suspend routines can be merged, which reduces
the complexity of code a bit.
Signed-off-by: Rafael J. Wysocki <email address hidden>
Signed-off-by: Len Brown <email address hidden>
..where the extraneous suspend_nvs_save() has been dropped from function __acpi_pm_prepare()
Ubuntu-2.6.35-25, Maverick.
After repeated S4 cycles, a memcpy() Oops occurs in suspend_nvs_save. This error occurs because the ioremap of the NVS region fails, returning NULL and the subsequent memcpy() tries to copy to a NULL pointer, hence the oops.
We running out of mappable regions because suspend_nvs_save() is called twice during hibernation, and yet the unmapping via suspend_nvs_free() is only called once, hence we have a leak.
Looking at create_image() in kernel/ power/hibernate .c, we can see that we call the __acpi_pm_prepare() via arch_prepare_ suspend( ) and a little later we call platform_ pre_snapshot( ) which calls acpi_hibernatio n_pre_snapshot( ) which does the duplication of the suspend_nvs_save(). We need to drop on these.
This has been fixed in upstream commit:
commit c5f7a1bb65bca03 253c189e946b3ca 79669f08af
Author: Rafael J. Wysocki <email address hidden>
Date: Fri Jul 2 00:14:09 2010 +0200
ACPI / Sleep: Consolidate suspend and hibernation routines
Some hibernation and suspend routines can be merged, which reduces
the complexity of code a bit.
Signed-off-by: Rafael J. Wysocki <email address hidden>
Signed-off-by: Len Brown <email address hidden>
..where the extraneous suspend_nvs_save() has been dropped from function __acpi_pm_prepare()