On 10/25/2013 03:52 AM, Hanjun Guo wrote:
On 2013-10-25 6:23, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
Remove the saving and restoring of bus master reload registers in suspend/resume when in reduced HW mode; according to the spec, no such registers should exist.
Signed-off-by: Al Stone al.stone@linaro.org
drivers/acpi/processor_idle.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index e45f913..3cee9a1 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -219,14 +219,29 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr, #endif
#ifdef CONFIG_PM_SLEEP +#if (!ACPI_REDUCED_HARDWARE) +/* Bus Master Reload is not supported in the reduced hardware profile */ static u32 saved_bm_rld; +#endif
+#ifdef ACPI_REDUCED_HARDWARE
I think here would be #ifdef CONFIG_ACPI_REDUCED_HARDWARE or #if (!ACPI_REDUCED_HARDWARE)
because ACPI_REDUCED_HARDWARE will always defined no matter the value is FALSE or TRUE.
+/* Bus Master Reload is not supported in the reduced hardware profile */ +static int acpi_processor_suspend(void) +{
- return 0;
+} +#else static int acpi_processor_suspend(void) { acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &saved_bm_rld); return 0; } +#endif
+#ifdef ACPI_REDUCED_HARDWARE
Here too.
+/* Bus Master Reload is not supported in the reduced hardware profile */ +static void acpi_processor_resume(void) { } +#else static void acpi_processor_resume(void) { u32 resumed_bm_rld; @@ -237,6 +252,7 @@ static void acpi_processor_resume(void)
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld); } +#endif
Since saved_bm_rld and acpi_processor_suspend/resume() are all should redefined when in HW reduced mode, how about do it like this?
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 587f3cf..942a2f0 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -219,6 +219,7 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr, #endif
#ifdef CONFIG_PM_SLEEP +#ifndef CONFIG_ACPI_REDUCED_HARDWARE static u32 saved_bm_rld;
static int acpi_processor_suspend(void) @@ -237,6 +238,10 @@ static void acpi_processor_resume(void)
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld);
} +#else +static int acpi_processor_suspend(void) {return 0;} +static void acpi_processor_resume(void) {return;} +#endif /* CONFIG_ACPI_REDUCED_HARDWARE */
Thanks Hanjun
Much cleaner; this will show up in the next version. Thanks.