* [PATCH] [APM] Is this the correct way to fix suspend bug introduced in 2.6.0-test4?
@ 2004-01-25 19:50 Michael Schierl
2004-01-28 17:46 ` Pavel Machek
2004-01-29 23:00 ` Axel Boldt
0 siblings, 2 replies; 6+ messages in thread
From: Michael Schierl @ 2004-01-25 19:50 UTC (permalink / raw)
To: fr, linux-laptop; +Cc: linux-kernel, mochel
Hi,
the patch below (against 2.6.1-mm5) fixes my APM problems (my laptop, Acer
TravelMate 210TEV (Celeron 700, 128 MB RAM), hangs after resuming from APM
since 2.6.0-test4).
I found the "fix" by trying to "reversely" backport the changes from
patch-2.6.0-test4.bz2 into 2.6.1-mm5 (the old device_suspend code calls
sysdev_suspend, the new one does not; so what do I lose if I call
sysdev_suspend myself?). This trial-and-error-approach finally led into the
patch below (which works great for me).
Most likely this is not the cleanest way to do this; but since I don't even
know what this sysdev_suspend does (except that it does something that
seems to be vital for making my laptop resume...), i don't know how to make
it better...
If you have any suggestions, tell me (or change it yourself and submit it),
if you think that's okay like that, please submit that to the guy who is
responsible for 2.6 (is it Linus or Andrew? did not follow lkml recently).
TIA,
Michael
PS: if possible, please CC me in yout replies
====== apm-bug-introduced-in-test4.patch ======
--- linux-2.6.1-mm5/arch/i386/kernel/apm.c.old Sun Jan 25 14:48:27 2004
+++ linux-2.6.1-mm5/arch/i386/kernel/apm.c Sun Jan 25 16:10:43 2004
@@ -234,6 +234,9 @@ extern spinlock_t i8253_lock;
extern unsigned long get_cmos_time(void);
extern void machine_real_restart(unsigned char *, int);
+extern int sysdev_resume(void);
+extern int sysdev_suspend(u32 state);
+
#if defined(CONFIG_APM_DISPLAY_BLANK) && defined(CONFIG_VT)
extern int (*console_blank_hook)(int);
#endif
@@ -1199,6 +1202,7 @@ static int suspend(int vetoable)
}
device_suspend(3);
+ sysdev_suspend(3);
/* serialize with the timer interrupt */
write_seqlock_irq(&xtime_lock);
@@ -1232,6 +1236,7 @@ static int suspend(int vetoable)
if (err != APM_SUCCESS)
apm_error("suspend", err);
err = (err == APM_SUCCESS) ? 0 : -EIO;
+ sysdev_resume();
device_resume();
pm_send_all(PM_RESUME, (void *)0);
queue_event(APM_NORMAL_RESUME, NULL);
@@ -1250,6 +1255,7 @@ static void standby(void)
{
int err;
+ sysdev_suspend(3);
/* serialize with the timer interrupt */
write_seqlock_irq(&xtime_lock);
/* If needed, notify drivers here */
@@ -1259,6 +1265,7 @@ static void standby(void)
err = set_system_power_state(APM_STATE_STANDBY);
if ((err != APM_SUCCESS) && (err != APM_NO_ERROR))
apm_error("standby", err);
+ sysdev_resume();
}
static apm_event_t get_event(void)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] [APM] Is this the correct way to fix suspend bug introduced in 2.6.0-test4?
2004-01-25 19:50 [PATCH] [APM] Is this the correct way to fix suspend bug introduced in 2.6.0-test4? Michael Schierl
@ 2004-01-28 17:46 ` Pavel Machek
2004-01-29 19:10 ` Michael Schierl
2004-01-29 23:00 ` Axel Boldt
1 sibling, 1 reply; 6+ messages in thread
From: Pavel Machek @ 2004-01-28 17:46 UTC (permalink / raw)
To: schierlm; +Cc: fr, linux-laptop, linux-kernel, mochel
Hi!
>
> the patch below (against 2.6.1-mm5) fixes my APM problems (my laptop, Acer
> TravelMate 210TEV (Celeron 700, 128 MB RAM), hangs after resuming from APM
> since 2.6.0-test4).
>
> I found the "fix" by trying to "reversely" backport the changes from
> patch-2.6.0-test4.bz2 into 2.6.1-mm5 (the old device_suspend code calls
> sysdev_suspend, the new one does not; so what do I lose if I call
> sysdev_suspend myself?). This trial-and-error-approach finally led into the
> patch below (which works great for me).
>
> Most likely this is not the cleanest way to do this; but since I don't even
> know what this sysdev_suspend does (except that it does something that
> seems to be vital for making my laptop resume...), i don't know how to make
> it better...
>
> If you have any suggestions, tell me (or change it yourself and submit it),
> if you think that's okay like that, please submit that to the guy who is
> responsible for 2.6 (is it Linus or Andrew? did not follow lkml
> recently).
Andrew.
I think you should use device_power_down() and device_power_up(),
instead. Check it, but it looks to me like that's better way.
Pavel
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] [APM] Is this the correct way to fix suspend bug introduced in 2.6.0-test4?
2004-01-28 17:46 ` Pavel Machek
@ 2004-01-29 19:10 ` Michael Schierl
2004-01-29 19:36 ` Michael Schierl
2004-01-29 19:55 ` Pavel Machek
0 siblings, 2 replies; 6+ messages in thread
From: Michael Schierl @ 2004-01-29 19:10 UTC (permalink / raw)
To: Pavel Machek; +Cc: Stephen Rothwell, linux-laptop, linux-kernel, mochel
[-- Attachment #1: Type: text/plain, Size: 838 bytes --]
Pavel Machek schrieb:
>
> Hi!
> >
> > the patch below (against 2.6.1-mm5) fixes my APM problems (my laptop, Acer
> > TravelMate 210TEV (Celeron 700, 128 MB RAM), hangs after resuming from APM
> > since 2.6.0-test4).
> >
> > If you have any suggestions, tell me
> I think you should use device_power_down() and device_power_up(),
> instead. Check it, but it looks to me like that's better way.
Works for me as well (Patch attached).
> > if you think that's okay like that, please submit that to the guy who is
> > responsible for 2.6 (is it Linus or Andrew? did not follow lkml
> > recently).
>
> Andrew.
Thanks. BTW: I did not get any response from Stephen Rothwell (the guy
who is listed as maintainer for APM in the MAINTAINERS file). How long
should I wait for a response? Or should I simply submit the patch to
Andrew?
Michael
[-- Attachment #2: apm-bug-introduced-in-test4-v2.patch --]
[-- Type: text/plain, Size: 1050 bytes --]
--- linux-2.6.2-rc2-mm1/arch/i386/kernel/apm.c.old Thu Jan 29 16:22:03 2004
+++ linux-2.6.2-rc2-mm1/arch/i386/kernel/apm.c Thu Jan 29 16:22:07 2004
@@ -1201,6 +1201,7 @@ static int suspend(int vetoable)
}
device_suspend(3);
+ device_power_down(3);
/* serialize with the timer interrupt */
write_seqlock_irq(&xtime_lock);
@@ -1234,6 +1235,7 @@ static int suspend(int vetoable)
if (err != APM_SUCCESS)
apm_error("suspend", err);
err = (err == APM_SUCCESS) ? 0 : -EIO;
+ device_power_up();
device_resume();
pm_send_all(PM_RESUME, (void *)0);
queue_event(APM_NORMAL_RESUME, NULL);
@@ -1252,6 +1254,7 @@ static void standby(void)
{
int err;
+ device_power_down(3);
/* serialize with the timer interrupt */
write_seqlock_irq(&xtime_lock);
/* If needed, notify drivers here */
@@ -1261,6 +1264,7 @@ static void standby(void)
err = set_system_power_state(APM_STATE_STANDBY);
if ((err != APM_SUCCESS) && (err != APM_NO_ERROR))
apm_error("standby", err);
+ device_power_up();
}
static apm_event_t get_event(void)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] [APM] Is this the correct way to fix suspend bug introduced in 2.6.0-test4?
2004-01-29 19:10 ` Michael Schierl
@ 2004-01-29 19:36 ` Michael Schierl
2004-01-29 19:55 ` Pavel Machek
1 sibling, 0 replies; 6+ messages in thread
From: Michael Schierl @ 2004-01-29 19:36 UTC (permalink / raw)
To: Pavel Machek, linux-laptop, linux-kernel
I wrote:
> Thanks. BTW: I did not get any response from Stephen Rothwell (the guy
> who is listed as maintainer for APM in the MAINTAINERS file). How long
> should I wait for a response? Or should I simply submit the patch to
> Andrew?
JFTR: Now this address bounced:
550_5.1.1_<fr@canb.auug.org.au>..._User_unknown/Giving_up_on_203.10.76.34./
Michael
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] [APM] Is this the correct way to fix suspend bug introduced in 2.6.0-test4?
2004-01-29 19:10 ` Michael Schierl
2004-01-29 19:36 ` Michael Schierl
@ 2004-01-29 19:55 ` Pavel Machek
1 sibling, 0 replies; 6+ messages in thread
From: Pavel Machek @ 2004-01-29 19:55 UTC (permalink / raw)
To: Michael Schierl; +Cc: Stephen Rothwell, linux-laptop, linux-kernel, mochel
Hi!
> > > if you think that's okay like that, please submit that to the guy who is
> > > responsible for 2.6 (is it Linus or Andrew? did not follow lkml
> > > recently).
> >
> > Andrew.
>
> Thanks. BTW: I did not get any response from Stephen Rothwell (the guy
> who is listed as maintainer for APM in the MAINTAINERS file). How long
> should I wait for a response? Or should I simply submit the patch to
> Andrew?
I'd submit patch to andrew, Cc: stephen. -mm series should get enough
testing, and this is not to big patch.
[The patch looks good to me, btw.]
Pavel
> Michael
> --- linux-2.6.2-rc2-mm1/arch/i386/kernel/apm.c.old Thu Jan 29 16:22:03 2004
> +++ linux-2.6.2-rc2-mm1/arch/i386/kernel/apm.c Thu Jan 29 16:22:07 2004
> @@ -1201,6 +1201,7 @@ static int suspend(int vetoable)
> }
>
> device_suspend(3);
> + device_power_down(3);
>
> /* serialize with the timer interrupt */
> write_seqlock_irq(&xtime_lock);
> @@ -1234,6 +1235,7 @@ static int suspend(int vetoable)
> if (err != APM_SUCCESS)
> apm_error("suspend", err);
> err = (err == APM_SUCCESS) ? 0 : -EIO;
> + device_power_up();
> device_resume();
> pm_send_all(PM_RESUME, (void *)0);
> queue_event(APM_NORMAL_RESUME, NULL);
> @@ -1252,6 +1254,7 @@ static void standby(void)
> {
> int err;
>
> + device_power_down(3);
> /* serialize with the timer interrupt */
> write_seqlock_irq(&xtime_lock);
> /* If needed, notify drivers here */
> @@ -1261,6 +1264,7 @@ static void standby(void)
> err = set_system_power_state(APM_STATE_STANDBY);
> if ((err != APM_SUCCESS) && (err != APM_NO_ERROR))
> apm_error("standby", err);
> + device_power_up();
> }
>
> static apm_event_t get_event(void)
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] [APM] Is this the correct way to fix suspend bug introduced in 2.6.0-test4?
2004-01-25 19:50 [PATCH] [APM] Is this the correct way to fix suspend bug introduced in 2.6.0-test4? Michael Schierl
2004-01-28 17:46 ` Pavel Machek
@ 2004-01-29 23:00 ` Axel Boldt
1 sibling, 0 replies; 6+ messages in thread
From: Axel Boldt @ 2004-01-29 23:00 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-laptop
Michael Schierl wrote:
> the patch below (against 2.6.1-mm5) fixes my APM problems
And mine as well (Dell Inspiron 5000 laptop).
Axel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-01-29 22:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-25 19:50 [PATCH] [APM] Is this the correct way to fix suspend bug introduced in 2.6.0-test4? Michael Schierl
2004-01-28 17:46 ` Pavel Machek
2004-01-29 19:10 ` Michael Schierl
2004-01-29 19:36 ` Michael Schierl
2004-01-29 19:55 ` Pavel Machek
2004-01-29 23:00 ` Axel Boldt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox