Re: 2.6.25-rc1 regression - suspend to ram

Previous thread: [PATCH]intel-iommu batched iotlb flushes by mark gross on Monday, February 11, 2008 - 3:41 pm. (16 messages)

Next thread: [PATCH] Avoid buffer overflows in get_user_pages() by Jonathan Corbet on Monday, February 11, 2008 - 4:17 pm. (6 messages)
From: Lukas Hejtmanek
Date: Monday, February 11, 2008 - 3:58 pm

Hello,

2.6.25-rc1 takes really long time till it suspends (about 30-40secs, used to
be about 5 secs at all) and it is resuming about few minutes.  While resuming,
capslock toggles the capslock led but with few secs delay.

2.6.24-git15 was OK. 2.6.24 is OK.

I have Lenovo ThinkPad T61.

-- 
Lukáš Hejtmánek
--

From: R. J. Wysocki
Date: Monday, February 11, 2008 - 4:10 pm

If you have CONFIG_CPU_IDLE set, please try to boot with idle=poll and see if
that helps.

Thanks,
Rafael
--

From: Venki Pallipadi
Date: Monday, February 11, 2008 - 4:22 pm

Just sent this patch to fix a regression in acpi processor_idle.c on another
thread. Can you try the patch below and check whether that helps.

Thanks,
Venki


Earlier patch (bc71bec91f9875ef825d12104acf3bf4ca215fa4) broke
suspend resume on many laptops. The problem was reported by
Carlos R. Mafra and Calvin Walton, who bisected the issue to above patch.

The problem was because, C2 and C3 code were calling acpi_idle_enter_c1
directly, with C2 or C3 as state parameter, while suspend/resume was in
progress. The patch bc71bec started making use of that state information,
assuming that it would always be referring to C1 state. This caused the
problem with suspend-resume as we ended up using C2/C3 state indirectly.

Fix this by adding acpi_idle_suspend check in enter_c1.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>

Index: linux-2.6.25-rc1/drivers/acpi/processor_idle.c
===================================================================
--- linux-2.6.25-rc1.orig/drivers/acpi/processor_idle.c
+++ linux-2.6.25-rc1/drivers/acpi/processor_idle.c
@@ -1420,6 +1420,14 @@ static int acpi_idle_enter_c1(struct cpu
 		return 0;
 
 	local_irq_disable();
+
+	/* Do not access any ACPI IO ports in suspend path */
+	if (acpi_idle_suspend) {
+		acpi_safe_halt();
+		local_irq_enable();
+		return 0;
+	}
+
 	if (pr->flags.bm_check)
 		acpi_idle_update_bm_rld(pr, cx);
 
--

From: Jesse Barnes
Date: Monday, February 11, 2008 - 4:32 pm

Excellent, that patch makes things work for me (including console restore).  
Thanks a lot Venki.

Jesse
--

From: Lukas Hejtmanek
Date: Tuesday, February 12, 2008 - 10:14 am

Yeah, it seems that it fixed suspend troubles.

-- 
Lukáš Hejtmánek
--

From: Jesse Barnes
Date: Monday, February 11, 2008 - 4:16 pm

Oh, you're lucky, I couldn't get my T61 to suspend at all with 2.6.25-rc1...  

Len found that it'll work again with idle=poll, but that'll cost you a lot of 
battery life...

Oh and make sure you have i915 loaded before you suspend if you want your text 
console to come back.

Jesse
--

Previous thread: [PATCH]intel-iommu batched iotlb flushes by mark gross on Monday, February 11, 2008 - 3:41 pm. (16 messages)

Next thread: [PATCH] Avoid buffer overflows in get_user_pages() by Jonathan Corbet on Monday, February 11, 2008 - 4:17 pm. (6 messages)