Skip to contentSkip to conversation

2.4.5-ac8 hardlocks when going to standby

DISCUSSION Mikael Pettersson 2 participants 2 messages Jun 7, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 6 lines · Remi Turk
Quoted 5 lines · Remi Turk

By applying the following patch (lookalike)?

arch/i386/kernel/apm.c:send_event():

Quoted 11 lines
Quoted 8 lines

case APM_SYS_SUSPEND:
case APM_CRITICAL_SUSPEND:
case APM_USER_SUSPEND:

(quoted diff) +2 -0
+	case APM_USER_STANDBY:
+	case APM_SYS_STANDBY:
		/* map all suspends to ACPI D3 */
		if (pm_send_all(PM_SUSPEND, (void
			*)3)) {

Well, I tried this one (did I understand correctly wat you meant???) and it didn't make any difference.

Try the patch below. Reboot. Run 'apm -S' (or --standby) at the console. Did you see output from both send_event and apic_pm_callback? If so, repeat by pressing your power-switch-as-standby button. You should see the same output -- if not, something APM-related is broken.

FYI, the patch below to apm.c:send_event() [w/o the printk] prevents my ASUS P3B-F from hanging hard if I invoke apm standby in a UP-APIC enabled kernel. (Actually, standby doesn't do much on my box since it wakes up after 1 second or so. I don't know why, perhaps a hub->nic link beat? 'suspend' works ok, however. Oh, and I have to disable RedHat's worthless 'kudzu' crap, otherwise 'suspend' won't work.)

/Mikael

arch/i386/kernel/apic.c renamed from arch/i386/kernel/apic.c.~1~ +2 -0
@@ -480,6 +480,8 @@
 
 static int apic_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
 {
+	printk(__FUNCTION__ ": rqst %u data %lu\n", rqst, (long)data);
+	mdelay(1000);
 	switch (rqst) {
 	case PM_SUSPEND:
 		apic_pm_suspend(data);
arch/i386/kernel/apm.c renamed from arch/i386/kernel/apm.c.~1~ +4 -0
@@ -915,10 +915,13 @@
 
 static int send_event(apm_event_t event)
 {
+	printk(__FUNCTION__ ": event %u\n", event);
 	switch (event) {
 	case APM_SYS_SUSPEND:
 	case APM_CRITICAL_SUSPEND:
 	case APM_USER_SUSPEND:
+	case APM_SYS_STANDBY:
+	case APM_USER_STANDBY:
 		/* map all suspends to ACPI D3 */
 		if (pm_send_all(PM_SUSPEND, (void *)3)) {
 			if (event == APM_CRITICAL_SUSPEND) {
@@ -932,6 +935,7 @@
 		break;
 	case APM_NORMAL_RESUME:
 	case APM_CRITICAL_RESUME:
+	case APM_STANDBY_RESUME:
 		/* map all resumes to ACPI D0 */
 		(void) pm_send_all(PM_RESUME, (void *)0);
 		break;
arch/i386/kernel/nmi.c renamed from arch/i386/kernel/nmi.c.~1~ +2 -0
@@ -124,6 +124,8 @@
 
 static int nmi_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
 {
+	printk(__FUNCTION__ ": rqst %u data %lu\n", rqst, (long)data);
+	mdelay(1000);
 	switch (rqst) {
 	case PM_SUSPEND:
 		disable_apic_nmi_watchdog();
#1 lore raw
Quoted 6 lines · Mikael Pettersson

On Wed, 6 Jun 2001 22:42:53 +0200, Remi Turk wrote:

Try the patch below. Reboot. Run 'apm -S' (or --standby) at the console. Did you see output from both send_event and apic_pm_callback? If so, repeat by pressing your power-switch-as-standby button. You should see the same output -- if not, something APM-related is broken.

apm --standby works fine now:
send_event: event 9
apic_pm_callback: rqst 0 data 3
nmi_pm_callback: rqst 0 data 3
and on resume:
send_event: event 11
apic_pm_callback: rqst 1 data 0
nmi_pm_callback: rqst 1 data 0

apm --suspend also does what it should (and already did):
send_event: event 10
apic_pm_callback: rqst 0 data 3
nmi_pm_callback: rqst 0 data 3
and on resume:
send_event: event 3
apic_pm_callback: rqst 1 data 0
nmi_pm_callback: rqst 1 data 0

My "standbybutton" still hardlocks however. Should I dig up some more info about my mainboard/BIOS?

Quoted 5 lines

FYI, the patch below to apm.c:send_event() [w/o the printk] prevents my ASUS P3B-F from hanging hard if I invoke apm standby in a UP-APIC enabled kernel. (Actually, standby doesn't do much on my box since it wakes up after 1 second or so. I don't know why, perhaps a hub->nic link beat? 'suspend' works ok, however. Oh, and I have to disable

Try "sleep 2; apm --standby" or paste the newline with your mouse. It works for me - my keyboard probably still sends data when my system is already going into standby.

Quoted 1 line

RedHat's worthless 'kudzu' crap, otherwise 'suspend' won't work.)

It slows down booting a few seconds, and besides, I usually know it when I add hardware, so kudzu is one of the first packages I remove when installing.

Quoted 10 lines

/Mikael

arch/i386/kernel/apm.c renamed from arch/i386/kernel/apm.c.~1~ +2 -0
 	case APM_USER_SUSPEND:
+	case APM_SYS_STANDBY:
+	case APM_USER_STANDBY:
 		/* map all suspends to ACPI D3 */
 		if (pm_send_all(PM_SUSPEND, (void *)3)) {
 			if (event == APM_CRITICAL_SUSPEND) {

arch/i386/kernel/apm.c line 939

Quoted 5 lines
arch/i386/kernel/apm.c renamed from arch/i386/kernel/apm.c.~1~ +1 -0
@@ -932,6 +935,7 @@
 		break;
 	case APM_NORMAL_RESUME:
 	case APM_CRITICAL_RESUME:
+	case APM_STANDBY_RESUME:
 		/* map all resumes to ACPI D0 */

It locked when suspending so I don't expect the added "case APM_STANDBY_RESUME" to make any difference. printk() doesn't seem to be logical too, and I tried the "case APM_SYS_STANDBY" and "case APM_SYS_SUSPEND" yesterday (didn't make a difference) so it looks like the mdelay() does it.

Signature · 1 line
Linux 2.4.6-pre1 #1 Wed Jun 6 18:25:37 CEST 2001