Fix acpi sleeps on mvp3 and toshiba
Hi!
This fixes machine-specific glitches. S1 and S5 now works on athlon and toshiba and S4 has at least chance to work... Please tell me what to modify so that you can apply [Looks like that can be quite
problematic: are you going to port dmi stuff to NT, and *BSD? Also, how to wrap this nicely?]
Pavel
include/asm-i386/system.h +4 -0
@@ -340,4 +340,8 @@void disable_hlt (void );void enable_hlt (void ); +extern unsigned long dmi_broken; +#define BROKEN_ACPI_Sx 0x0001 +#define BROKEN_INIT_AFTER_S1 0x0002 +#endif
arch/i386/kernel/dmi_scan.c +47 -1
66 lines not on this page · raw message
drivers/acpi/hardware/hwregs.c +19 -0
@@ -29,6 +29,7 @@#include "acpi.h" #include "achware.h" #include "acnamesp.h" +#include <asm/system.h> #define _COMPONENT ACPI_HARDWAREMODULE_NAME ("hwregs" )
@@ -162,6 +163,24 @@if ((sleep_state >ACPI_S_STATES_MAX ) || !slp_typ_a || !slp_typ_b) {return_ACPI_STATUS (AE_BAD_PARAMETER ); + } + +if (dmi_broken & BROKEN_ACPI_Sx) { +printk ("Attempted to enter %d\n" , sleep_state); +switch (sleep_state) { +/* 0,3,4,6,7,8,11,15 is nop */ +/* 5 is nop, too? No. 5 is some valid state, just not S1 nor S3 (strange). */ +/* 13 is lockup when used in S1 or S3 context */ +/* 14 is "keep monitor on and than all goes off when power is pressed in S1 context */ +/* 1,2,10,9,14 are known working */ +/* 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 */ +case 1 : *slp_typ_a = *slp_typ_b =12 ;return_ACPI_STATUS (status);/* Hey, seems okay! */ +case 3 : *slp_typ_a = *slp_typ_b =15 ;return_ACPI_STATUS (status);/* Not known, yet */ +case 4 : *slp_typ_a = *slp_typ_b =1 ;return_ACPI_STATUS (status);/* Seems ok, but it times somehow long to wakeup. Is it possible this is S3? (same as 9) */ +case 5 : *slp_typ_a = *slp_typ_b =10 ;return_ACPI_STATUS (status);/* Seems ok, (same as 2) */ + default: return_ACPI_STATUS (AE_BAD_PARAMETER) + } + }/*
drivers/acpi/ospm/system/sm_osl.c +5 -0
@@ -719,6 +780,11 @@/* TODO: resume devices and restore their state */ enable (); + +if (dmi_broken &BROKEN_INIT_AFTER_S1 ) { +printk ("Broken toshiba laptop -> kicking interrupts\n" ); +init_8259A (0 ); + }return status; }
Signature · 2 lines
I'm [email protected]. "In my country we have almost anarchy and I don't care." Panos Katsaloulis describing me w.r.t. patents at [email protected]