lkml.org 
[lkml]   [1998]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: APM Suspend/resume problems: analysis and proposal
Stephen Rothwell writes:
> Richard Gooch <rgooch@atnf.csiro.au> writes:
> > What I'm seeing is a sequence like:
> > suspend, resume, suspend, resume.
> >
> > I noticed that the time between the first resume and the second
> > suspend is up to and including 2 jiffies. The fix I implemented for
> > this is to ignore a suspend event less than HZ jiffies (i.e. 1 second)
> > after a resume event.
> >
> > ****PROPOSAL 1: add this to the kernel, available as a config option.
>
> Seems like a reasonable work around.

OK, I've appended a patch. Linus: can you please include this?

> [Removed stuff about RTC reading and reseeting the time.]
>
> > ****PROPOSAL 2: add an ioctl() to /proc/apm so that the kernel can be
> > told the offset between the system clock and the RTC.
>
> Again, seems liek a resonable workaround. However see the patch on
> my home page - I have started to add sysctls for this stuff.

OK, I'll have a squiz.

Regards,

Richard....

diff -urN linux-2.1.129/Documentation/Configure.help linux/Documentation/Configure.help
--- linux-2.1.129/Documentation/Configure.help Mon Nov 16 05:12:01 1998
+++ linux/Documentation/Configure.help Thu Nov 26 09:05:24 1998
@@ -8288,6 +8288,16 @@
ignored. Without this the Thinkpad 560 has troubles with the user
level daemon apmd, and with the PCMCIA package pcmcia-cs.

+Ignore multiple suspend/resume cycles
+CONFIG_APM_IGNORE_SUSPEND_BOUNCE
+ This option is necessary on the Dell Inspiron 3200, but should be
+ safe for all other laptops. When enabled, a system suspend event
+ that occurs within one second of a resume is ignored. Without this
+ the Inspiron will shut itself off a few seconds after you open the
+ lid, requiring you to press the power button to resume it a second
+ time.
+ Say Y.
+
Watchdog Timer Support
CONFIG_WATCHDOG
If you say Y here (and to one of the following options) and create a
diff -urN linux-2.1.129/arch/i386/config.in linux/arch/i386/config.in
--- linux-2.1.129/arch/i386/config.in Fri Oct 2 03:02:21 1998
+++ linux/arch/i386/config.in Thu Nov 26 09:10:27 1998
@@ -72,6 +72,7 @@
bool ' Enable console blanking using APM' CONFIG_APM_DISPLAY_BLANK
bool ' Power off on shutdown' CONFIG_APM_POWER_OFF
bool ' Ignore multiple suspend' CONFIG_APM_IGNORE_MULTIPLE_SUSPEND
+ bool ' Ignore multiple suspend/resume cycles' CONFIG_APM_IGNORE_SUSPEND_BOUNCE
fi

endmenu
diff -urN linux-2.1.129/arch/i386/kernel/apm.c linux/arch/i386/kernel/apm.c
--- linux-2.1.129/arch/i386/kernel/apm.c Thu Oct 8 11:52:05 1998
+++ linux/arch/i386/kernel/apm.c Thu Nov 26 08:57:47 1998
@@ -772,6 +772,9 @@
static void check_events(void)
{
apm_event_t event;
+#ifdef CONFIG_APM_IGNORE_SUSPEND_BOUNCE
+ long last_resume = 0;
+#endif

while ((event = get_event()) != 0) {
#ifdef APM_DEBUG
@@ -803,6 +806,10 @@
break;
#endif
case APM_SYS_SUSPEND:
+#ifdef CONFIG_APM_IGNORE_SUSPEND_BOUNCE
+ if (last_resume + HZ > jiffies)
+ break;
+#endif
#ifdef CONFIG_APM_IGNORE_MULTIPLE_SUSPEND
if (waiting_for_resume) {
return;
@@ -819,6 +826,9 @@
case APM_STANDBY_RESUME:
#ifdef CONFIG_APM_IGNORE_MULTIPLE_SUSPEND
waiting_for_resume = 0;
+#endif
+#ifdef CONFIG_APM_IGNORE_SUSPEND_BOUNCE
+ last_resume = jiffies;
#endif
set_time();
send_event(event, 0, NULL);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.042 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site