public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* RE: standby problem
@ 2005-09-19  8:27 Li, Shaohua
  2005-09-19  8:32 ` Pavel Machek
  0 siblings, 1 reply; 12+ messages in thread
From: Li, Shaohua @ 2005-09-19  8:27 UTC (permalink / raw)
  To: Pavel Machek; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hi Pavel,
>>
>> i wanted to know what's mean this error :)
>>
>> mrspurr:/home/giskard# echo standby > /sys/power/state
>> acpi_pm_prepare does not support 1
>>
>> means that my laptop doesn't supporto standby mode?
>
>Probably yes.
Is it possible we can just show available pm states in /sys/power/state?
I think we should report the error earlier before we do actual
suspend/resume. (maybe pm_ops should have a .supported_states callback
for all archs) It seems many users are complaining about this after Len
deprecated the proc interface.

Thanks,
Shaohua


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: standby problem
@ 2005-09-20  5:31 Li, Shaohua
  2005-09-21  0:49 ` Randy.Dunlap
  0 siblings, 1 reply; 12+ messages in thread
From: Li, Shaohua @ 2005-09-20  5:31 UTC (permalink / raw)
  To: Randy.Dunlap
  Cc: pavel-AlSwsSmVLrQ, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

>> >
>> >> >> i wanted to know what's mean this error :)
>> >> >>
>> >> >> mrspurr:/home/giskard# echo standby > /sys/power/state
>> >> >> acpi_pm_prepare does not support 1
>> >> >>
>> >> >> means that my laptop doesn't supporto standby mode?
>> >> >
>> >> >Probably yes.
>> >> Is it possible we can just show available pm states in
>> /sys/power/state?
>> >> I think we should report the error earlier before we do actual
>> >> suspend/resume. (maybe pm_ops should have a .supported_states
>> callback
>> >> for all archs) It seems many users are complaining about this
after
>> Len
>> >> deprecated the proc interface.
>> >
>> >Pavel Troller even had a patch, but it was too ugly. Yes, we should
>> >only list available states in /sys/power/state.
>> Ok, how does this one look? Each arch provides a .valid callback.
>
>With this patch, I see in /sys/power/state either:
>standby disk		# if CONFIG_SOFTWARE_SUSPEND=y
>
>or just:
>standby			# if CONFIG_SOFTWARE_SUSPEND=n
>
>Does this mean that my poor old BIOS cannot do STR or did I miss
>a config option?  Yes, I have CONFIG_ACPI_SLEEP=y.
>Is there another config option for STR?
It's interesting one system support standby but not support STR. Your
dmesg will tell us which states the system supports.

Thanks,
Shaohua


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: standby problem
@ 2005-09-19  9:00 Li, Shaohua
  2005-09-19  9:05 ` Pavel Machek
  2005-09-20  4:09 ` Randy.Dunlap
  0 siblings, 2 replies; 12+ messages in thread
From: Li, Shaohua @ 2005-09-19  9:00 UTC (permalink / raw)
  To: Pavel Machek; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/plain, Size: 803 bytes --]

Hi,
>
>> >> i wanted to know what's mean this error :)
>> >>
>> >> mrspurr:/home/giskard# echo standby > /sys/power/state
>> >> acpi_pm_prepare does not support 1
>> >>
>> >> means that my laptop doesn't supporto standby mode?
>> >
>> >Probably yes.
>> Is it possible we can just show available pm states in
/sys/power/state?
>> I think we should report the error earlier before we do actual
>> suspend/resume. (maybe pm_ops should have a .supported_states
callback
>> for all archs) It seems many users are complaining about this after
Len
>> deprecated the proc interface.
>
>Pavel Troller even had a patch, but it was too ugly. Yes, we should
>only list available states in /sys/power/state.
Ok, how does this one look? Each arch provides a .valid callback.

Thanks,
Shaohua

[-- Attachment #2: pm_states_cleanup.patch --]
[-- Type: application/octet-stream, Size: 2158 bytes --]



---

 linux-2.6.14-rc1-root/drivers/acpi/sleep/main.c |    8 ++++++++
 linux-2.6.14-rc1-root/include/linux/pm.h        |    1 +
 linux-2.6.14-rc1-root/kernel/power/main.c       |    5 ++++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff -puN kernel/power/main.c~pm_states_cleanup kernel/power/main.c
--- linux-2.6.14-rc1/kernel/power/main.c~pm_states_cleanup	2005-09-19 16:32:53.000000000 +0800
+++ linux-2.6.14-rc1-root/kernel/power/main.c	2005-09-19 16:51:12.000000000 +0800
@@ -167,6 +167,8 @@ static int enter_state(suspend_state_t s
 {
 	int error;
 
+	if (pm_ops->valid && !pm_ops->valid(state))
+		return -ENODEV;
 	if (down_trylock(&pm_sem))
 		return -EBUSY;
 
@@ -236,7 +238,8 @@ static ssize_t state_show(struct subsyst
 	char * s = buf;
 
 	for (i = 0; i < PM_SUSPEND_MAX; i++) {
-		if (pm_states[i])
+		if (pm_states[i] && pm_ops && (!pm_ops->valid
+			||(pm_ops->valid && pm_ops->valid(i))))
 			s += sprintf(s,"%s ",pm_states[i]);
 	}
 	s += sprintf(s,"\n");
diff -puN include/linux/pm.h~pm_states_cleanup include/linux/pm.h
--- linux-2.6.14-rc1/include/linux/pm.h~pm_states_cleanup	2005-09-19 16:33:35.000000000 +0800
+++ linux-2.6.14-rc1-root/include/linux/pm.h	2005-09-19 16:50:38.000000000 +0800
@@ -170,6 +170,7 @@ typedef int __bitwise suspend_disk_metho
 
 struct pm_ops {
 	suspend_disk_method_t pm_disk_mode;
+	int (*valid)(suspend_state_t state);
 	int (*prepare)(suspend_state_t state);
 	int (*enter)(suspend_state_t state);
 	int (*finish)(suspend_state_t state);
diff -puN drivers/acpi/sleep/main.c~pm_states_cleanup drivers/acpi/sleep/main.c
--- linux-2.6.14-rc1/drivers/acpi/sleep/main.c~pm_states_cleanup	2005-09-19 16:42:26.000000000 +0800
+++ linux-2.6.14-rc1-root/drivers/acpi/sleep/main.c	2005-09-19 16:51:33.000000000 +0800
@@ -158,7 +158,15 @@ int acpi_suspend(u32 acpi_state)
 	return -EINVAL;
 }
 
+static int acpi_pm_state_valid(suspend_state_t pm_state)
+{
+	u32 acpi_state = acpi_suspend_states[pm_state];
+
+	return sleep_states[acpi_state];
+}
+
 static struct pm_ops acpi_pm_ops = {
+	.valid = acpi_pm_state_valid,
 	.prepare = acpi_pm_prepare,
 	.enter = acpi_pm_enter,
 	.finish = acpi_pm_finish,
_

^ permalink raw reply	[flat|nested] 12+ messages in thread
* standby problem
@ 2005-09-14 17:45 giskard
       [not found] ` <1126719945.4563.12.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: giskard @ 2005-09-14 17:45 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

hello,

i wanted to know what's mean this error :)

mrspurr:/home/giskard# echo standby > /sys/power/state
acpi_pm_prepare does not support 1

means that my laptop doesn't supporto standby mode?

another question: i can suspend to ram my laptop without problems (echo
mem > /sys/power/state) but when i try to resume it i get a black screen
and then i need to reboot it. i need to do something else for resume
it? 

i have a:
satellite a80-111
linux 2.6.13 with suspend2.net patch
 
-- 
ciao giskard

non ho peli sulla lingua. e se ce li ho... non sono miei.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2005-09-21  0:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-19  8:27 standby problem Li, Shaohua
2005-09-19  8:32 ` Pavel Machek
     [not found]   ` <20050919083205.GH1893-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-09-19  8:44     ` Pavel Troller
     [not found]       ` <20050919084442.GA26295-hxMeMO63rIAUgFT2KJq8fg@public.gmane.org>
2005-09-19 14:32         ` Randy.Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2005-09-20  5:31 Li, Shaohua
2005-09-21  0:49 ` Randy.Dunlap
2005-09-19  9:00 Li, Shaohua
2005-09-19  9:05 ` Pavel Machek
2005-09-20  4:09 ` Randy.Dunlap
     [not found]   ` <20050919210936.4cd0c3b7.rdunlap-/UHa2rfvQTnk1uMJSBkQmQ@public.gmane.org>
2005-09-20  9:44     ` Pavel Machek
2005-09-14 17:45 giskard
     [not found] ` <1126719945.4563.12.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2005-09-19  6:59   ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox